@ampath/esm-reports-app 1.0.0-next.4 → 1.0.0-next.41
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/110.js +1 -0
- package/dist/110.js.map +1 -0
- package/dist/{260.js → 205.js} +1 -1
- package/dist/{260.js.map → 205.js.map} +1 -1
- package/dist/812.js +1 -1
- package/dist/812.js.map +1 -1
- package/dist/822.js +2 -0
- package/dist/822.js.map +1 -0
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/ampath-esm-reports-app.js.buildmanifest.json +95 -74
- package/dist/ampath-esm-reports-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/common/report-filters/report-filters.component.tsx +68 -7
- package/src/common/report-filters/report-filters.scss +42 -0
- package/src/dashboard/reports-dasboard.tsx +21 -0
- package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +54 -0
- package/src/reports/moh-240/moh-240-header.component.tsx +61 -0
- package/src/reports/moh-240/moh-240.component.tsx +93 -0
- package/src/reports/moh-240/moh-240.scss +11 -0
- package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +75 -0
- package/src/reports/moh-240/sub-reports/page-summary.component.tsx +98 -0
- package/src/reports/moh-505/moh-505-header.component.tsx +62 -0
- package/src/reports/moh-505/moh-505.component.tsx +440 -0
- package/src/reports/moh-505/moh-505.scss +3 -0
- package/src/reports/moh-705B/moh-204b-register.component.tsx +236 -0
- package/src/reports/moh-705B/moh-705b.component.tsx +524 -0
- package/src/reports/moh-705B/moh-705b.scss +44 -0
- package/src/reports/moh-705a/moh-705a.component.tsx +528 -0
- package/src/reports/moh-705a/moh-705a.scss +45 -0
- package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +321 -0
- package/src/reports/moh-705a/type.ts +6 -0
- package/src/reports/moh-706/moh-706-header.component.tsx +61 -0
- package/src/reports/moh-706/moh-706.component.tsx +117 -0
- package/src/reports/moh-706/moh-706.scss +30 -0
- package/src/reports/moh-706/sub-reports/bacteriology/bacteriology.component.tsx +124 -0
- package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +318 -0
- package/src/reports/moh-706/sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component.tsx +137 -0
- package/src/reports/moh-706/sub-reports/haematology/haematology.component.tsx +179 -0
- package/src/reports/moh-706/sub-reports/histology-and-cytology/histology-and-cytology.component.tsx +88 -0
- package/src/reports/moh-706/sub-reports/parasitology/parasitology.component.tsx +121 -0
- package/src/reports/moh-706/sub-reports/serology/serology.component.tsx +47 -0
- package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +39 -0
- package/src/reports/moh-706/sub-reports/urine-analysis/urine-analysis.component.tsx +108 -0
- package/src/reports/moh-710/moh-710.component.tsx +211 -79
- package/src/reports/moh-710/moh-710.scss +5 -1
- package/src/reports/moh-710/registers/moh-511-710-register.component.tsx +263 -0
- package/src/reports/moh-710/registers/type.ts +31 -0
- package/src/reports/moh-711/moh-711.component.tsx +109 -1234
- package/src/reports/moh-711/moh711.scss +92 -8
- package/src/reports/moh-711/registers/moh-333-register.component.tsx +639 -0
- package/src/reports/moh-711/registers/moh-405-register.component.tsx +521 -0
- package/src/reports/moh-711/registers/moh-406-register.component.tsx +533 -0
- package/src/reports/moh-711/registers/moh-510-register.component.tsx +61 -0
- package/src/reports/moh-711/registers/moh-511-register.component.tsx +271 -0
- package/src/reports/moh-711/registers/type.ts +192 -0
- package/src/reports/moh-711/sections/anc.component.tsx +159 -0
- package/src/reports/moh-711/sections/cervical-cancer.component.tsx +148 -0
- package/src/reports/moh-711/sections/chanis.component.tsx +367 -0
- package/src/reports/moh-711/sections/family-planning.component.tsx +221 -0
- package/src/reports/moh-711/sections/gbv.component.tsx +115 -0
- package/src/reports/moh-711/sections/maternity.component.tsx +326 -0
- package/src/reports/moh-711/sections/medical-social-work.component.tsx +83 -0
- package/src/reports/moh-711/sections/other.component.tsx +47 -0
- package/src/reports/moh-711/sections/physiotherapy.component.tsx +61 -0
- package/src/reports/moh-711/sections/pnc.component.tsx +125 -0
- package/src/reports/moh-711/sections/post-abortion.component.tsx +42 -0
- package/src/reports/moh-711/sections/rehabilitation.component.tsx +57 -0
- package/src/reports/moh-711/sections/report-compiled-by.component.tsx +42 -0
- package/src/reports/moh-711/sections/tb-screening.component.tsx +57 -0
- package/src/reports/moh-717/moh-717.component.tsx +120 -946
- package/src/reports/moh-717/moh717.scss +138 -3
- package/src/reports/moh-717/registers/nutrition-register.component.tsx +48 -0
- package/src/reports/moh-717/sections/finance.component.tsx +42 -0
- package/src/reports/moh-717/sections/inpatient.component.tsx +374 -0
- package/src/reports/moh-717/sections/maternity.component.tsx +126 -0
- package/src/reports/moh-717/sections/medical-records.component.tsx +35 -0
- package/src/reports/moh-717/sections/mortuary.component.tsx +43 -0
- package/src/reports/moh-717/sections/operations.component.tsx +53 -0
- package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +98 -0
- package/src/reports/moh-717/sections/outpatient.component.tsx +597 -0
- package/src/reports/moh-717/sections/pharmacy.component.tsx +43 -0
- package/src/reports/moh-717/sections/preparedby.component.tsx +47 -0
- package/src/reports/moh-717/sections/special-services.component.tsx +114 -0
- package/src/reports/moh-731/moh-731.component.tsx +181 -0
- package/src/reports/moh-731/moh-731.scss +118 -0
- package/src/reports/moh-731/registers/moh-366.component.tsx +478 -0
- package/src/reports/moh-731/registers/moh-366.scss +45 -0
- package/src/reports/moh-731/registers/prep-register.component.tsx +292 -0
- package/src/reports/moh-731/registers/prep-registers.scss +45 -0
- package/src/reports/moh-731/sections/hiv-and-tb-treatment.component.tsx +932 -0
- package/src/reports/moh-731/sections/hiv-testing-and-pre-exposure.component.tsx +569 -0
- package/src/reports/moh-731/sections/pmtct.component.tsx +451 -0
- package/src/reports/moh-740/moh-740.component.scss +120 -0
- package/src/reports/moh-740/moh-740.component.tsx +1271 -0
- package/src/reports/moh-740/moh-740.resource.ts +42 -0
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.scss +18 -0
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +104 -0
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.scss +18 -0
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +79 -0
- package/src/reports/moh-740/registers/moh-740-patient-list.scss +0 -0
- package/src/reports/moh-740/registers/moh-740-patient-list.tsx +66 -0
- package/src/reports/moh-740/shared/data-cell/data-cell.scss +6 -0
- package/src/reports/moh-740/shared/data-cell/data-cell.tsx +23 -0
- package/src/reports/moh-740/shared/utils/format-indicator.ts +22 -0
- package/src/reports/moh-740/shared/utils/indicator-register-map.ts +157 -0
- package/src/reports/moh-740/types/index.ts +216 -0
- package/src/reports/moh-745/moh-745.component.tsx +928 -0
- package/src/reports/moh-745/moh-745.scss +74 -0
- package/src/reports/moh-745/registers/moh-412-register.component.tsx +191 -0
- package/src/reports/moh-745/registers/type.ts +30 -0
- package/src/reports/table-wrapper/table-row-mapper.component.tsx +53 -0
- package/src/reports/table-wrapper/table-wrapper.component.tsx +21 -0
- package/src/reports/table-wrapper/table-wrapper.scss +31 -0
- package/src/resources/moh-505.resource.ts +86 -0
- package/src/resources/moh-705.resource.ts +117 -0
- package/src/resources/moh-706.resource.ts +86 -0
- package/src/resources/moh-710.resource.ts +28 -0
- package/src/resources/moh-711.resource.ts +146 -0
- package/src/resources/moh-717.resource.ts +27 -0
- package/src/resources/moh-731.resource.ts +96 -0
- package/src/resources/moh-745.resource.ts +64 -0
- package/src/root.component.tsx +39 -0
- package/src/routes.json +3 -1
- package/src/utils/utils.ts +36 -0
- package/dist/367.js +0 -2
- package/dist/367.js.map +0 -1
- package/dist/86.js +0 -1
- package/dist/86.js.map +0 -1
- /package/dist/{367.js.LICENSE.txt → 822.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
3
|
+
import { Loading } from '@carbon/react';
|
|
4
|
+
import TableWrapper from '../table-wrapper/table-wrapper.component';
|
|
5
|
+
import TableRowMapper from '../table-wrapper/table-row-mapper.component';
|
|
6
|
+
import { getCell } from '../../utils/utils';
|
|
7
|
+
import ReportFiltersComponent from '../../common/report-filters/report-filters.component';
|
|
8
|
+
import { getMoh505 } from '../../resources/moh-505.resource';
|
|
9
|
+
import MOH505Header from './moh-505-header.component';
|
|
10
|
+
import { useSearchParams } from 'react-router-dom';
|
|
11
|
+
|
|
12
|
+
const Moh505Report: React.FC = () => {
|
|
13
|
+
const [moh505Data, setMoh505Data] = useState<any>({});
|
|
14
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
15
|
+
const [errorMessage, setErrorMessage] = useState<string>('');
|
|
16
|
+
const [filters, setFilters] = useState<{ locationUuids?: string; startDate?: string; endDate?: string }>({});
|
|
17
|
+
|
|
18
|
+
const session = useSession();
|
|
19
|
+
const locationUuids = session?.sessionLocation?.uuid;
|
|
20
|
+
|
|
21
|
+
const [searchParams] = useSearchParams();
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const startDate = searchParams.get('startDate');
|
|
25
|
+
const endDate = searchParams.get('endDate');
|
|
26
|
+
|
|
27
|
+
if (startDate && endDate) {
|
|
28
|
+
setFilters({ locationUuids, startDate, endDate });
|
|
29
|
+
fetchMoh505Data({ startDate, endDate });
|
|
30
|
+
}
|
|
31
|
+
}, [searchParams]);
|
|
32
|
+
|
|
33
|
+
const fetchMoh505Data = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
|
|
34
|
+
setErrorMessage('');
|
|
35
|
+
setIsLoading(true);
|
|
36
|
+
|
|
37
|
+
let startDate = filters.startDate;
|
|
38
|
+
let endDate = filters.endDate;
|
|
39
|
+
|
|
40
|
+
if (filters.month) {
|
|
41
|
+
const [year, monthIndex] = filters.month.split('-').map(Number);
|
|
42
|
+
const start = new Date(year, monthIndex - 1, 1);
|
|
43
|
+
const end = new Date(year, monthIndex, 0);
|
|
44
|
+
|
|
45
|
+
const formatLocalDate = (d: Date) => {
|
|
46
|
+
const y = d.getFullYear();
|
|
47
|
+
const m = String(d.getMonth() + 1).padStart(2, '0');
|
|
48
|
+
const day = String(d.getDate()).padStart(2, '0');
|
|
49
|
+
return `${y}-${m}-${day}`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
startDate = formatLocalDate(start);
|
|
53
|
+
endDate = formatLocalDate(end);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const params = {
|
|
57
|
+
locationUuids: locationUuids || '',
|
|
58
|
+
startDate,
|
|
59
|
+
endDate,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const result = await getMoh505(params);
|
|
64
|
+
const flatData = Object.assign({}, ...result);
|
|
65
|
+
setMoh505Data(flatData);
|
|
66
|
+
setFilters({ locationUuids: params.locationUuids, startDate, endDate });
|
|
67
|
+
} catch (error: any) {
|
|
68
|
+
setErrorMessage(error instanceof Error ? error.message : String(error));
|
|
69
|
+
} finally {
|
|
70
|
+
setIsLoading(false);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// Static table rows for now - can be updated to use moh505Data
|
|
75
|
+
const tableRows = [
|
|
76
|
+
{
|
|
77
|
+
tableCells: [
|
|
78
|
+
getCell('', 'Diseases, Conditions or Events', 1, 2, true),
|
|
79
|
+
getCell('', '< 5 years', 2, 1, true),
|
|
80
|
+
getCell('', '≥ 5 years', 6, 1, true),
|
|
81
|
+
getCell('', 'Diseases, Conditions or Events', 1, 2, true),
|
|
82
|
+
getCell('', '< 5 years', 2, 1, true),
|
|
83
|
+
getCell('', '≥ 5 years', 2, 1, true),
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
tableCells: [
|
|
88
|
+
,
|
|
89
|
+
getCell('', 'Cases', 1, 1, true),
|
|
90
|
+
getCell('', 'Deaths', 1, 1, true),
|
|
91
|
+
getCell('', 'Cases', 1, 1, true),
|
|
92
|
+
getCell('', 'Deaths', 5, 1, true),
|
|
93
|
+
,
|
|
94
|
+
getCell('', 'Cases', 1, 1, true),
|
|
95
|
+
getCell('', 'Deaths', 1, 1, true),
|
|
96
|
+
getCell('', 'Cases', 1, 1, true),
|
|
97
|
+
getCell('', 'Deaths', 1, 1, true),
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
tableCells: [
|
|
102
|
+
getCell('', 'AEFI*'),
|
|
103
|
+
getCell('dc__age_range__0_to_4__aefi'),
|
|
104
|
+
getCell(),
|
|
105
|
+
getCell('dc__age_range__5_and_above__aefi'),
|
|
106
|
+
getCell('', '', 5),
|
|
107
|
+
getCell('', 'Meningococcal Meningitis'),
|
|
108
|
+
getCell('dc__age_range__0_to_4__bacterial_meningitis'),
|
|
109
|
+
getCell(),
|
|
110
|
+
getCell('dc__age_range__5_and_above__bacterial_meningitis'),
|
|
111
|
+
getCell(),
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
tableCells: [
|
|
116
|
+
getCell('', 'Acute Jaundice'),
|
|
117
|
+
getCell('dc__age_range__0_to_4__acute_jaundice', ''),
|
|
118
|
+
getCell(),
|
|
119
|
+
getCell('dc__age_range__5_and_above__acute_jaundice', ''),
|
|
120
|
+
getCell('', '', 5),
|
|
121
|
+
getCell('', 'Neonatal deaths'),
|
|
122
|
+
getCell('dc__age_range__0_to_4__neonatal_deaths', ''),
|
|
123
|
+
getCell(),
|
|
124
|
+
getCell('dc__age_range__5_and_above__neonatal_deaths', ''),
|
|
125
|
+
getCell('', '', 2, 2),
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
tableCells: [
|
|
130
|
+
getCell('', 'Acute Malnutrition'),
|
|
131
|
+
getCell('dc__age_range__0_to_4__acute_malnutrition', ''),
|
|
132
|
+
getCell(),
|
|
133
|
+
getCell('dc__age_range__5_and_above__acute_malnutrition', ''),
|
|
134
|
+
getCell('', '', 5),
|
|
135
|
+
getCell('', 'Neonatal Tetanus'),
|
|
136
|
+
getCell('dc__age_range__0_to_4__neonatal_tetanus', ''),
|
|
137
|
+
getCell(),
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
tableCells: [
|
|
142
|
+
getCell('', 'AFP (Poliomyelitis)**'),
|
|
143
|
+
getCell(),
|
|
144
|
+
getCell(),
|
|
145
|
+
getCell(),
|
|
146
|
+
getCell('', '', 5),
|
|
147
|
+
getCell('', 'Plague'),
|
|
148
|
+
getCell('dc__age_range__0_to_4__plague', ''),
|
|
149
|
+
getCell(),
|
|
150
|
+
getCell('dc__age_range__5_and_above__plague', ''),
|
|
151
|
+
getCell(),
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
tableCells: [
|
|
156
|
+
getCell('', 'Anthrax'),
|
|
157
|
+
getCell('dc__age_range__0_to_4__anthrax', ''),
|
|
158
|
+
getCell(),
|
|
159
|
+
getCell('dc__age_range__5_and_above__anthrax', ''),
|
|
160
|
+
getCell('', '', 5),
|
|
161
|
+
getCell('', 'Rabies'),
|
|
162
|
+
getCell('dc__age_range__0_to_4__rabies', ''),
|
|
163
|
+
getCell(),
|
|
164
|
+
getCell('dc__age_range__5_and_above__rabies', ''),
|
|
165
|
+
getCell(),
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
tableCells: [
|
|
170
|
+
getCell('', 'Cholera'),
|
|
171
|
+
getCell('dc__age_range__0_to_4__cholera', ''),
|
|
172
|
+
getCell(),
|
|
173
|
+
getCell('dc__age_range__5_and_above__cholera', ''),
|
|
174
|
+
getCell('', '', 5),
|
|
175
|
+
getCell('', 'Rift Valley Fever'),
|
|
176
|
+
getCell(),
|
|
177
|
+
getCell(),
|
|
178
|
+
getCell(),
|
|
179
|
+
getCell(),
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
tableCells: [
|
|
184
|
+
getCell('', 'Dengue'),
|
|
185
|
+
getCell('dc__age_range__0_to_4__dengue', ''),
|
|
186
|
+
getCell(),
|
|
187
|
+
getCell('dc__age_range__5_and_above__dengue', ''),
|
|
188
|
+
getCell('', '', 5),
|
|
189
|
+
getCell('', 'SARI (Cluster ≥3 cases)*****'),
|
|
190
|
+
getCell(),
|
|
191
|
+
getCell(),
|
|
192
|
+
getCell(),
|
|
193
|
+
getCell(),
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
tableCells: [
|
|
198
|
+
getCell('', 'Dysentery (Bacillary)'),
|
|
199
|
+
getCell('dc__age_range__0_to_4__dysentery_bacillary', ''),
|
|
200
|
+
getCell(),
|
|
201
|
+
getCell('dc__age_range__5_and_above__dysentery_bacillary', ''),
|
|
202
|
+
getCell('', '', 5),
|
|
203
|
+
getCell('', 'Suspected MDR/XDR TB'),
|
|
204
|
+
getCell(),
|
|
205
|
+
getCell(),
|
|
206
|
+
getCell(),
|
|
207
|
+
getCell(),
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
tableCells: [
|
|
212
|
+
getCell('', 'Guinea Worm Disease'),
|
|
213
|
+
getCell(),
|
|
214
|
+
getCell(),
|
|
215
|
+
getCell(),
|
|
216
|
+
getCell('', '', 5),
|
|
217
|
+
getCell('', 'Typhoid'),
|
|
218
|
+
getCell('dc__age_range__0_to_4__typhoid', ''),
|
|
219
|
+
getCell(),
|
|
220
|
+
getCell('dc__age_range__5_and_above__typhoid', ''),
|
|
221
|
+
getCell(),
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
tableCells: [
|
|
226
|
+
getCell('', 'Measles'),
|
|
227
|
+
getCell('dc__age_range__0_to_4__measles', ''),
|
|
228
|
+
getCell(),
|
|
229
|
+
getCell('dc__age_range__5_and_above__measles', ''),
|
|
230
|
+
getCell('', '', 5),
|
|
231
|
+
getCell('', 'VHF******', 1, 2),
|
|
232
|
+
getCell('', '', 1, 2),
|
|
233
|
+
getCell('', '', 1, 2),
|
|
234
|
+
getCell('', '', 1, 2),
|
|
235
|
+
getCell('', '', 1, 2),
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
tableCells: [
|
|
240
|
+
getCell('', 'Suspected Malaria***'),
|
|
241
|
+
getCell(),
|
|
242
|
+
getCell(),
|
|
243
|
+
getCell(),
|
|
244
|
+
getCell('', '', 5),
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
tableCells: [
|
|
249
|
+
getCell('', 'Deaths due to Malaria****', 1, 2),
|
|
250
|
+
getCell('', '', 1, 2),
|
|
251
|
+
getCell('', '', 1, 2),
|
|
252
|
+
getCell('', '', 1, 2),
|
|
253
|
+
getCell('', '', 5, 2),
|
|
254
|
+
getCell('', 'Yellow Fever', 1, 2),
|
|
255
|
+
getCell('dc__age_range__0_to_4__yellow_fever', '', 1, 2),
|
|
256
|
+
getCell('', '', 1, 2),
|
|
257
|
+
getCell('dc__age_range__5_and_above__yellow_fever', '', 1, 2),
|
|
258
|
+
getCell('', '', 1, 2),
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
tableCells: [,],
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
tableCells: [
|
|
266
|
+
getCell('', 'Maternal deaths'),
|
|
267
|
+
getCell('dc__age_range__0_to_4__maternal_deaths', ''),
|
|
268
|
+
getCell(),
|
|
269
|
+
getCell('dc__age_range__5_and_above__maternal_deaths', ''),
|
|
270
|
+
getCell('', '', 5),
|
|
271
|
+
getCell('', 'Others (Specify)*******'),
|
|
272
|
+
getCell(),
|
|
273
|
+
getCell(),
|
|
274
|
+
getCell(),
|
|
275
|
+
getCell(),
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
tableCells: [getCell('', '', 14)],
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
tableCells: [
|
|
283
|
+
getCell('', 'Disease', 1, 1, true),
|
|
284
|
+
getCell('', 'Microscopy', 3, 1, true),
|
|
285
|
+
getCell('', 'mRDT', 5, 1, true),
|
|
286
|
+
getCell('', 'Disease', 2, 1, true),
|
|
287
|
+
getCell('', 'Laboratory diagnosis', 3, 1, true),
|
|
288
|
+
],
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
tableCells: [
|
|
292
|
+
getCell('', 'Malaria', 1, 1, true),
|
|
293
|
+
getCell('', '<5 yrs'),
|
|
294
|
+
getCell('', '≥5 yrs'),
|
|
295
|
+
getCell('', 'Total'),
|
|
296
|
+
getCell('', '<5 yrs', 2),
|
|
297
|
+
getCell('', '≥5 yrs', 3),
|
|
298
|
+
getCell('', 'Shigella Dysentery', 2, 1, true),
|
|
299
|
+
getCell('', '<5 yrs', 2),
|
|
300
|
+
getCell('', '≥5 yrs', 1),
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
tableCells: [
|
|
305
|
+
getCell('', 'Tested'),
|
|
306
|
+
getCell('dc__age_range__0_to_4__malaria_microscopy_tested', ''),
|
|
307
|
+
getCell('dc__age_range__5_and_above__malaria_microscopy_tested', ''),
|
|
308
|
+
getCell(),
|
|
309
|
+
getCell('dc__age_range__0_to_4__malaria_mrdt_tested', '', 2),
|
|
310
|
+
getCell('dc__age_range__5_and_above__malaria_mrdt_tested', '', 3),
|
|
311
|
+
getCell('', 'Tested', 2),
|
|
312
|
+
getCell('dc__age_range__0_to_4__typhoid_lab_tested', '', 2),
|
|
313
|
+
getCell('dc__age_range__5_and_above__typhoid_lab_tested', '', 1),
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
tableCells: [
|
|
318
|
+
getCell('', 'Positive'),
|
|
319
|
+
getCell('dc__age_range__0_to_4__malaria_microscopy_positive', ''),
|
|
320
|
+
getCell('dc__age_range__5_and_above__malaria_microscopy_positive', ''),
|
|
321
|
+
getCell(),
|
|
322
|
+
getCell('dc__age_range__0_to_4__malaria_mrdt_positive', '', 2),
|
|
323
|
+
getCell('dc__age_range__5_and_above__malaria_mrdt_positive', '', 3),
|
|
324
|
+
getCell('', 'Positive', 2),
|
|
325
|
+
getCell('dc__age_range__0_to_4__typhoid_lab_positive', '', 2),
|
|
326
|
+
getCell('dc__age_range__5_and_above__typhoid_lab_positive', '', 1),
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
tableCells: [
|
|
331
|
+
getCell('', 'Bacterial Meningitis', 1, 2, true),
|
|
332
|
+
getCell('', 'No CSF', 1, 2, true),
|
|
333
|
+
getCell('', 'No contaminated', 1, 2, true),
|
|
334
|
+
getCell('', 'No Tested', 1, 2, true),
|
|
335
|
+
getCell('', '+ve Nm', 1, 2, true),
|
|
336
|
+
getCell('', '+ve Sp', 1, 2, true),
|
|
337
|
+
getCell('', '+ve H influenza', 3, 2, true),
|
|
338
|
+
getCell('', 'Tuberculosis (MDR/XDR)', 2, 2, true),
|
|
339
|
+
getCell('', '<5 yrs', 2, 2),
|
|
340
|
+
getCell('', '≥5 yrs', 1, 2),
|
|
341
|
+
],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
tableCells: [,],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
tableCells: [
|
|
348
|
+
getCell('', '', 1, 2),
|
|
349
|
+
getCell('', '', 1, 2),
|
|
350
|
+
getCell('', '', 1, 2),
|
|
351
|
+
getCell('', '', 1, 2),
|
|
352
|
+
getCell('', '', 1, 2),
|
|
353
|
+
getCell('', '', 1, 2),
|
|
354
|
+
getCell('', '', 1, 2),
|
|
355
|
+
getCell('', '', 2, 2),
|
|
356
|
+
getCell('', 'Tested', 2),
|
|
357
|
+
getCell('', '', 2),
|
|
358
|
+
getCell(),
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
tableCells: [, , , , , , , , getCell('', 'Positive', 2), getCell('', '', 2), getCell()],
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
tableCells: [
|
|
366
|
+
getCell('', 'No of CSF Sub-Typed', 1, 2, true),
|
|
367
|
+
getCell('', '+ve NmA', 1, 2, true),
|
|
368
|
+
getCell('', '+ve NmB', 1, 2, true),
|
|
369
|
+
getCell('', '+ve NmC', 1, 2, true),
|
|
370
|
+
getCell('', '+ve NmW 135', 1, 2, true),
|
|
371
|
+
getCell('', '+ve NmX', 1, 2, true),
|
|
372
|
+
getCell('', '+ve NmY', 1, 2, true),
|
|
373
|
+
getCell('', 'Indeterminate', 1, 2, true),
|
|
374
|
+
getCell('', 'Hib', 1, 2, true),
|
|
375
|
+
getCell('', 'Typhoid', 2, 2, true),
|
|
376
|
+
getCell('', '< 5 years', 2, 2),
|
|
377
|
+
getCell('', '≥ 5 years', 1, 2),
|
|
378
|
+
],
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
tableCells: [,],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
tableCells: [
|
|
385
|
+
getCell('', '', 1, 2),
|
|
386
|
+
getCell('', '', 1, 2),
|
|
387
|
+
getCell('', '', 1, 2),
|
|
388
|
+
getCell('', '', 1, 2),
|
|
389
|
+
getCell('', '', 1, 2),
|
|
390
|
+
getCell('', '', 1, 2),
|
|
391
|
+
getCell('', '', 1, 2),
|
|
392
|
+
getCell('', '', 1, 2),
|
|
393
|
+
getCell('', '', 1, 2),
|
|
394
|
+
getCell('', 'Tested', 2),
|
|
395
|
+
getCell('', '', 2),
|
|
396
|
+
getCell('', '', 1),
|
|
397
|
+
],
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
tableCells: [, , , , , , , , , getCell('', 'Positive', 2, 1), getCell('', '', 2, 1), getCell('', '', 1, 1)],
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
tableCells: [,],
|
|
404
|
+
},
|
|
405
|
+
];
|
|
406
|
+
|
|
407
|
+
return (
|
|
408
|
+
<>
|
|
409
|
+
<ReportFiltersComponent
|
|
410
|
+
reportName="MOH-505 Report"
|
|
411
|
+
mode="monthly"
|
|
412
|
+
onGenerate={fetchMoh505Data}
|
|
413
|
+
isLoding={isLoading}
|
|
414
|
+
/>
|
|
415
|
+
{isLoading && <Loading description="Fetching data...." />}
|
|
416
|
+
{!isLoading && errorMessage && (
|
|
417
|
+
<div>
|
|
418
|
+
<a href="#" className="close" data-dismiss="alert">
|
|
419
|
+
×
|
|
420
|
+
</a>
|
|
421
|
+
<h4>
|
|
422
|
+
<strong>
|
|
423
|
+
<span className="glyphicon glyphicon-warning-sign"></span>{' '}
|
|
424
|
+
</strong>{' '}
|
|
425
|
+
An error occurred while trying to load the report. Please try again.
|
|
426
|
+
</h4>
|
|
427
|
+
<p>
|
|
428
|
+
<small>{errorMessage}</small>
|
|
429
|
+
</p>
|
|
430
|
+
</div>
|
|
431
|
+
)}
|
|
432
|
+
<MOH505Header />
|
|
433
|
+
<TableWrapper>
|
|
434
|
+
<TableRowMapper tableRows={tableRows} data={moh505Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} report='moh-505' />
|
|
435
|
+
</TableWrapper>
|
|
436
|
+
</>
|
|
437
|
+
);
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
export default Moh505Report;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { Button, Loading, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import styles from './moh-705b.scss';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
|
|
7
|
+
import { getMoh705bPatientList } from '../../resources/moh-705.resource';
|
|
8
|
+
|
|
9
|
+
const Moh204BRegisterComponent: React.FC = () => {
|
|
10
|
+
const [patientlist, setPatientList] = useState<any[]>([]);
|
|
11
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
12
|
+
const [searchParams] = useSearchParams();
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const location = useLocation();
|
|
15
|
+
const startDate = searchParams.get('startDate');
|
|
16
|
+
const endDate = searchParams.get('endDate');
|
|
17
|
+
const locationUuids = searchParams.get('locationUuids');
|
|
18
|
+
const indicator = searchParams.get('indicator');
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const fetchData = async () => {
|
|
22
|
+
if (!startDate || !endDate || !locationUuids || !indicator) return;
|
|
23
|
+
|
|
24
|
+
setIsLoading(true);
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const params = {
|
|
28
|
+
startDate,
|
|
29
|
+
endDate,
|
|
30
|
+
locationUuids,
|
|
31
|
+
indicator,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const data = await getMoh705bPatientList(params);
|
|
35
|
+
setPatientList(data?.results.results || []);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error('Failed to fetch register data', error);
|
|
38
|
+
} finally {
|
|
39
|
+
setIsLoading(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
fetchData();
|
|
44
|
+
}, [startDate, endDate, locationUuids, indicator]);
|
|
45
|
+
|
|
46
|
+
function navigateBack() {
|
|
47
|
+
navigate(location.state?.from || '/moh-705b');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<div className={styles.buttonContainer}>
|
|
53
|
+
<Button onClick={navigateBack}>Back</Button>
|
|
54
|
+
</div>
|
|
55
|
+
<div>{isLoading && <Loading />}</div>
|
|
56
|
+
<div className={styles.tableContainer}>
|
|
57
|
+
<Table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
|
|
58
|
+
<TableHead>
|
|
59
|
+
<TableRow>
|
|
60
|
+
<TableHeader>Date (DD/MM/YYYY)</TableHeader>
|
|
61
|
+
<TableHeader>
|
|
62
|
+
OPD No.
|
|
63
|
+
<br />
|
|
64
|
+
(New)
|
|
65
|
+
</TableHeader>
|
|
66
|
+
<TableHeader>
|
|
67
|
+
OPD No.
|
|
68
|
+
<br />
|
|
69
|
+
(Revisit)
|
|
70
|
+
</TableHeader>
|
|
71
|
+
<TableHeader>
|
|
72
|
+
Referred
|
|
73
|
+
<br />
|
|
74
|
+
From 1=CU,
|
|
75
|
+
<br />
|
|
76
|
+
2=From Other
|
|
77
|
+
<br />
|
|
78
|
+
facility, 3=
|
|
79
|
+
<br />
|
|
80
|
+
Within 4=N/A
|
|
81
|
+
</TableHeader>
|
|
82
|
+
<TableHeader>Full Names (THREE names)</TableHeader>
|
|
83
|
+
<TableHeader>
|
|
84
|
+
Age in <br />
|
|
85
|
+
Years
|
|
86
|
+
</TableHeader>
|
|
87
|
+
<TableHeader>Sex</TableHeader>
|
|
88
|
+
<TableHeader>
|
|
89
|
+
Countu/Sub-
|
|
90
|
+
<br />
|
|
91
|
+
county
|
|
92
|
+
</TableHeader>
|
|
93
|
+
<TableHeader>
|
|
94
|
+
Village /Estate / <br />
|
|
95
|
+
Landmark
|
|
96
|
+
</TableHeader>
|
|
97
|
+
<TableHeader>
|
|
98
|
+
Patient/
|
|
99
|
+
<br />
|
|
100
|
+
Parent/Caregivers's
|
|
101
|
+
<br />
|
|
102
|
+
Telephone
|
|
103
|
+
<br />
|
|
104
|
+
No.
|
|
105
|
+
</TableHeader>
|
|
106
|
+
<TableHeader>Weight</TableHeader>
|
|
107
|
+
<TableHeader>Height</TableHeader>
|
|
108
|
+
<TableHeader>
|
|
109
|
+
BMI
|
|
110
|
+
<br />
|
|
111
|
+
(Kg/m2)
|
|
112
|
+
</TableHeader>
|
|
113
|
+
<TableHeader>
|
|
114
|
+
Temp
|
|
115
|
+
<br />
|
|
116
|
+
(oC)
|
|
117
|
+
</TableHeader>
|
|
118
|
+
<TableHeader>BP</TableHeader>
|
|
119
|
+
<TableHeader>
|
|
120
|
+
Visual
|
|
121
|
+
<br />
|
|
122
|
+
Aquity <br />
|
|
123
|
+
"RE
|
|
124
|
+
<br />
|
|
125
|
+
(Right
|
|
126
|
+
<br />
|
|
127
|
+
Eye)"LE
|
|
128
|
+
<br />
|
|
129
|
+
(Left
|
|
130
|
+
<br />
|
|
131
|
+
Eye)
|
|
132
|
+
</TableHeader>
|
|
133
|
+
<TableHeader>
|
|
134
|
+
TB Screening 1. <br />
|
|
135
|
+
presumed TB 2. <br />
|
|
136
|
+
No signs 3. On <br /> TB Treatment <br />
|
|
137
|
+
4. Not done
|
|
138
|
+
</TableHeader>
|
|
139
|
+
<TableHeader>
|
|
140
|
+
Malaria
|
|
141
|
+
<br />
|
|
142
|
+
1.Presenting with symptoms NOT
|
|
143
|
+
<br />
|
|
144
|
+
Tested
|
|
145
|
+
<br />
|
|
146
|
+
2.RDT Tested (-ve)
|
|
147
|
+
<br />
|
|
148
|
+
3.Microscopy
|
|
149
|
+
<br />
|
|
150
|
+
Tested (-ve)
|
|
151
|
+
<br />
|
|
152
|
+
4.RDT Tested (+ve)
|
|
153
|
+
<br />
|
|
154
|
+
5. Microscopy
|
|
155
|
+
<br />
|
|
156
|
+
Tested (+ve)
|
|
157
|
+
</TableHeader>
|
|
158
|
+
<TableHeader>Diagnosis</TableHeader>
|
|
159
|
+
<TableHeader>Treatment/Prescription</TableHeader>
|
|
160
|
+
<TableHeader>
|
|
161
|
+
Referred to (1=CU, 2= to <br />
|
|
162
|
+
other H/F, 3=within the <br />
|
|
163
|
+
facility/ 4=N/A)
|
|
164
|
+
</TableHeader>
|
|
165
|
+
<TableHeader>REMARKS/ Outcome</TableHeader>
|
|
166
|
+
</TableRow>
|
|
167
|
+
<TableRow>
|
|
168
|
+
<TableHeader>A</TableHeader>
|
|
169
|
+
<TableHeader>B</TableHeader>
|
|
170
|
+
<TableHeader>C</TableHeader>
|
|
171
|
+
<TableHeader>D</TableHeader>
|
|
172
|
+
<TableHeader>E</TableHeader>
|
|
173
|
+
<TableHeader>F</TableHeader>
|
|
174
|
+
<TableHeader>G</TableHeader>
|
|
175
|
+
<TableHeader>H</TableHeader>
|
|
176
|
+
<TableHeader>I</TableHeader>
|
|
177
|
+
<TableHeader>J</TableHeader>
|
|
178
|
+
<TableHeader>K</TableHeader>
|
|
179
|
+
<TableHeader>L</TableHeader>
|
|
180
|
+
<TableHeader>M</TableHeader>
|
|
181
|
+
<TableHeader>N</TableHeader>
|
|
182
|
+
<TableHeader>O</TableHeader>
|
|
183
|
+
<TableHeader>P</TableHeader>
|
|
184
|
+
<TableHeader>Q</TableHeader>
|
|
185
|
+
<TableHeader>R</TableHeader>
|
|
186
|
+
<TableHeader>S</TableHeader>
|
|
187
|
+
<TableHeader>T</TableHeader>
|
|
188
|
+
<TableHeader>V</TableHeader>
|
|
189
|
+
<TableHeader>W</TableHeader>
|
|
190
|
+
</TableRow>
|
|
191
|
+
</TableHead>
|
|
192
|
+
<TableBody>
|
|
193
|
+
{patientlist?.length > 0 ? (
|
|
194
|
+
patientlist?.map((patient, index) => (
|
|
195
|
+
<TableRow key={patient.person_id || index}>
|
|
196
|
+
<TableCell>{patient.date}</TableCell>
|
|
197
|
+
<TableCell>{patient.opd_number_new_visit}</TableCell>
|
|
198
|
+
<TableCell>{patient.opd_number_return_visit}</TableCell>
|
|
199
|
+
<TableCell>{patient.referred_from}</TableCell>
|
|
200
|
+
<TableCell>{patient.full_names}</TableCell>
|
|
201
|
+
<TableCell>{patient.age}</TableCell>
|
|
202
|
+
<TableCell>{patient.sex}</TableCell>
|
|
203
|
+
<TableCell>{patient.county_sub_county}</TableCell>
|
|
204
|
+
<TableCell>{patient.village_estate_landmark}</TableCell>
|
|
205
|
+
<TableCell>{patient.phone_number}</TableCell>
|
|
206
|
+
<TableCell>{patient.weight}</TableCell>
|
|
207
|
+
<TableCell>{patient.height}</TableCell>
|
|
208
|
+
<TableCell>{patient.bmi}</TableCell>
|
|
209
|
+
<TableCell>{patient.temp}</TableCell>
|
|
210
|
+
<TableCell>
|
|
211
|
+
{patient.systolic} / {patient.diastolic}
|
|
212
|
+
</TableCell>
|
|
213
|
+
<TableCell>
|
|
214
|
+
{patient.visual_aquity_re} / {patient.visual_aquity_le}
|
|
215
|
+
</TableCell>
|
|
216
|
+
<TableCell>{patient.tb_screening}</TableCell>
|
|
217
|
+
<TableCell>{patient.malaria}</TableCell>
|
|
218
|
+
<TableCell>{patient.diagnosis}</TableCell>
|
|
219
|
+
<TableCell>{patient.treatment_prescription}</TableCell>
|
|
220
|
+
<TableCell>{patient.referred_to}</TableCell>
|
|
221
|
+
<TableCell>{patient.remarks}</TableCell>
|
|
222
|
+
</TableRow>
|
|
223
|
+
))
|
|
224
|
+
) : (
|
|
225
|
+
<TableRow>
|
|
226
|
+
<TableCell colSpan={22}>No data available</TableCell>
|
|
227
|
+
</TableRow>
|
|
228
|
+
)}
|
|
229
|
+
</TableBody>
|
|
230
|
+
</Table>
|
|
231
|
+
</div>
|
|
232
|
+
</>
|
|
233
|
+
);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export default Moh204BRegisterComponent;
|