Versions Compared

Key

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

...

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.279387276735

0.318323313903

-1311.936584%

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

272391

0.

399434

348378

-

41

21.

6071

81%

Attempt - 2

0.

278955

267497

0.

355842

359816

-

27

25.

5625

66%

Attempt - 3

0.

286569

262858

0.

313197

355213

-

9

26.

292

0%

Implant

Attempt - 1

0.

272257

281353

0.

386897

343937

-

42

18.

1073

2%

Attempt - 2

0.

289942

261588

0.

356242

351585

-

22

25.

8666

6%

Attempt - 3

0.

272423

270991

0.

345689

381919

-

26

29.

8942

04%

STI

Attempt - 1

0.

273894

280658

0.

383392

366811

-

39

23.

9782

49%

Attempt - 2

0.

289145

288505

0.

361493

349213

-

25

17.

0214

38%

Attempt - 3

0.

281978

279506

0.

36675

362959

-

30

22.

0633

99%

Sterillization

Attempt - 1

0.

281831

283504

0.

281531

288332

0

-1.

106447

67%

Attempt - 2

0.

279158

28656

0.

282851

269992

-1

6.

32291

14%

Attempt - 3

0.

275082

264257

0.

282686

286922

-

2

7.

76427

9%

MA

Attempt - 1

0.

272828

273142

0.

298471

28648

-

9

4.

39896

66%

Attempt - 2

0.

287296

284315

0.

281481

291914

-2.

02404

6%

Attempt - 3

0.

275699

274036

0.

29015

291651

-

5

6.

24159

04%

MVA

Attempt - 1

0.

286619

275338

0.

285184

273843

0.

500665

55%

Attempt - 2

0.

270808

280349

0.

283989

264875

-4

5.

86729

84%

Attempt - 3

0.

282387

28664

0.

287107

278723

-1

2.

67147

84%

Surgical Abortion

Attempt - 1

0.

2771

278647

0.

293036

279009

-

5

0.

75099

13%

Attempt - 2

0.

275969

280105

0.

273938

275763

0

1.

735952

57%

Attempt - 3

0.

275105

279203

0.

275427

284635

-

0

1.

117046

91%

Overall Average

0.

279387

276735

0.

318323

313903

-

13

11.

9365

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

...