예제 #1
0
def unassign_device(device_uid, patient_uid):
    AssignmentInfoAction.objects.create(
        device_uid=uuid.UUID(device_uid),
        patient_uid=uuid.UUID(patient_uid),
        assignment_type=AssignmentInfo.unassign,
        callback=lambda action: create_action(ActionType.assignment_inf, action
                                              ))
예제 #2
0
def create_patient(first_name, last_name):
    CreatePatientAction.objects.create(uid=uuid.uuid1(), first_name=first_name, last_name=last_name,
                                       callback=lambda action: create_action(ActionType.create_patient, action))
예제 #3
0
def create_device(serial_number):
    print(serial_number)
    CreateDeviceAction.objects.create(uid=uuid.uuid1(),
                                      serial_number=serial_number,
                                      callback=lambda action: create_action(
                                          ActionType.create_device, action))
예제 #4
0
def edit_patient(uid, first_name, last_name, contact_info):
    street, phone_number, email_address = contact_info
    contact_doc = ContactInfo(street=street, email_address=email_address, phone_number=phone_number)
    EditPatientAction.objects.create(patientUid=uuid.UUID(uid), new_first_name=first_name, new_last_name=last_name,
                                     contact_info=contact_doc,
                                     callback=lambda action: create_action(ActionType.edit_patient, action))