def do_create_clinic(args): name = args.name url = _get_url(args) keyfile = _generate_keyfile(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=keyfile) if args.wait and args.wait > 0: response = client.create_clinic(name, wait=args.wait) else: response = client.create_clinic(name) print("Response: {}".format(response))
def do_list_pulse(args): url = _get_url(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=None) pulse_list = client.list_pulse() if pulse_list is not None: fmt = "%-15s %-15s %-15s %-15s" print(fmt % ('PATIENT HEX', 'PATIENT PKEY', 'PULSE', 'TIMESTAMP')) for key, value in pulse_list.items(): print(fmt % (key, value.public_key, value.pulse, value.timestamp)) else: raise HealthCareException("Could not retrieve pulse listing.")
def do_list_patients(args): url = _get_url(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=None) patient_list = client.list_patients() if patient_list is not None: fmt = "%-15s %-15s %-15s %-15s" print(fmt % ('PATIENT HEX', 'NAME', 'SURNAME', 'PUBLIC_KEY')) for key, value in patient_list.items(): print(fmt % (key, value.name, value.surname, value.public_key)) else: raise HealthCareException("Could not retrieve patient listing.")
def do_list_doctors(args): url = _get_url(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=None) doctors_list = client.list_doctors() if doctors_list is not None: fmt = "%-15s %-15s %-15s" print(fmt % ('NAME', 'SURNAME', 'PUBLIC_KEY')) for doctor in doctors_list: print(fmt % (doctor.name, doctor.surname, doctor.public_key)) else: raise HealthCareException("Could not retrieve doctors listing.")
def do_add_pulse(args): pulse = args.pulse timestamp = args.timestamp url = _get_url(args) keyfile = _get_keyfile(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=keyfile) if args.wait and args.wait > 0: response = client.add_pulse(pulse, timestamp, wait=args.wait) else: response = client.add_pulse(pulse, timestamp) print("Response: {}".format(response))
def do_create_doctor(args): name = args.name surname = args.surname speciality = "Ortopeda" url = _get_url(args) keyfile = _generate_keyfile(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=keyfile) if args.wait and args.wait > 0: response = client.create_doctor(name, surname, speciality, wait=args.wait) else: response = client.create_doctor(name, surname) print("Response: {}".format(response))
def do_list_lab_test(args): url = _get_url(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=None) lab_test_list = client.list_lab_test() if lab_test_list is not None: fmt = "%-15s %-15s %-15s %-15s %-15s %-15s %-15s %-15s %-15s %-15s %-15s" print(fmt % ('CLINIC HEX', 'HEIGHT', 'WEIGHT', 'GENDER', 'A/G RATIO', 'ALBUMIN', 'ALKALINE PHOSPHATASE', 'APPEARANCE', 'BILIRUBIN', 'CASTS', 'COLOR')) for key, value in lab_test_list.items(): print( fmt % (key, value.height, value.weight, value.gender, value.a_g_ratio, value.albumin, value.alkaline_phosphatase, value.appearance, value.bilirubin, value.casts, value.color)) else: raise HealthCareException("Could not retrieve lab test listing.")
def do_add_lab_test(args): height = args.height weight = args.weight gender = args.gender a_g_ratio = args.a_g_ratio albumin = args.albumin alkaline_phosphatase = args.alkaline_phosphatase appearance = args.appearance bilirubin = args.bilirubin casts = args.casts color = args.color url = _get_url(args) keyfile = _get_keyfile(args) # auth_user, auth_password = _get_auth_info(args) client = HealthCareClient(base_url=url, keyfile=keyfile) if args.wait and args.wait > 0: response = client.add_lab_test(height, weight, gender, a_g_ratio, albumin, alkaline_phosphatase, appearance, bilirubin, casts, color, wait=args.wait) else: response = client.add_lab_test(height, weight, gender, a_g_ratio, albumin, alkaline_phosphatase, appearance, bilirubin, casts, color) print("Response: {}".format(response))