Versions Compared

Key

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

...

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.280502276735

0.320258313903

89-11.145584%

Test detailed results

logged on Nov 22Dec 1/ 2022 UTC-7 2109:4423:00

Performance Testing for finding

Attempt

DHIS2 API (s)

FHIR API (s)

Improvement (%)

IUCD

Attempt - 1

0.

325191

272391

0.

399285

348378

81

-21.

4433

81%

Attempt - 2

0.

274983

267497

0.

3861

359816

71

-25.

2207

66%

Attempt - 3

0.

278791

262858

0.

291635

355213

95

-26.

5959

0%

Implant

Attempt - 1

0.

266742

281353

0.

379512

343937

70

-18.

2855

2%

Attempt - 2

0.

281066

261588

0.

362733

351585

77

-25.

4856

6%

Attempt - 3

0.

288277

270991

0.

372714

381919

77

-29.

3454

04%

STI

Attempt - 1

0.

267304

280658

0.

367304

366811

72

-23.

7746

49%

Attempt - 2

0.

276666

288505

0.

364429

349213

75

-17.

9177

38%

Attempt - 3

0.

281687

279506

0.

383284

362959

73

-22.

493

99%

Sterillization

Attempt - 1

0.

28283

283504

0.

282047

288332

100

-1.

278

67%

Attempt - 2

0.

27741

28656

0.

283155

269992

97

6.

9711

14%

Attempt - 3

0.

27584

264257

0.

285375

286922

96

-7.

6588

9%

MA

Attempt - 1

0.

269518

273142

0.

287611

28648

93

-4.

7092

66%

Attempt - 2

0.

297901

284315

0.

275463

291914

108

-2.

146

6%

Attempt - 3

0.

27518

274036

0.

283728

291651

96

-6.

9873

04%

MVA

Attempt - 1

0.

28015

275338

0.

287905

273843

97

0.

3064

55%

Attempt - 2

0.

270377

280349

0.

274032

264875

98

5.

6662

84%

Attempt - 3

0.

273489

28664

0.

282751

278723

96

2.

7243

84%

Surgical Abortion

Attempt - 1

0.

27241

278647

0.

283562

279009

96

-0.

0672

13%

Attempt - 2

0.

289893

280105

0.

29174

275763

99

1.

3669

57%

Attempt - 3

0.

284832

279203

0.

301047

284635

94

-1.

6138

91%

Overall Average

0.

280502

276735

0.

320258

313903

89

-11.

1455

84%

Testing Script

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

...