@ampath/esm-reports-app 1.0.0-next.26 → 1.0.0-next.27

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.
Files changed (42) hide show
  1. package/dist/645.js +1 -0
  2. package/dist/645.js.map +1 -0
  3. package/dist/812.js +1 -1
  4. package/dist/ampath-esm-reports-app.js.buildmanifest.json +26 -26
  5. package/dist/main.js +1 -1
  6. package/dist/routes.json +1 -1
  7. package/package.json +1 -1
  8. package/src/reports/moh-705B/moh-204b-register.component.tsx +235 -0
  9. package/src/reports/moh-705B/moh-705b.component.tsx +141 -83
  10. package/src/reports/moh-705B/moh-705b.scss +4 -1
  11. package/src/reports/moh-705a/moh-705a.component.tsx +141 -86
  12. package/src/reports/moh-705a/moh-705a.scss +5 -1
  13. package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +320 -0
  14. package/src/reports/moh-705a/type.ts +6 -0
  15. package/src/reports/moh-710/moh-710.component.tsx +3 -1
  16. package/src/reports/moh-710/moh-710.scss +4 -0
  17. package/src/reports/moh-710/patient-list/moh-710-patient-list.component.tsx +13 -0
  18. package/src/reports/moh-711/moh-711.component.tsx +30 -12
  19. package/src/reports/moh-711/moh711.scss +11 -0
  20. package/src/reports/moh-711/registers/moh-333-register.component.tsx +636 -0
  21. package/src/reports/moh-711/registers/moh-405-register.component.tsx +518 -0
  22. package/src/reports/moh-711/registers/moh-406-register.component.tsx +530 -0
  23. package/src/reports/moh-711/registers/moh-510-register.component.tsx +61 -0
  24. package/src/reports/moh-711/registers/moh-511-register.component.tsx +263 -0
  25. package/src/reports/moh-711/registers/type.ts +194 -0
  26. package/src/reports/moh-711/sections/anc.component.tsx +45 -22
  27. package/src/reports/moh-711/sections/maternity.component.tsx +79 -40
  28. package/src/reports/moh-711/sections/pnc.component.tsx +39 -13
  29. package/src/reports/moh-717/moh-717.component.tsx +28 -10
  30. package/src/reports/moh-717/moh717.scss +4 -0
  31. package/src/reports/moh-717/sections/maternity.component.tsx +38 -13
  32. package/src/reports/moh-745/moh-745.component.tsx +440 -141
  33. package/src/reports/moh-745/moh-745.scss +5 -0
  34. package/src/reports/moh-745/registers/moh-412-register.component.tsx +190 -0
  35. package/src/reports/moh-745/registers/type.ts +29 -0
  36. package/src/resources/moh-705.resource.ts +57 -0
  37. package/src/resources/moh-710.resource.ts +26 -0
  38. package/src/resources/moh-711.resource.ts +141 -0
  39. package/src/resources/moh-745.resource.ts +32 -2
  40. package/src/root.component.tsx +18 -0
  41. package/dist/269.js +0 -1
  42. package/dist/269.js.map +0 -1
@@ -0,0 +1,320 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Button, Loading, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
3
+
4
+ import styles from '../moh-705a.scss';
5
+ import classNames from 'classnames';
6
+ import { useNavigate, useSearchParams } from 'react-router-dom';
7
+ import { getMoh705aPatientList } from '../../../resources/moh-705.resource';
8
+
9
+ interface Moh204ARegisterComponentProps {}
10
+
11
+ const Moh204ARegisterComponent: React.FC<Moh204ARegisterComponentProps> = () => {
12
+ const [patientlist, setPatientList] = useState<any[]>([]);
13
+ const [isLoading, setIsLoading] = useState<boolean>(false);
14
+ const [searchParams] = useSearchParams();
15
+ const navigate = useNavigate();
16
+ const startDate = searchParams.get('startDate');
17
+ const endDate = searchParams.get('endDate');
18
+ const locationUuids = searchParams.get('locationUuids');
19
+ const indicator = searchParams.get('indicator');
20
+
21
+ function navigateBack() {
22
+ navigate('/moh-705a');
23
+ }
24
+
25
+ useEffect(() => {
26
+ const fetchData = async () => {
27
+ if (!startDate || !endDate || !locationUuids || !indicator) return;
28
+
29
+ setIsLoading(true);
30
+
31
+ try {
32
+ const params = {
33
+ startDate,
34
+ endDate,
35
+ locationUuids,
36
+ indicator,
37
+ };
38
+
39
+ const data = await getMoh705aPatientList(params);
40
+ setPatientList(data?.results.results || []);
41
+ } catch (error) {
42
+ console.error('Failed to fetch register data', error);
43
+ } finally {
44
+ setIsLoading(false);
45
+ }
46
+ };
47
+
48
+ fetchData();
49
+ }, [startDate, endDate, locationUuids, indicator]);
50
+
51
+ return (
52
+ <>
53
+ <div className={styles.buttonContainer}>
54
+ <Button onClick={navigateBack}>Back</Button>
55
+ </div>
56
+ <div>{isLoading && <Loading />}</div>
57
+ <div className={styles.tableContainer}>
58
+ <Table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
59
+ <TableHead>
60
+ <TableRow>
61
+ <TableHeader>
62
+ Date <br /> (DD/MM/YYYY)
63
+ </TableHeader>
64
+ <TableHeader>
65
+ OPD No.
66
+ <br />
67
+ (New)
68
+ </TableHeader>
69
+ <TableHeader>
70
+ OPD No.
71
+ <br />
72
+ (Revisit)
73
+ </TableHeader>
74
+ <TableHeader>
75
+ Referred
76
+ <br />
77
+ From 1=CU,
78
+ <br />
79
+ 2=From Other
80
+ <br />
81
+ facility, 3=
82
+ <br />
83
+ Within 4=N/A
84
+ </TableHeader>
85
+ <TableHeader>Full Names (THREE names)</TableHeader>
86
+ <TableHeader>Age</TableHeader>
87
+ <TableHeader>Sex</TableHeader>
88
+ <TableHeader>Countu/Sub-county</TableHeader>
89
+ <TableHeader>
90
+ Village /Estate / <br />
91
+ Landmark
92
+ </TableHeader>
93
+ <TableHeader>
94
+ Parent/Caregivers's
95
+ <br />
96
+ Telephone
97
+ <br />
98
+ No.
99
+ </TableHeader>
100
+ <TableHeader>Weight(kg)</TableHeader>
101
+ <TableHeader>
102
+ Height
103
+ <br />
104
+ /Length
105
+ <br />
106
+ (cm)
107
+ </TableHeader>
108
+ <TableHeader>
109
+ MUAC
110
+ <br />
111
+ 1.Green
112
+ <br />
113
+ 2.Yellow
114
+ <br />
115
+ 3.Red
116
+ </TableHeader>
117
+ <TableHeader>
118
+ Temp
119
+ <br />
120
+ (oC)
121
+ </TableHeader>
122
+ <TableHeader>
123
+ Respiratory
124
+ <br />
125
+ Rate
126
+ </TableHeader>
127
+ <TableHeader>
128
+ Oxygen Saturation
129
+ <br />
130
+ Reading <br />
131
+ (SPO2)
132
+ </TableHeader>
133
+ <TableHeader>
134
+ Pulse
135
+ <br />
136
+ Rate
137
+ </TableHeader>
138
+ <TableHeader>
139
+ DANGER SIGNS
140
+ <br />
141
+ 1.Unable to drink or <br />
142
+ breastfeed
143
+ <br />
144
+ 2.Vomits everything
145
+ <br />
146
+ 3.Had convulsions
147
+ <br />
148
+ in this illness
149
+ <br />
150
+ 4.Is lethargic or <br />
151
+ unconscious
152
+ <br />
153
+ 5.Is convulsing now
154
+ </TableHeader>
155
+ <TableHeader>
156
+ Duration
157
+ <br />
158
+ of Current
159
+ <br />
160
+ Illness
161
+ <br />
162
+ (in hours/
163
+ <br />
164
+ days)
165
+ </TableHeader>
166
+ <TableHeader>
167
+ Malaria
168
+ <br />
169
+ 1.Presenting with symptoms NOT
170
+ <br />
171
+ Tested
172
+ <br />
173
+ 2.RDT Tested (-ve)
174
+ <br />
175
+ 3.Microscopy
176
+ <br />
177
+ Tested (-ve)
178
+ <br />
179
+ 4.RDT Tested (+ve)
180
+ <br />
181
+ 5. Microscopy
182
+ <br />
183
+ Tested (+ve)
184
+ </TableHeader>
185
+ <TableHeader>
186
+ IMNCI Classification or <br />
187
+ Diagnosis
188
+ </TableHeader>
189
+ <TableHeader>
190
+ TRACER DRUGS <br />
191
+ PRESCRIBED
192
+ <br />
193
+ 1. ORS & Zinc <br />
194
+ (Co-pack)
195
+ <br />
196
+ 2.Zinc Only
197
+ <br />
198
+ 3. ORS Only 4.
199
+ <br />
200
+ Amoxicillin DT
201
+ <br />
202
+ 5. Vitamin A <br />
203
+ 6.Oxygen <br />
204
+ 7. Albendazole <br />
205
+ 8.IV Fluids
206
+ </TableHeader>
207
+ <TableHeader>
208
+ Other <br />
209
+ ALL <br />
210
+ Treatments <br />
211
+ Prescribed 1. <br />
212
+ CPAP 2.
213
+ <br />
214
+ Other
215
+ </TableHeader>
216
+ <TableHeader>
217
+ Immunization
218
+ <br />
219
+ Status Up to <br />
220
+ Date (Y/N)
221
+ </TableHeader>
222
+ <TableHeader>
223
+ TB Screening 1. <br />
224
+ presumed TB 2. <br />
225
+ Referred
226
+ </TableHeader>
227
+ <TableHeader>
228
+ Nutrition and diatetics <br />
229
+ Interventions 1=Nutrition
230
+ <br />
231
+ counselling 2=Nutrition
232
+ <br />
233
+ therapeutic supplements 3<br />
234
+ =. Diatetics
235
+ </TableHeader>
236
+ <TableHeader>
237
+ Referred to (1=CU, 2= to <br />
238
+ other H/F, 3=within the <br />
239
+ facility/ 4=N/A)
240
+ </TableHeader>
241
+ <TableHeader>REMARKS/ Outcome</TableHeader>
242
+ </TableRow>
243
+ <TableRow>
244
+ <TableHeader>A</TableHeader>
245
+ <TableHeader>B</TableHeader>
246
+ <TableHeader>C</TableHeader>
247
+ <TableHeader>D</TableHeader>
248
+ <TableHeader>E</TableHeader>
249
+ <TableHeader>F</TableHeader>
250
+ <TableHeader>G</TableHeader>
251
+ <TableHeader>H</TableHeader>
252
+ <TableHeader>I</TableHeader>
253
+ <TableHeader>J</TableHeader>
254
+ <TableHeader>K</TableHeader>
255
+ <TableHeader>L</TableHeader>
256
+ <TableHeader>M</TableHeader>
257
+ <TableHeader>N</TableHeader>
258
+ <TableHeader>O</TableHeader>
259
+ <TableHeader>P</TableHeader>
260
+ <TableHeader>Q</TableHeader>
261
+ <TableHeader>R</TableHeader>
262
+ <TableHeader>S</TableHeader>
263
+ <TableHeader>T</TableHeader>
264
+ <TableHeader>U</TableHeader>
265
+ <TableHeader>V</TableHeader>
266
+ <TableHeader>W</TableHeader>
267
+ <TableHeader>X</TableHeader>
268
+ <TableHeader>Y</TableHeader>
269
+ <TableHeader>Z</TableHeader>
270
+ <TableHeader>AA</TableHeader>
271
+ <TableHeader>AB</TableHeader>
272
+ </TableRow>
273
+ </TableHead>
274
+ <TableBody>
275
+ {patientlist?.length > 0 ? (
276
+ patientlist?.map((patient) => (
277
+ <TableRow key={patient.person_id || patient.id}>
278
+ <TableCell>{patient.date}</TableCell>
279
+ <TableCell>{patient.opd_number_new_visit}</TableCell>
280
+ <TableCell>{patient.opd_number_return_visit}</TableCell>
281
+ <TableCell>{patient.referred_from}</TableCell>
282
+ <TableCell>{patient.full_names}</TableCell>
283
+ <TableCell>{patient.age}</TableCell>
284
+ <TableCell>{patient.sex}</TableCell>
285
+ <TableCell>{patient.county_sub_county}</TableCell>
286
+ <TableCell>{patient.village_estate_landmark}</TableCell>
287
+ <TableCell>{patient.caregiver_phone_number}</TableCell>
288
+ <TableCell>{patient.weight}</TableCell>
289
+ <TableCell>{patient.height}</TableCell>
290
+ <TableCell>{patient.muac}</TableCell>
291
+ <TableCell>{patient.temp}</TableCell>
292
+ <TableCell>{patient.respiratory_rate}</TableCell>
293
+ <TableCell>{patient.oxygen_saturation}</TableCell>
294
+ <TableCell>{patient.pulse_rate}</TableCell>
295
+ <TableCell>{patient.danger_signs}</TableCell>
296
+ <TableCell>{patient.duration_of_illness}</TableCell>
297
+ <TableCell>{patient.suspected_malaria_cases}</TableCell>
298
+ <TableCell>{patient.diagnosis}</TableCell>
299
+ <TableCell>{patient.tracer_drugs_prescribed}</TableCell>
300
+ <TableCell>{patient.all_other_treatments_prescribed}</TableCell>
301
+ <TableCell>{patient.immunization_status_up_to_date}</TableCell>
302
+ <TableCell>{patient.tb_screening}</TableCell>
303
+ <TableCell>{patient.nutrition_dietetics}</TableCell>
304
+ <TableCell>{patient.referred_to}</TableCell>
305
+ <TableCell>{patient.remarks}</TableCell>
306
+ </TableRow>
307
+ ))
308
+ ) : (
309
+ <TableRow>
310
+ <TableCell colSpan={28}>No data available</TableCell>
311
+ </TableRow>
312
+ )}
313
+ </TableBody>
314
+ </Table>
315
+ </div>
316
+ </>
317
+ );
318
+ };
319
+
320
+ export default Moh204ARegisterComponent;
@@ -0,0 +1,6 @@
1
+ export type ReportFilters = {
2
+ startDate?: string;
3
+ endDate?: string;
4
+ month?: string;
5
+ indicator?: string;
6
+ };
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react';
2
+ import { useNavigate } from 'react-router-dom';
2
3
  import ReportFiltersComponent from '../../common/report-filters/report-filters.component';
3
4
 
4
5
  import styles from './moh-710.scss';
@@ -11,6 +12,7 @@ const Moh710Report: React.FC = () => {
11
12
  let errorMessage: string = '';
12
13
  const [moh710Data, setMoh710Data] = useState<any>([]);
13
14
  const [isLoading, setIsLoading] = useState<boolean>(false);
15
+ const navigate = useNavigate();
14
16
 
15
17
  const session = useSession();
16
18
  const locationUuids = session?.sessionLocation?.uuid;
@@ -93,7 +95,7 @@ const Moh710Report: React.FC = () => {
93
95
  <tbody>
94
96
  <tr>
95
97
  <td>BCG doses Administered</td>
96
- <td>{moh710Data.bcg_vaccine_age_less_than_1yr}</td>
98
+ <td onClick={() => navigate('/moh-710-patient-list')}>{moh710Data.bcg_vaccine_age_less_than_1yr}</td>
97
99
  <td>{moh710Data.bcg_vaccine_age_greater_than_1yr}</td>
98
100
  </tr>
99
101
  <tr>
@@ -38,4 +38,8 @@ h3 {
38
38
 
39
39
  .tableStriped tbody tr:nth-of-type(odd) {
40
40
  background-color: #f9f9f9;
41
+ }
42
+
43
+ .buttonContainer {
44
+ margin: 1rem;
41
45
  }
@@ -0,0 +1,13 @@
1
+ import { useSession } from '@openmrs/esm-framework';
2
+ import React, { useState } from 'react';
3
+ import { getMoh710PatientList } from '../../../resources/moh-710.resource';
4
+
5
+ const Moh710PatientList: React.FC = () => {
6
+ const [moh710PatientListData, setMoh710PatientListData] = useState<any>([]);
7
+ const [isLoading, setIsLoading] = useState<boolean>(false);
8
+ const session = useSession();
9
+ const locationUuid = session?.sessionLocation?.uuid;
10
+ return <></>;
11
+ };
12
+
13
+ export default Moh710PatientList;
@@ -20,18 +20,20 @@ import MedicalSocialWorkComponent from './sections/medical-social-work.component
20
20
  import PhysiotherapyComponent from './sections/physiotherapy.component';
21
21
  import OtherComponent from './sections/other.component';
22
22
  import ReportCompiledByComponent from './sections/report-compiled-by.component';
23
+ import { type ReportFilters } from '../moh-705a/type';
23
24
 
24
25
  const Moh711Report: React.FC = () => {
25
26
  let errorMessage: string = '';
26
27
  const [moh711Data, setMoh711Data] = useState<any>([]);
27
28
  const [isLoading, setIsLoading] = useState<boolean>(false);
29
+ const [startDate, setStartDate] = useState<string>('');
30
+ const [endDate, setEndDate] = useState<string>('');
28
31
 
29
32
  const session = useSession();
30
33
  const locationUuid = session?.sessionLocation?.uuid;
31
- const fetchMoh711ReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
32
- setIsLoading(true);
33
- let startDate = filters.startDate;
34
- let endDate = filters.endDate;
34
+
35
+ const getReportParams = (filters: ReportFilters) => {
36
+ let { startDate: sDate, endDate: eDate } = filters;
35
37
 
36
38
  if (filters.month) {
37
39
  const [year, monthIndex] = filters.month.split('-').map(Number);
@@ -40,16 +42,27 @@ const Moh711Report: React.FC = () => {
40
42
  const end = new Date(year, monthIndex, 0);
41
43
 
42
44
  const formatLocalDate = (d: Date) => {
43
- const year = d.getFullYear();
44
- const month = String(d.getMonth() + 1).padStart(2, '0');
45
+ const y = d.getFullYear();
46
+ const m = String(d.getMonth() + 1).padStart(2, '0');
45
47
  const day = String(d.getDate()).padStart(2, '0');
46
- return `${year}-${month}-${day}`;
48
+ return `${y}-${m}-${day}`;
47
49
  };
48
50
 
49
- startDate = formatLocalDate(start);
50
- endDate = formatLocalDate(end);
51
+ sDate = formatLocalDate(start);
52
+ eDate = formatLocalDate(end);
51
53
  }
52
54
 
55
+ setStartDate(sDate || '');
56
+ setEndDate(eDate || '');
57
+
58
+ return { startDate: sDate, endDate: eDate };
59
+ };
60
+
61
+ const fetchMoh711ReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
62
+ setIsLoading(true);
63
+
64
+ const { startDate, endDate } = getReportParams(filters);
65
+
53
66
  const params = {
54
67
  locationUuids: locationUuid || '',
55
68
  startDate,
@@ -96,17 +109,22 @@ const Moh711Report: React.FC = () => {
96
109
  </h5>
97
110
  <div className={styles.container}>
98
111
  <div className={styles.left}>
99
- <ANCComponent moh711Data={moh711Data} />
112
+ <ANCComponent moh711Data={moh711Data} startDate={startDate} endDate={endDate} locationUuids={locationUuid!} />
100
113
  <GBVComponent moh711Data={moh711Data} />
101
114
  <FamilyPlanningComponent moh711Data={moh711Data} />
102
115
  <CervicalCancerComponent moh711Data={moh711Data} />
103
- <PNCComponent moh711Data={moh711Data} />
116
+ <PNCComponent moh711Data={moh711Data} startDate={startDate} endDate={endDate} locationUuids={locationUuid!} />
104
117
  <RehabilitationComponent moh711Data={moh711Data} />
105
118
  <MedicalSocialWorkComponent moh711Data={moh711Data} />
106
119
  <ReportCompiledByComponent />
107
120
  </div>
108
121
  <div className={styles.right}>
109
- <MaternityComponent moh711Data={moh711Data} />
122
+ <MaternityComponent
123
+ moh711Data={moh711Data}
124
+ startDate={startDate}
125
+ endDate={endDate}
126
+ locationUuids={locationUuid!}
127
+ />
110
128
  <PostAbortion moh711Data={moh711Data} />
111
129
  <ChanisComponent moh711Data={moh711Data} />
112
130
  <PhysiotherapyComponent moh711Data={moh711Data} />
@@ -68,4 +68,15 @@ h5 {
68
68
  }
69
69
  .compiledBy {
70
70
  width: 10rem
71
+ }
72
+
73
+ .buttonContainer {
74
+ margin: 1rem;
75
+ }
76
+
77
+ .textCenter {
78
+ text-align: center;
79
+ }
80
+ .tableContainer {
81
+ margin: 1rem;
71
82
  }