@ampath/esm-reports-app 1.0.0-next.112 → 1.0.0-next.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/248.css +1 -0
- package/dist/248.css.map +1 -0
- package/dist/248.js +1 -0
- package/dist/248.js.map +1 -0
- package/dist/410.js +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/common/report-header/facility-clinics.component.tsx +42 -0
- package/src/common/report-header/facility-clinics.scss +61 -0
- package/src/common/report-header/index.ts +1 -0
- package/src/common/report-page/download-sheet-pdf.ts +2 -0
- package/src/common/report-register/index.ts +1 -0
- package/src/common/report-register/register-layout.component.tsx +3 -26
- package/src/common/report-register/register-layout.scss +0 -58
- package/src/common/report-register/xlsx.ts +263 -0
- package/src/dashboard/report-catalog.ts +39 -145
- package/src/dashboard/reports-dasboard.tsx +5 -4
- package/src/reports/program/care-and-treatment/care-and-treatment-linelist.component.tsx +87 -0
- package/src/reports/program/care-and-treatment/care-and-treatment-table.component.tsx +1 -1
- package/src/reports/program/care-and-treatment/care-and-treatment.component.tsx +122 -59
- package/src/reports/program/care-and-treatment/care-and-treatment.config.ts +120 -2
- package/src/reports/program/program-report.component.tsx +11 -5
- package/src/reports/quality-improvement/case-surveillance.component.tsx +258 -0
- package/src/reports/quality-improvement/case-surveillance.config.ts +57 -0
- package/src/reports/quality-improvement/case-surveillance.scss +305 -0
- package/src/reports/quality-improvement/quality-improvement-linelist.component.tsx +137 -0
- package/src/reports/quality-improvement/quality-improvement.component.tsx +217 -0
- package/src/reports/quality-improvement/quality-improvement.config.ts +144 -0
- package/src/reports/quality-improvement/quality-improvement.scss +227 -0
- package/src/resources/care-and-treatment.resource.ts +1 -1
- package/src/resources/quality-improvement.resource.ts +91 -0
- package/src/root.component.tsx +27 -14
- package/dist/955.css +0 -1
- package/dist/955.css.map +0 -1
- package/dist/955.js +0 -1
- package/dist/955.js.map +0 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { type ReportTone } from '../../dashboard/report-catalog';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The Quality Improvement report's indicators: the clients who need an
|
|
5
|
+
* action, by area. Each `id` is the ETL's indicator (quality-improvement
|
|
6
|
+
* service), which gives its count and its clients for the period.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface QualityIndicator {
|
|
10
|
+
id: string;
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
/** Not counted yet: no source in the EMR has been agreed */
|
|
15
|
+
pending?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface QualityArea {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
tone: ReportTone;
|
|
23
|
+
indicators: QualityIndicator[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const QUALITY_AREAS: QualityArea[] = [
|
|
27
|
+
{
|
|
28
|
+
id: 'testing-and-linkage',
|
|
29
|
+
title: 'Testing & linkage',
|
|
30
|
+
description: 'Clients to link to care or prevention',
|
|
31
|
+
tone: 'teal',
|
|
32
|
+
indicators: [
|
|
33
|
+
{
|
|
34
|
+
id: 'hiv-positive-not-linked',
|
|
35
|
+
code: 'LINKAGE',
|
|
36
|
+
name: 'HIV positive not linked',
|
|
37
|
+
description: 'Tested HIV positive in the period, with no linkage form and not enrolled in HIV care.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'high-risk-pbf-not-on-prep',
|
|
41
|
+
code: 'PBF PrEP',
|
|
42
|
+
name: 'High risk -ve PBFs not on PrEP',
|
|
43
|
+
description:
|
|
44
|
+
'Pregnant or breastfeeding women screened in the period: HIV negative, high or very high risk, with no PrEP visit.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'pns-undocumented-status',
|
|
48
|
+
code: 'PNS',
|
|
49
|
+
name: 'PNS contacts with undocumented HIV status',
|
|
50
|
+
description: 'Sexual and needle-sharing partners elicited by the period’s end, with no HIV status or test.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'sns-undocumented-status',
|
|
54
|
+
code: 'SNS',
|
|
55
|
+
name: 'SNS contacts with undocumented HIV status',
|
|
56
|
+
description: 'Social Network Strategy contacts whose HIV status is not documented.',
|
|
57
|
+
pending: true,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'viral-load',
|
|
63
|
+
title: 'Viral load',
|
|
64
|
+
description: 'Clients to test or support to suppression',
|
|
65
|
+
tone: 'violet',
|
|
66
|
+
indicators: [
|
|
67
|
+
{
|
|
68
|
+
id: 'missed-vl-testing',
|
|
69
|
+
code: 'VL TEST',
|
|
70
|
+
name: 'Missed opportunity in VL testing',
|
|
71
|
+
description: 'On ART, seen in the month while due for a viral load, with none ordered or resulted.',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'viral-load-200-plus',
|
|
75
|
+
code: 'VL ≥200',
|
|
76
|
+
name: 'Current on ART with VL ≥ 200',
|
|
77
|
+
description: 'On ART, latest viral load in the past 12 months 200 copies/ml or more (includes ≥1000).',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'viral-load-1000-plus',
|
|
81
|
+
code: 'VL ≥1000',
|
|
82
|
+
name: 'Current on ART with VL ≥ 1000',
|
|
83
|
+
description: 'On ART, latest viral load in the past 12 months 1000 copies/ml or more.',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'delayed-eac',
|
|
87
|
+
code: 'EAC',
|
|
88
|
+
name: 'Delayed enhanced adherence counselling (EAC)',
|
|
89
|
+
description: 'Viral load ≥200 over 2 weeks ago, with no enhanced adherence session since.',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'retention',
|
|
95
|
+
title: 'Retention',
|
|
96
|
+
description: 'Clients to trace or enrol in support',
|
|
97
|
+
tone: 'blue',
|
|
98
|
+
indicators: [
|
|
99
|
+
{
|
|
100
|
+
id: 'recent-defaulters',
|
|
101
|
+
code: 'DEFAULTERS',
|
|
102
|
+
name: 'Recent defaulters (missed app < 30 days)',
|
|
103
|
+
description: 'On ART, missed their appointment by 1-30 days at the month’s end.',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'adolescent-not-in-otz',
|
|
107
|
+
code: 'OTZ',
|
|
108
|
+
name: 'Adolescent not enrolled in OTZ',
|
|
109
|
+
description: 'On ART, aged 10-19, not enrolled in OTZ at the month’s end.',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'hei',
|
|
115
|
+
title: 'HIV-exposed infants',
|
|
116
|
+
description: 'Infants due for a test, linkage or outcome',
|
|
117
|
+
tone: 'magenta',
|
|
118
|
+
indicators: [
|
|
119
|
+
{
|
|
120
|
+
id: 'hei-without-dna-pcr',
|
|
121
|
+
code: 'HEI PCR',
|
|
122
|
+
name: 'HEI (6–8 wk) without DNA PCR',
|
|
123
|
+
description: 'Infants 6-8 weeks old during the period, with no DNA PCR result by its end.',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'hei-not-linked-to-mother',
|
|
127
|
+
code: 'HEI LINK',
|
|
128
|
+
name: 'HEI not linked to the mother',
|
|
129
|
+
description: 'Infants in care under 2 years with no mother linked to their record.',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'hei-without-outcome',
|
|
133
|
+
code: 'HEI OUTCOME',
|
|
134
|
+
name: 'HEI above 2 years without documented outcome',
|
|
135
|
+
description: 'Infants 2 years and over, still in care, with no final outcome recorded.',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
export const QUALITY_INDICATORS = QUALITY_AREAS.flatMap((area) => area.indicators);
|
|
142
|
+
|
|
143
|
+
export const QUALITY_IMPROVEMENT_PATH = '/quality-improvement/report';
|
|
144
|
+
export const QUALITY_IMPROVEMENT_LINELIST_PATH = '/quality-improvement/linelist';
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
|
+
|
|
6
|
+
/* each area's colour, as on the landing page: an accent for its bar, and an ink dark enough for text */
|
|
7
|
+
$tones: (
|
|
8
|
+
'violet': (#8a3ffc, #6929c4),
|
|
9
|
+
'magenta': (#d02670, #9f1853),
|
|
10
|
+
'teal': (#009d9a, #005d5d),
|
|
11
|
+
'blue': (#0f62fe, #0043ce),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
.sheet {
|
|
15
|
+
margin: layout.$spacing-05 0;
|
|
16
|
+
padding: layout.$spacing-06;
|
|
17
|
+
background-color: $ui-02;
|
|
18
|
+
border: 1px solid $ui-03;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.masthead {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
gap: layout.$spacing-03 layout.$spacing-07;
|
|
27
|
+
padding-bottom: layout.$spacing-04;
|
|
28
|
+
margin-bottom: layout.$spacing-04;
|
|
29
|
+
border-bottom: 1px solid $ui-03;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.title {
|
|
33
|
+
@include type.type-style('productive-heading-02');
|
|
34
|
+
color: $color-gray-100;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.subtitle {
|
|
38
|
+
@include type.type-style('label-01');
|
|
39
|
+
margin-top: layout.$spacing-01;
|
|
40
|
+
color: $text-02;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* the facility and month, as the landing page's header shows them */
|
|
44
|
+
.meta {
|
|
45
|
+
@include type.type-style('label-01');
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
gap: layout.$spacing-03;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.metaItem {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: layout.$spacing-02;
|
|
55
|
+
padding: layout.$spacing-01 layout.$spacing-03;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
color: $color-gray-100;
|
|
58
|
+
background-color: $ui-01;
|
|
59
|
+
border-radius: 1rem;
|
|
60
|
+
|
|
61
|
+
svg {
|
|
62
|
+
fill: $text-02;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.table {
|
|
67
|
+
width: 100%;
|
|
68
|
+
border-collapse: collapse;
|
|
69
|
+
border-bottom: 1px solid $ui-03;
|
|
70
|
+
|
|
71
|
+
thead th {
|
|
72
|
+
@include type.type-style('label-01');
|
|
73
|
+
padding: layout.$spacing-03 layout.$spacing-04;
|
|
74
|
+
text-align: left;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
letter-spacing: 0.04em;
|
|
77
|
+
text-transform: uppercase;
|
|
78
|
+
color: $text-02;
|
|
79
|
+
background-color: $ui-01;
|
|
80
|
+
border-bottom: 1px solid $ui-03;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
thead th:first-child {
|
|
84
|
+
padding-left: layout.$spacing-05;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
tbody {
|
|
88
|
+
--tone: var(--brand-01);
|
|
89
|
+
--tone-ink: var(--brand-01);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@each $name, $pair in $tones {
|
|
93
|
+
tbody[data-tone='#{$name}'] {
|
|
94
|
+
--tone: #{list.nth($pair, 1)};
|
|
95
|
+
--tone-ink: #{list.nth($pair, 2)};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
tbody + tbody {
|
|
100
|
+
border-top: 1px solid $ui-03;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
tbody tr + tr td,
|
|
104
|
+
tbody tr + tr .indicatorCell {
|
|
105
|
+
border-top: 1px solid $ui-01;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
tbody tr:hover {
|
|
109
|
+
.codeCell,
|
|
110
|
+
.indicatorCell,
|
|
111
|
+
.countCell {
|
|
112
|
+
background-color: color-mix(in srgb, var(--tone) 5%, #{$ui-02});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.areaCell {
|
|
118
|
+
width: 13rem;
|
|
119
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
120
|
+
vertical-align: top;
|
|
121
|
+
text-align: left;
|
|
122
|
+
background-color: color-mix(in srgb, var(--tone) 5%, #{$ui-02});
|
|
123
|
+
box-shadow: inset 3px 0 0 var(--tone);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.areaName {
|
|
127
|
+
@include type.type-style('heading-compact-01');
|
|
128
|
+
display: block;
|
|
129
|
+
color: var(--tone-ink);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.areaDescription {
|
|
133
|
+
@include type.type-style('label-01');
|
|
134
|
+
display: block;
|
|
135
|
+
margin-top: layout.$spacing-02;
|
|
136
|
+
color: $text-02;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.codeCell {
|
|
140
|
+
width: 7.5rem;
|
|
141
|
+
padding: layout.$spacing-04;
|
|
142
|
+
vertical-align: top;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.code {
|
|
146
|
+
@include type.type-style('code-01');
|
|
147
|
+
display: inline-block;
|
|
148
|
+
padding: 0 layout.$spacing-02;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
color: var(--tone-ink);
|
|
151
|
+
background-color: color-mix(in srgb, var(--tone) 10%, #{$ui-02});
|
|
152
|
+
border-radius: 2px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.indicatorCell {
|
|
156
|
+
padding: layout.$spacing-04;
|
|
157
|
+
text-align: left;
|
|
158
|
+
font-weight: normal;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.indicatorName {
|
|
162
|
+
@include type.type-style('body-compact-01');
|
|
163
|
+
display: block;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
color: $color-gray-100;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.indicatorDescription {
|
|
169
|
+
@include type.type-style('label-01');
|
|
170
|
+
display: block;
|
|
171
|
+
margin-top: layout.$spacing-01;
|
|
172
|
+
color: $text-02;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.countHead {
|
|
176
|
+
text-align: right !important;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.countCell {
|
|
180
|
+
width: 8rem;
|
|
181
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
182
|
+
vertical-align: top;
|
|
183
|
+
text-align: right;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.count {
|
|
187
|
+
@include type.type-style('productive-heading-03');
|
|
188
|
+
padding: 0;
|
|
189
|
+
font-variant-numeric: tabular-nums;
|
|
190
|
+
color: var(--brand-01);
|
|
191
|
+
background: none;
|
|
192
|
+
border: 0;
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
|
|
195
|
+
&:hover {
|
|
196
|
+
text-decoration: underline;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.none {
|
|
201
|
+
@include type.type-style('productive-heading-03');
|
|
202
|
+
color: $ui-04;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.pending {
|
|
206
|
+
@include type.type-style('label-01');
|
|
207
|
+
font-style: italic;
|
|
208
|
+
color: $text-02;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.note {
|
|
212
|
+
@include type.type-style('label-01');
|
|
213
|
+
margin-top: layout.$spacing-05;
|
|
214
|
+
color: $text-02;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@media (max-width: 42rem) {
|
|
218
|
+
.sheet {
|
|
219
|
+
padding: layout.$spacing-05 layout.$spacing-04;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.areaCell,
|
|
223
|
+
.codeCell,
|
|
224
|
+
.table thead th:nth-child(-n + 2) {
|
|
225
|
+
display: none;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -11,7 +11,7 @@ export interface CareAndTreatmentGroup {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Care & Treatment and ARV Management, sections 1.1-1.
|
|
14
|
+
* Care & Treatment and ARV Management, sections 1.1-1.7, for the month ending
|
|
15
15
|
* on `endDate`, for the whole facility of the location: each figure added up
|
|
16
16
|
* by age band, sex and MCH/PMTCT -- a few dozen rows, which the report adds
|
|
17
17
|
* up into its tables.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { buildEtlUrl } from '../utils/get-base-url';
|
|
3
|
+
import { PAGE_SIZE, pageParams, toPatientListPage, type PatientListPage } from './patient-list-page';
|
|
4
|
+
|
|
5
|
+
export interface QualityImprovementCounts {
|
|
6
|
+
/**
|
|
7
|
+
* The month's end the counts of a client's status on ART are for
|
|
8
|
+
* (YYYY-MM-DD): the period's last month, or the latest month in the HIV
|
|
9
|
+
* monthly dataset while that one is not in it yet
|
|
10
|
+
*/
|
|
11
|
+
statusMonth: string;
|
|
12
|
+
/** Each indicator's count, e.g. `{ 'recent-defaulters': 744 }` */
|
|
13
|
+
counts: Record<string, number>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The Quality Improvement report for the period from `startDate` to `endDate`
|
|
18
|
+
* (a month, or any dates), for the whole facility of the location: each
|
|
19
|
+
* indicator's count of clients needing an action.
|
|
20
|
+
*/
|
|
21
|
+
export async function getQualityImprovement(params: {
|
|
22
|
+
locationUuids: string;
|
|
23
|
+
startDate: string;
|
|
24
|
+
endDate: string;
|
|
25
|
+
}): Promise<QualityImprovementCounts> {
|
|
26
|
+
const url = await buildEtlUrl('quality-improvement', {
|
|
27
|
+
locationUuids: params.locationUuids,
|
|
28
|
+
startDate: params.startDate,
|
|
29
|
+
endDate: params.endDate,
|
|
30
|
+
});
|
|
31
|
+
const response = await openmrsFetch(url);
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new Error(`Failed to fetch the Quality Improvement report: ${response.status} - ${await response.text()}`);
|
|
34
|
+
}
|
|
35
|
+
const data = await response.json();
|
|
36
|
+
return { statusMonth: data?.statusMonth ?? '', counts: data?.counts ?? {} };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A Case Surveillance card: the gap (numerator) out of the clients it applies to (denominator) */
|
|
40
|
+
export interface CaseSurveillanceCard {
|
|
41
|
+
numerator: number;
|
|
42
|
+
denominator: number;
|
|
43
|
+
/** The indicators whose clients each figure lists */
|
|
44
|
+
numeratorIndicator: string;
|
|
45
|
+
denominatorIndicator: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The Case Surveillance report for the period, for the whole facility of the
|
|
50
|
+
* location: each gap review card, by id (e.g. `not-linked`).
|
|
51
|
+
*/
|
|
52
|
+
export async function getCaseSurveillance(params: {
|
|
53
|
+
locationUuids: string;
|
|
54
|
+
startDate: string;
|
|
55
|
+
endDate: string;
|
|
56
|
+
}): Promise<{ statusMonth: string; cards: Record<string, CaseSurveillanceCard> }> {
|
|
57
|
+
const url = await buildEtlUrl('case-surveillance', {
|
|
58
|
+
locationUuids: params.locationUuids,
|
|
59
|
+
startDate: params.startDate,
|
|
60
|
+
endDate: params.endDate,
|
|
61
|
+
});
|
|
62
|
+
const response = await openmrsFetch(url);
|
|
63
|
+
if (!response.ok) {
|
|
64
|
+
throw new Error(`Failed to fetch the Case Surveillance report: ${response.status} - ${await response.text()}`);
|
|
65
|
+
}
|
|
66
|
+
const data = await response.json();
|
|
67
|
+
return { statusMonth: data?.statusMonth ?? '', cards: data?.cards ?? {} };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** A page of the clients of one indicator (of either report) */
|
|
71
|
+
export async function getQualityImprovementPatientList(params: {
|
|
72
|
+
locationUuids: string;
|
|
73
|
+
startDate: string;
|
|
74
|
+
endDate: string;
|
|
75
|
+
indicator: string;
|
|
76
|
+
startIndex?: number;
|
|
77
|
+
limit?: number;
|
|
78
|
+
}): Promise<PatientListPage> {
|
|
79
|
+
const url = await buildEtlUrl('quality-improvement-patient-list', {
|
|
80
|
+
locationUuids: params.locationUuids,
|
|
81
|
+
startDate: params.startDate,
|
|
82
|
+
endDate: params.endDate,
|
|
83
|
+
indicator: params.indicator,
|
|
84
|
+
...pageParams(params),
|
|
85
|
+
});
|
|
86
|
+
const response = await openmrsFetch(url);
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
throw new Error(`Failed to fetch the patient list: ${response.status} - ${await response.text()}`);
|
|
89
|
+
}
|
|
90
|
+
return toPatientListPage(await response.json(), params.startIndex ?? 0, params.limit ?? PAGE_SIZE);
|
|
91
|
+
}
|
package/src/root.component.tsx
CHANGED
|
@@ -59,7 +59,15 @@ import CareAndTreatmentReport, {
|
|
|
59
59
|
CARE_AND_TREATMENT_LINELIST_PATH,
|
|
60
60
|
} from './reports/program/care-and-treatment/care-and-treatment.component';
|
|
61
61
|
import CareAndTreatmentLinelist from './reports/program/care-and-treatment/care-and-treatment-linelist.component';
|
|
62
|
-
import {
|
|
62
|
+
import { qualityImprovementReports, programReports } from './dashboard/report-catalog';
|
|
63
|
+
import QualityImprovementReport from './reports/quality-improvement/quality-improvement.component';
|
|
64
|
+
import QualityImprovementLinelist from './reports/quality-improvement/quality-improvement-linelist.component';
|
|
65
|
+
import CaseSurveillanceReport from './reports/quality-improvement/case-surveillance.component';
|
|
66
|
+
import { CASE_SURVEILLANCE_PATH } from './reports/quality-improvement/case-surveillance.config';
|
|
67
|
+
import {
|
|
68
|
+
QUALITY_IMPROVEMENT_LINELIST_PATH,
|
|
69
|
+
QUALITY_IMPROVEMENT_PATH,
|
|
70
|
+
} from './reports/quality-improvement/quality-improvement.config';
|
|
63
71
|
import Moh718Report from './reports/moh-718/moh-718.component';
|
|
64
72
|
import MOH713Component from './reports/moh-713/moh-713.component';
|
|
65
73
|
import MOH368Component from './registers/moh-368/moh-368.component';
|
|
@@ -81,7 +89,7 @@ const RootComponent: React.FC = () => {
|
|
|
81
89
|
}
|
|
82
90
|
/>
|
|
83
91
|
<Route path={CARE_AND_TREATMENT_LINELIST_PATH} element={<CareAndTreatmentLinelist />} />
|
|
84
|
-
{/* Program
|
|
92
|
+
{/* Program reports: each on the shared report template page until its own template is built */}
|
|
85
93
|
{programReports
|
|
86
94
|
.filter((report) => report.path !== '/program/care-and-treatment')
|
|
87
95
|
.map((report) => (
|
|
@@ -93,18 +101,23 @@ const RootComponent: React.FC = () => {
|
|
|
93
101
|
}
|
|
94
102
|
/>
|
|
95
103
|
))}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
<Route
|
|
105
|
+
path={QUALITY_IMPROVEMENT_PATH}
|
|
106
|
+
element={
|
|
107
|
+
<QualityImprovementReport
|
|
108
|
+
report={qualityImprovementReports.find((r) => r.path === QUALITY_IMPROVEMENT_PATH)}
|
|
109
|
+
/>
|
|
110
|
+
}
|
|
111
|
+
/>
|
|
112
|
+
<Route path={QUALITY_IMPROVEMENT_LINELIST_PATH} element={<QualityImprovementLinelist />} />
|
|
113
|
+
<Route
|
|
114
|
+
path={CASE_SURVEILLANCE_PATH}
|
|
115
|
+
element={
|
|
116
|
+
<CaseSurveillanceReport
|
|
117
|
+
report={qualityImprovementReports.find((r) => r.path === CASE_SURVEILLANCE_PATH)}
|
|
118
|
+
/>
|
|
119
|
+
}
|
|
120
|
+
/>
|
|
108
121
|
<Route path="/moh-710" element={<Moh710Report />} />
|
|
109
122
|
<Route path="/moh-711" element={<Moh711Report />} />
|
|
110
123
|
<Route path="/moh-717" element={<Moh717Report />} />
|