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

« Previous Version 3 Current »

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

0.288276

10.462

Test detailed results

logged on Nov 29/ 2022 UTC-7 09:14: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.354824, 0.30672, 0.285624

0.315723

0.314456, 0.300887, 0.290454

0.301932

4.36786

Hospital David King

0.281725, 0.302501, 0.274578

0.286268

0.29757, 0.292199, 0.293559

0.294443

-2.8556

Unidad Médica San Miguel (NF047)

0.29345, 0.303885, 0.293392

0.296909

0.301669, 0.289875, 0.283276

0.291607

1.78584

Ithare Medical Clinic (10358)

0.280965, 0.30126, 0.288404

0.29021

0.308609, 0.277115, 0.291449

0.292391

-0.75164

Korakora Health Centre (13382)

0.286319, 0.294106, 0.295094

0.29184

0.287755, 0.280583, 0.292913

0.287084

1.62966

Nimoli Medical Services

0.294825, 0.292497, 0.290636

0.292653

0.278407, 0.268665, 0.283962

0.277011

5.34467

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

0.282455, 0.286563, 0.285742

0.28492

0.27857, 0.288755, 0.288231

0.285185

-0.0931256

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

0.462394, 0.451086, 0.465332

0.459604

0.279865, 0.288865, 0.28182

0.283517

38.3128

LOLA PMS (NG_DISC_PPMV_00019)

0.438221, 0.483114, 0.453608

0.458314

0.301126, 0.283007, 0.274498

0.28621

37.5515

Clinique La Sentinelle (LT335)

0.296026, 0.303652, 0.293412

0.297697

0.292834, 0.280616, 0.29468

0.289377

2.79479

CSI Lougguere

0.296919, 0.290365, 0.280495

0.28926

0.278481, 0.283242, 0.29083

0.284184

1.75459

Nkouampoer (SU11009-17)

0.304013, 0.297413, 0.298907

0.300111

0.294128, 0.287234, 0.277734

0.286365

4.58019

Overall Average

0.321959

0.288276

10.462

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] )/ dhis2_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.01)
case_result = {}
case_result['description'] = "Overall Average"
case_result['dhisAvg'] = Average(dhis2_averages)
case_result['fhirAvg'] = Average(fhir_averages)
case_result['improvement'] = ((case_result['dhisAvg'] - case_result['fhirAvg'])/case_result['dhisAvg'])*100
results.append(case_result)
print(tabulate(results, headers='firstrow', tablefmt='pipe'))

  • No labels