Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Next »

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.325792

0.289665

112.671

Test detailed results

logged on Nov 22/ 2022 UTC-7 21:32: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.289601, 0.29368, 0.297439

0.293573

0.287387, 0.284214, 0.286099

0.2859

102.684

Hospital David King

0.301669, 0.296243, 0.293839

0.29725

0.28886, 0.284253, 0.290717

0.287943

103.232

Unidad Médica San Miguel (NF047)

0.300455, 0.294747, 0.291286

0.295496

0.283442, 0.298393, 0.283852

0.288562

102.403

Ithare Medical Clinic (10358)

0.297215, 0.299505, 0.315358

0.304026

0.295696, 0.290793, 0.294299

0.293596

103.553

Korakora Health Centre (13382)

0.291213, 0.311348, 0.305398

0.302653

0.303343, 0.284562, 0.280839

0.289581

104.514

Nimoli Medical Services

0.291228, 0.298138, 0.293967

0.294444

0.29668, 0.292341, 0.281861

0.290294

101.43

Adina Pharamacy - House 3, Road 1, FHA Estate, Lugbe

0.28111, 0.293731, 0.28701

0.287284

0.295948, 0.288929, 0.293254

0.29271

98.1461

Ajingi Primary Health Centre (fc-00-00-0069)

0.467752, 0.453711, 0.466352

0.462605

0.287497, 0.279707, 0.285522

0.284242

162.75

LOLA PMS (NG_DISC_PPMV_00019)

0.454966, 0.45816, 0.545093

0.486073

0.290566, 0.279135, 0.284843

0.284848

170.643

Clinique La Sentinelle (LT335)

0.304852, 0.288982, 0.29119

0.295008

0.293149, 0.280753, 0.293316

0.289073

102.053

CSI Lougguere

0.298243, 0.307467, 0.290383

0.298698

0.292592, 0.296005, 0.291305

0.293301

101.84

Nkouampoer (SU11009-17)

0.288722, 0.284976, 0.303493

0.292397

0.29152, 0.289336, 0.306926

0.295927

98.807

Overall Average

0.325792

0.289665

112.671

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:
            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])*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'] = improvements[-1]
    results.append(case_result)
    time.sleep(0.1)
case_result = {}
case_result['description'] = "Overall Average"
case_result['dhisAvg'] = Average(dhis2_averages)
case_result['fhirAvg'] = Average(fhir_averages)
case_result['improvement'] = Average(improvements)
results.append(case_result)
print(tabulate(results, headers='firstrow', tablefmt='pipe'))

  • No labels