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 8 Current »

Location search based on country (iso2 or Name)

In location API, tried to load 500 outlets in the country by (iso2)
URL: https://replica.psi-mis.org/locator/api/1?iso2={country ISO}&number=500
Similarly, in FHIR, we tried to load 500 locations in that country and measured the time taken to get the response back.
URL: https://fhir-dev.psi-mis.org/fhir?address-country={country_name}&_count=500

Summary of test results

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.55735

0.556148

0.215675

Test detailed results

logged on Nov 29/ 2022 UTC-7 09:20:00

Performance Testing for

Attempt

DHIS2 API

FHIR API

FHIR API (with HealthcareServices),

Improvement %

El Salvador

Attempt - 1

0.584538

0.556832

0.51522

4.73981

Attempt - 2

0.540187

0.452148

0.490487

16.2979

Attempt - 3

0.527518

0.448206

0.464108

15.0349

Kenya

Attempt - 1

0.670854

0.580913

0.611169

13.4069

Attempt - 2

0.650981

0.573247

0.592193

11.9411

Attempt - 3

0.666113

0.553176

0.626906

16.9546

Nigeria

Attempt - 1

0.542913

0.581144

0.641549

-7.04183

Attempt - 2

0.539101

0.570632

0.622898

-5.84881

Attempt - 3

0.529134

0.551834

0.605798

-4.29003

Cameroon

Attempt - 1

0.356464

0.576357

0.588069

-61.6873

Attempt - 2

0.362752

0.569168

0.562994

-56.9028

Attempt - 3

0.376103

0.571142

0.568529

-51.8579

Nepal

Attempt - 1

0.66836

0.582882

0.614518

12.7892

Attempt - 2

0.661991

0.603611

0.579578

8.81885

Attempt - 3

0.683248

0.570934

0.588029

16.4382

Overall Average

0.55735

0.556148

0.578136

0.215675

Testing Script

##Case 1
case_1_results = [{"description": "Performance Testing for", "attempt": "Attempt", "dhis2": "DHIS2 API", "fhir": "FHIR API", "fhir_with_healthcareServices": "FHIR API (with HealthcareServices),", "improvement":"Improvement %"}]
print("Case #1 - Getting 500 orgUnits/Location in the country (by ISO)")
improvements = []
dhis2_performances = []
fhir_hsc_performances = []
fhir_performances = []
for country in countries:
    for i in range(1,4):
        case_1_result = {}
        if i == 1:
            case_1_result['description'] = "{}".format(country['name'])
        case_1_result['attempt'] = "Attempt - {}".format(i)
        dhis2_url = dhis2_base_url+'iso2={}&number=500'.format(country['code'])
        result = requests.get(dhis2_url, auth=dhis2_auth)
        if result.status_code == 200:
            dhis2_performances.append(result.elapsed.total_seconds())
            case_1_result['dhis2'] = dhis2_performances[-1]

        request_url = fhir_location_url+'address-country={}&_count=500'.format(country['name'])
        fhirResult = requests.get(request_url, auth=fhir_auth)
        if fhirResult.status_code == 200:
            fhir_performances.append(fhirResult.elapsed.total_seconds())
            case_1_result['fhir'] = fhir_performances[-1]
        
        request_healthcare_url = fhir_location_url+'address-country={}&_count=500&_revinclude=HealthcareService:location'.format(country['name'])
        fhirHealthcareServicesResult = requests.get(request_healthcare_url, auth=fhir_auth)
        if fhirHealthcareServicesResult.status_code == 200:
            fhir_hsc_performances.append(fhirHealthcareServicesResult.elapsed.total_seconds())
            case_1_result['fhir_with_healthcareServices'] = fhir_hsc_performances[-1]
        
        improvements.append(((case_1_result['dhis2'] - case_1_result['fhir']) / case_1_result['dhis2'])*100)
        case_1_result['improvement'] = improvements[-1]
        case_1_results.append(case_1_result)
        time.sleep(0.01)
case_1_result = {}
case_1_result['description'] = "Overall Average"
case_1_result['dhis2'] = np.average(dhis2_performances)
case_1_result['fhir'] = np.average(fhir_performances)
case_1_result['fhir_with_healthcareServices'] = np.average(fhir_hsc_performances)
case_1_result['improvement'] = ((case_1_result['dhis2'] - case_1_result['fhir'])/case_1_result['dhis2'])*100
case_1_results.append(case_1_result)
print(tabulate(case_1_results, headers='firstrow', tablefmt='pipe'))

  • No labels