Case 3
Finding Specific orgUnits / Location by Id
Measuring performance based on time taken to find the following outlets / location in DHIS2 and FHIR
Country | UID | orgUnit |
---|---|---|
El Salvador | Fz5NHHnah7C | Clínica Dra. Cintya Iraheta |
El Salvador | onUMfZs0zeh | Hospital David King |
El Salvador | kJ14ifcScdC | Unidad Médica San Miguel (NF047) |
Kenya | LhNO7Q1tgck | Ithare Medical Clinic (10358) |
Kenya | V0Wh2NxXpeP | Korakora Health Centre (13382) |
Kenya | TIqvGd9EDw4 | Nimoli Medical Services |
Nigeria | rLBXeooeab7 | Adina Pharamacy - House 3, Road 1, FHA Estate, Lugbe |
Nigeria | FQ7cbWDi2Sq | Ajingi Primary Health Centre (fc-00-00-0069) |
Nigeria | iEEsjVZWZXN | LOLA PMS (NG_DISC_PPMV_00019) |
Cameroon | LaosQn5Ir4Q | Clinique La Sentinelle (LT335) |
Cameroon | QLUHuYeU7aT | CSI Lougguere |
Cameroon | IXageW1Ti5E | Nkouampoer (SU11009-17) |
Summary of test results
| DHIS2 | FHIR | DHIS2 vs FHIR % |
|
---|---|---|---|---|
Average | 0.321175 | 0.283594 | 13.25% |
|
Test detailed results
logged on Dec 1/ 2022 UTC-7 09:06:00
Performance Testing for finding | PSI's DHIS2 API (s) | DHIS2 Average (s) | FHIR API (s) | FHIR Average (s) | Improvement (%) |
---|---|---|---|---|---|
Clínica Dra. Cintya Iraheta | 0.327208, 0.295008, 0.279619 | 0.300612 | 0.320108, 0.293777, 0.290582 | 0.301489 | -0.29% |
Hospital David King | 0.303942, 0.288387, 0.297077 | 0.296469 | 0.285969, 0.278561, 0.274396 | 0.279642 | 6.02% |
Unidad Médica San Miguel (NF047) | 0.287184, 0.299348, 0.285113 | 0.290548 | 0.288675, 0.282008, 0.266365 | 0.279016 | 4.13% |
Ithare Medical Clinic (10358) | 0.293031, 0.28064, 0.289396 | 0.287689 | 0.275697, 0.287436, 0.29041 | 0.284514 | 1.12% |
Korakora Health Centre (13382) | 0.303196, 0.304112, 0.301997 | 0.303102 | 0.28352, 0.295342, 0.291901 | 0.290254 | 4.43% |
Nimoli Medical Services | 0.28343, 0.289077, 0.29045 | 0.287652 | 0.277361, 0.284016, 0.273865 | 0.278414 | 3.32% |
Adina Pharamacy - House 3, Road 1, FHA Estate, Lugbe | 0.294931, 0.305446, 0.295431 | 0.298603 | 0.279472, 0.291679, 0.278167 | 0.283106 | 5.47% |
Ajingi Primary Health Centre (fc-00-00-0069) | 0.454878, 0.479441, 0.46623 | 0.46685 | 0.294771, 0.291244, 0.283336 | 0.289784 | 61.1% |
LOLA PMS (NG_DISC_PPMV_00019) | 0.463435, 0.457732, 0.452672 | 0.457946 | 0.285396, 0.272043, 0.265224 | 0.274221 | 67.0% |
Clinique La Sentinelle (LT335) | 0.289978, 0.288041, 0.280732 | 0.28625 | 0.288432, 0.291099, 0.276994 | 0.285508 | 0.26% |
CSI Lougguere | 0.28805, 0.286309, 0.279159 | 0.284506 | 0.286494, 0.278248, 0.27263 | 0.279124 | 1.93% |
Nkouampoer (SU11009-17) | 0.294435, 0.287067, 0.300116 | 0.293873 | 0.2778, 0.273078, 0.283296 | 0.278058 | 5.69% |
Overall Average |
| 0.321175 |
| 0.283594 | 13.25% |
Testing Script
## Case #3
results = [{"description": "Performance Testing for finding", "dhis2": "PSI's DHIS2 API (s)", "dhisAvg": "DHIS2 Average (s)", "fhir": "FHIR API (s)", "fhirAvg": "FHIR Average (s)", "improvement": "Improvement (%)"}]
print("Case #3 - Measuring time taken to find a specific OrgUnit / Location")
outlets = [{"id": "Fz5NHHnah7C", "name": "Clínica Dra. Cintya Iraheta"},{"id": "onUMfZs0zeh", "name": "Hospital David King"},{"id": "kJ14ifcScdC", "name": "Unidad Médica San Miguel (NF047)"},{"id": "LhNO7Q1tgck", "name": "Ithare Medical Clinic (10358)"},{"id": "V0Wh2NxXpeP", "name": "Korakora Health Centre (13382)"},{"id": "TIqvGd9EDw4", "name": "Nimoli Medical Services"},{"id": "rLBXeooeab7", "name": "Adina Pharamacy - House 3, Road 1, FHA Estate, Lugbe"},{"id": "FQ7cbWDi2Sq", "name": "Ajingi Primary Health Centre (fc-00-00-0069)"},{"id": "iEEsjVZWZXN", "name": "LOLA PMS (NG_DISC_PPMV_00019)"},{"id": "LaosQn5Ir4Q", "name": "Clinique La Sentinelle (LT335)"},{"id": "QLUHuYeU7aT", "name": "CSI Lougguere"},{"id": "IXageW1Ti5E", "name": "Nkouampoer (SU11009-17)"}]
dhis2_averages = []
fhir_averages = []
improvements = []
for outlet in outlets:
improvement_overall = 0
case_result = {}
attempts = []
fhir_attempts = []
for i in range (1,4):
case_result['description'] = "{}".format(outlet['name'])
dhis2_url = dhis2_base_url+'uid={}'.format(outlet['id'])
result = requests.get(dhis2_url, auth=dhis2_auth)
if result.status_code == 200:
dhis2_performances.append(result.elapsed.total_seconds())
attempts.append(result.elapsed.total_seconds())
request_url = fhir_location_url+'identifier={}'.format(outlet['id'])
fhirResult = requests.get(request_url, auth=fhir_auth)
if fhirResult.status_code == 200:
fhir_attempts.append(fhirResult.elapsed.total_seconds())
case_result['dhis2'] = ", ".join([str(i) for i in attempts])
dhis2_averages.append(Average(attempts))
fhir_averages.append(Average(fhir_attempts))
improvements.append(((dhis2_averages[-1]/ fhir_averages[-1])-1)*100)
case_result['dhisAvg'] = dhis2_averages[-1]
case_result['fhir'] = ', '.join([str(i) for i in fhir_attempts])
case_result['fhirAvg'] = fhir_averages[-1]
case_result['improvement'] = '{}%'.format(float("{:.2f}".format(improvements[-1])))
results.append(case_result)
time.sleep(0.01)
case_result = {}
case_result['description'] = "Overall Average"
case_result['dhisAvg'] = Average(dhis2_averages)
case_result['fhirAvg'] = Average(fhir_averages)
case_result['improvement'] = '{}%'.format(float("{:.2f}".format(((case_result['dhisAvg']/case_result['fhirAvg'])-1)*100)))
results.append(case_result)
print(tabulate(results, headers='firstrow', tablefmt='pipe'))