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 2 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.323108

0.286697

8.5837

Test detailed results

logged on Nov 29/ 2022 UTC-7 09:03: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.337506, 0.286636, 0.29676

0.306967

0.322618, 0.292195, 0.276949

0.297254

3.16429

Hospital David King

0.304111, 0.304274, 0.305908

0.304764

0.282915, 0.285814, 0.293968

0.287566

5.64327

Unidad Médica San Miguel (NF047)

0.290758, 0.292999, 0.282317

0.288691

0.298637, 0.279342, 0.290157

0.289379

-0.238086

Ithare Medical Clinic (10358)

0.294144, 0.291588, 0.279463

0.288398

0.287773, 0.28149, 0.288758

0.286007

0.829177

Korakora Health Centre (13382)

0.284701, 0.300115, 0.292818

0.292545

0.287751, 0.285688, 0.278392

0.283944

2.94006

Nimoli Medical Services

0.284044, 0.299954, 0.29775

0.293916

0.287685, 0.276744, 0.286844

0.283758

3.4562

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

0.284925, 0.289745, 0.301087

0.291919

0.297978, 0.300757, 0.281225

0.29332

-0.479928

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

0.458838, 0.464859, 0.474938

0.466212

0.270774, 0.29056, 0.292726

0.284687

38.9362

LOLA PMS (NG_DISC_PPMV_00019)

0.481136, 0.460797, 0.449282

0.463738

0.271585, 0.290923, 0.286936

0.283148

38.9423

Clinique La Sentinelle (LT335)

0.295725, 0.301791, 0.281576

0.293031

0.294917, 0.277547, 0.265141

0.279202

4.7193

CSI Lougguere

0.286502, 0.298096, 0.290171

0.29159

0.295101, 0.28756, 0.28473

0.28913

0.843423

Nkouampoer (SU11009-17)

0.298429, 0.301234, 0.286918

0.295527

0.27295, 0.287852, 0.288115

0.282972

4.24823

Overall Average

0.323108

0.286697

8.5837

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'] = Average(improvements)
results.append(case_result)
print(tabulate(results, headers='firstrow', tablefmt='pipe'))

  • No labels