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 ))
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))
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))
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))