Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.55735554281

0.556148 555023

-0.21567513%

Test detailed results

logged on Nov 29Dec 1/ 2022 UTC-7 0908:2040:00

Performance Testing for

Attempt

DHIS2 API

FHIR API

FHIR API (with HealthcareServices),

Improvement %

El Salvador

Attempt - 1

0.

584538

566667

0.

556832

488375

0.

51522

487989

4

16.

73981

03%

Attempt - 2

0.

540187

532607

0.

452148

437886

0.

490487

548295

16

21.

2979

63%

Attempt - 3

0.

527518

532142

0.

448206

452103

0.

464108

463129

15

17.

0349

7%

Kenya

Attempt - 1

0.

670854

657443

0.

580913

604362

0.

611169

625961

13

8.

4069

78%

Attempt - 2

0.

650981

655574

0.

573247

578361

0.

592193

574557

11

13.

9411

35%

Attempt - 3

0.

666113

659164

0.

553176

573111

0.

626906

663475

16

15.

9546

02%

Nigeria

Attempt - 1

0.

542913

526847

0.

581144

570136

0.

641549

651838

-7.

04183

59%

Attempt - 2

0.

539101

528978

0.

570632

588868

0.

622898

620271

-

5

10.

84881

17%

Attempt - 3

0.

529134

536548

0.

551834

568277

0.

605798

70342

-

4

5.

29003

58%

Cameroon

Attempt - 1

0.

356464

372636

0.

576357

587497

0.

588069

590178

-

61

36.

6873

57%

Attempt - 2

0.

362752

371032

0.

569168

584348

0.

562994

595724

-

56

36.

9028

5%

Attempt - 3

0.

376103

371502

0.

571142

558964

0.

568529

585595

-

51

33.

8579

54%

Nepal

Attempt - 1

0.

66836

662525

0.

582882

612458

0.

614518

682753

12

8.

7892

17%

Attempt - 2

0.

661991

670834

0.

603611

56743

0.

579578

571592

8

18.

81885

22%

Attempt - 3

0.

683248

669719

0.

570934

553174

0.

588029

584597

16

21.

4382

07%

Overall Average

0.

55735

554281

0.

556148

555023

0.

578136

596625

-0.

215675

13%

Testing Script

Code Block
breakoutModewide
languagepy
##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'] = '{}%'.format(float("{:.2f}".format(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'] = '{}%'.format(float("{:.2f}".format(((case_1_result['dhis2'] - /case_1_result['fhir'])/case_1_result['dhis2']-1)*100)))
case_1_results.append(case_1_result)
print(tabulate(case_1_results, headers='firstrow', tablefmt='pipe'))

...