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 Type

Searching orgunits / locations by its type

Summary of test results

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.551962

0.358791

156.478

Test detailed results

logged on Nov 22/ 2022 UTC-7 21:51:00

Performance Testing for Outlet Type

Attempt

DHIS2 API (s)

FHIR API (s)

Improvement (%)

Dominican Republic

Attempt - 1

0.593318

0.338067

175.503

Attempt - 2

0.541574

0.289128

187.313

Attempt - 3

0.53424

0.280602

190.391

Honduras

Attempt - 1

0.545529

0.372258

146.546

Attempt - 2

0.54711

0.364207

150.22

Attempt - 3

0.539345

0.358541

150.428

Vietnam

Attempt - 1

0.558541

0.418999

133.304

Attempt - 2

0.550937

0.39442

139.683

Attempt - 3

0.55706

0.4129

134.914

Overall Average

0.551962

0.358791

156.478

Testing Script

results7 = [{"description": "Performance Testing for Outlet Type", "attempt": "Attempt", "dhis2": "DHIS2 API (s)", "fhir": "FHIR API (s)", "improvement": "Improvement (%)"}]
print("Case #7 - Measuring time taken to find outlet / location by Type")
countries = [ {"iso2": "do", "name": "Dominican Republic", "type": "Farmacia", "code": 18102}, {"iso2": "HN", "name": "Honduras", "type": "Farmacia", "code": 18102},{"iso2": "VN", "name": "Vietnam", "type": "Pharmacy", "code": 18102}]
improvements = []
dhis2_performances = []
fhir_performances = []
for country in countries:
    for i in range(1,4):
        result7 = {}
        if i == 1:
            result7['description'] = "{}".format(country['name'])
        result7['attempt'] = "Attempt - {}".format(i)
        dhis2_url = dhis2_base_url+'iso2={}&type={}&n=100'.format(country['iso2'], country['type'])
        result = requests.get(dhis2_url, auth=dhis2_auth)
        if result.status_code == 200:
            dhis2_performances.append(result.elapsed.total_seconds())
            result7['dhis2'] = dhis2_performances[-1]
            
        request_url = fhir_location_url+'address-country={}&type={}&_count=100'.format(country['name'], country['code'])
        fhirResult = requests.get(request_url, auth=fhir_auth)
        if fhirResult.status_code == 200:
            fhir_performances.append(fhirResult.elapsed.total_seconds())
            result7['fhir'] = fhir_performances[-1]
        improvements.append((dhis2_performances[-1]/fhir_performances[-1])*100)
        result7['improvement'] = improvements[-1]
        results7.append(result7)
        time.sleep(0.01)

result7 = {}
result7['description'] = "Overall Average"
result7['dhis2'] = np.average(dhis2_performances)
result7['fhir'] = np.average(fhir_performances)
result7['improvement'] = np.average(improvements)
results7.append(result7)
print(tabulate(results7, headers='firstrow', tablefmt='pipe'))

  • No labels