Versions Compared

Key

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

...

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.280502279387

0.320258318323

89-13.14559365

Test detailed results

logged on Nov 2229/ 2022 UTC-7 2109:4423:00

Performance Testing for finding

Attempt

DHIS2 API (s)

FHIR API (s)

Improvement (%)

IUCD

Attempt - 1

0.

325191

282072

0.

399285

399434

81

-41.

4433

6071

Attempt - 2

0.

274983

278955

0.

3861

355842

71

-27.

2207

5625

Attempt - 3

0.

278791

286569

0.

291635

313197

95

-9.

5959

292

Implant

Attempt - 1

0.

266742

272257

0.

379512

386897

70

-42.

2855

1073

Attempt - 2

0.

281066

289942

0.

362733

356242

77

-22.

4856

8666

Attempt - 3

0.

288277

272423

0.

372714

345689

77

-26.

3454

8942

STI

Attempt - 1

0.

267304

273894

0.

367304

383392

72

-39.

7746

9782

Attempt - 2

0.

276666

289145

0.

364429

361493

75

-25.

9177

0214

Attempt - 3

0.

281687

281978

0.

383284

36675

73

-30.

493

0633

Sterillization

Attempt - 1

0.

28283

281831

0.

282047

281531

100

0.

278

106447

Attempt - 2

0.

27741

279158

0.

283155

282851

97

-1.

9711

32291

Attempt - 3

0.

27584

275082

0.

285375

282686

96

-2.

6588

76427

MA

Attempt - 1

0.

269518

272828

0.

287611

298471

93

-9.

7092

39896

Attempt - 2

0.

297901

287296

0.

275463

281481

108

2.

146

02404

Attempt - 3

0.

27518

275699

0.

283728

29015

96

-5.

9873

24159

MVA

Attempt - 1

0.

28015

286619

0.

287905

285184

97

0.

3064

500665

Attempt - 2

0.

270377

270808

0.

274032

283989

98

-4.

6662

86729

Attempt - 3

0.

273489

282387

0.

282751

287107

96

-1.

7243

67147

Surgical Abortion

Attempt - 1

0.

27241

2771

0.

283562

293036

96

-5.

0672

75099

Attempt - 2

0.

289893

275969

0.

29174

273938

99

0.

3669

735952

Attempt - 3

0.

284832

275105

0.

301047

275427

94

-0.

6138

117046

Overall Average

0.

280502

279387

0.

320258

318323

89

-13.

1455

9365

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])/fhirdhis2_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'] = Average(improvements)((result6['dhis2'] - result6['fhir'])/result6['dhis2'])*100
results6.append(result6)
print(tabulate(results6, headers='firstrow', tablefmt='pipe'))

...