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 7 Next »

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

0.559633

-5.14751

Test detailed results

logged on Nov 29/ 2022 UTC-7 08:35:00

Performance Testing for

Attempt

DHIS2 API

FHIR API

FHIR API (with HealthcareServices),

Improvement %

El Salvador

Attempt - 1

0.519845

0.49418

0.562221

4.93705

Attempt - 2

0.57532

0.424411

0.454275

26.2304

Attempt - 3

0.54541

0.4306

0.445373

21.0502

Kenya

Attempt - 1

0.649501

0.616995

0.613571

5.00477

Attempt - 2

0.681508

0.559262

0.577607

17.9376

Attempt - 3

0.663324

0.57675

0.61023

13.0515

Nigeria

Attempt - 1

0.52902

0.599715

0.629629

-13.3634

Attempt - 2

0.536094

0.579989

0.68599

-8.18793

Attempt - 3

0.588082

0.579535

0.60863

1.45337

Cameroon

Attempt - 1

0.371575

0.63747

0.606542

-71.5589

Attempt - 2

0.371396

0.566286

0.588483

-52.475

Attempt - 3

0.363826

0.571734

0.582228

-57.1449

Nepal

Attempt - 1

0.675976

0.604182

0.593038

10.6208

Attempt - 2

0.651016

0.590685

0.672721

9.26721

Attempt - 3

0.669601

0.562703

0.57227

15.9644

Overall Average

0.559433

0.559633

0.586854

-5.14751

##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'] = Average(dhis2_performances)
case_1_result['fhir'] = Average(fhir_performances)
case_1_result['fhir_with_healthcareServices'] = Average(fhir_hsc_performances)
case_1_result['improvement'] = Average(improvements)
case_1_results.append(case_1_result)
print(tabulate(case_1_results, headers='firstrow', tablefmt='pipe'))

  • No labels