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 Service

Searching orgunits / locations by following services

  • IUCD

  • Implant

  • STI

  • Sterilization

  • MA

  • MVA

  • Surgical Abortion

In FHIR, we are saving services under HealthcareService resource. And for this search we are performing reverse chaining from Location to HealthcareServices so it's more costly that any of the previous test.

More info on Reverse chaining here.

Summary of test results

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.279387

0.318323

-13.9365

Test detailed results

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

Performance Testing for finding

Attempt

DHIS2 API (s)

FHIR API (s)

Improvement (%)

IUCD

Attempt - 1

0.282072

0.399434

-41.6071

Attempt - 2

0.278955

0.355842

-27.5625

Attempt - 3

0.286569

0.313197

-9.292

Implant

Attempt - 1

0.272257

0.386897

-42.1073

Attempt - 2

0.289942

0.356242

-22.8666

Attempt - 3

0.272423

0.345689

-26.8942

STI

Attempt - 1

0.273894

0.383392

-39.9782

Attempt - 2

0.289145

0.361493

-25.0214

Attempt - 3

0.281978

0.36675

-30.0633

Sterillization

Attempt - 1

0.281831

0.281531

0.106447

Attempt - 2

0.279158

0.282851

-1.32291

Attempt - 3

0.275082

0.282686

-2.76427

MA

Attempt - 1

0.272828

0.298471

-9.39896

Attempt - 2

0.287296

0.281481

2.02404

Attempt - 3

0.275699

0.29015

-5.24159

MVA

Attempt - 1

0.286619

0.285184

0.500665

Attempt - 2

0.270808

0.283989

-4.86729

Attempt - 3

0.282387

0.287107

-1.67147

Surgical Abortion

Attempt - 1

0.2771

0.293036

-5.75099

Attempt - 2

0.275969

0.273938

0.735952

Attempt - 3

0.275105

0.275427

-0.117046

Overall Average

0.279387

0.318323

-13.9365

Testing Script

results6 = [{"description": "Performance Testing for finding", "attempt": "Attempt", "dhis2": "DHIS2 API (s)", "fhir": "FHIR API (s)", "improvement": "Improvement (%)"}]
print("Case #6 - Measuring time taken to find outlet / location providing services")
services= ["IUCD", "Implant", "STI", "Sterillization", "MA", "MVA", "Surgical Abortion"]
improvements = []
dhis2_performances = []
fhir_performances = []
for service in services:
    for i in range(1,4):
        result6 = {}
        if i == 1:
            result6['description'] = "{}".format(service)
        result6['attempt'] = "Attempt - {}".format(i)
        dhis2_url = dhis2_base_url+'service={}'.format(service)
        result = requests.get(dhis2_url, auth=dhis2_auth)
        if result.status_code == 200:
            dhis2_performances.append(result.elapsed.total_seconds())
            result6['dhis2'] = dhis2_performances[-1]
            
        request_url = fhir_location_url+'_has:HealthcareService:location:name={}'.format(service)
        fhirResult = requests.get(request_url, auth=fhir_auth)
        if fhirResult.status_code == 200:
            fhir_performances.append(fhirResult.elapsed.total_seconds())
            result6['fhir'] = fhir_performances[-1]
        improvements.append(((dhis2_performances[-1] - fhir_performances[-1])/dhis2_performances[-1])*100)
        result6['improvement'] = improvements[-1]
        results6.append(result6)
        time.sleep(0.01)

result6 = {}
result6['description'] = "Overall Average"
result6['dhis2'] = Average(dhis2_performances)
result6['fhir'] = Average(fhir_performances)
result6['improvement'] = ((result6['dhis2'] - result6['fhir'])/result6['dhis2'])*100
results6.append(result6)
print(tabulate(results6, headers='firstrow', tablefmt='pipe'))

  • No labels