Finding Specific orgUnits / Location by Type
Searching orgunits / locations by its type
Summary of test results
DHIS2 | FHIR | DHIS2 vs FHIR % | |
---|---|---|---|
Average | 0.544344 | 0.364643 | 33.0124 |
Test detailed results
logged on Nov 29/ 2022 UTC-7 09:26:00
Performance Testing for Outlet Type | Attempt | DHIS2 API (s) | FHIR API (s) | Improvement (%) |
---|---|---|---|---|
Dominican Republic | Attempt - 1 | 0.567389 | 0.334102 | 41.1159 |
Attempt - 2 | 0.522738 | 0.288675 | 44.7764 | |
Attempt - 3 | 0.538892 | 0.29013 | 46.1618 | |
Honduras | Attempt - 1 | 0.551937 | 0.375277 | 32.0073 |
Attempt - 2 | 0.539953 | 0.367432 | 31.9511 | |
Attempt - 3 | 0.527808 | 0.37917 | 28.1614 | |
Vietnam | Attempt - 1 | 0.544135 | 0.445037 | 18.212 |
Attempt - 2 | 0.556751 | 0.406756 | 26.9411 | |
Attempt - 3 | 0.549493 | 0.395206 | 28.0781 | |
Overall Average | 0.544344 | 0.364643 | 33.0124 |
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])/dhis2_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'] = ((result7['dhis2'] - result7['fhir'])/result7['dhis2'])*100 results7.append(result7) print(tabulate(results7, headers='firstrow', tablefmt='pipe'))