@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.
Files changed (132) hide show
  1. package/dist/110.js +1 -0
  2. package/dist/110.js.map +1 -0
  3. package/dist/{260.js → 205.js} +1 -1
  4. package/dist/{260.js.map → 205.js.map} +1 -1
  5. package/dist/812.js +1 -1
  6. package/dist/812.js.map +1 -1
  7. package/dist/822.js +2 -0
  8. package/dist/822.js.map +1 -0
  9. package/dist/ampath-esm-reports-app.js +1 -1
  10. package/dist/ampath-esm-reports-app.js.buildmanifest.json +95 -74
  11. package/dist/ampath-esm-reports-app.js.map +1 -1
  12. package/dist/main.js +1 -1
  13. package/dist/main.js.map +1 -1
  14. package/dist/routes.json +1 -1
  15. package/package.json +1 -1
  16. package/src/common/report-filters/report-filters.component.tsx +68 -7
  17. package/src/common/report-filters/report-filters.scss +42 -0
  18. package/src/dashboard/reports-dasboard.tsx +21 -0
  19. package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +54 -0
  20. package/src/reports/moh-240/moh-240-header.component.tsx +61 -0
  21. package/src/reports/moh-240/moh-240.component.tsx +93 -0
  22. package/src/reports/moh-240/moh-240.scss +11 -0
  23. package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +75 -0
  24. package/src/reports/moh-240/sub-reports/page-summary.component.tsx +98 -0
  25. package/src/reports/moh-505/moh-505-header.component.tsx +62 -0
  26. package/src/reports/moh-505/moh-505.component.tsx +440 -0
  27. package/src/reports/moh-505/moh-505.scss +3 -0
  28. package/src/reports/moh-705B/moh-204b-register.component.tsx +236 -0
  29. package/src/reports/moh-705B/moh-705b.component.tsx +524 -0
  30. package/src/reports/moh-705B/moh-705b.scss +44 -0
  31. package/src/reports/moh-705a/moh-705a.component.tsx +528 -0
  32. package/src/reports/moh-705a/moh-705a.scss +45 -0
  33. package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +321 -0
  34. package/src/reports/moh-705a/type.ts +6 -0
  35. package/src/reports/moh-706/moh-706-header.component.tsx +61 -0
  36. package/src/reports/moh-706/moh-706.component.tsx +117 -0
  37. package/src/reports/moh-706/moh-706.scss +30 -0
  38. package/src/reports/moh-706/sub-reports/bacteriology/bacteriology.component.tsx +124 -0
  39. package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +318 -0
  40. package/src/reports/moh-706/sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component.tsx +137 -0
  41. package/src/reports/moh-706/sub-reports/haematology/haematology.component.tsx +179 -0
  42. package/src/reports/moh-706/sub-reports/histology-and-cytology/histology-and-cytology.component.tsx +88 -0
  43. package/src/reports/moh-706/sub-reports/parasitology/parasitology.component.tsx +121 -0
  44. package/src/reports/moh-706/sub-reports/serology/serology.component.tsx +47 -0
  45. package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +39 -0
  46. package/src/reports/moh-706/sub-reports/urine-analysis/urine-analysis.component.tsx +108 -0
  47. package/src/reports/moh-710/moh-710.component.tsx +211 -79
  48. package/src/reports/moh-710/moh-710.scss +5 -1
  49. package/src/reports/moh-710/registers/moh-511-710-register.component.tsx +263 -0
  50. package/src/reports/moh-710/registers/type.ts +31 -0
  51. package/src/reports/moh-711/moh-711.component.tsx +109 -1234
  52. package/src/reports/moh-711/moh711.scss +92 -8
  53. package/src/reports/moh-711/registers/moh-333-register.component.tsx +639 -0
  54. package/src/reports/moh-711/registers/moh-405-register.component.tsx +521 -0
  55. package/src/reports/moh-711/registers/moh-406-register.component.tsx +533 -0
  56. package/src/reports/moh-711/registers/moh-510-register.component.tsx +61 -0
  57. package/src/reports/moh-711/registers/moh-511-register.component.tsx +271 -0
  58. package/src/reports/moh-711/registers/type.ts +192 -0
  59. package/src/reports/moh-711/sections/anc.component.tsx +159 -0
  60. package/src/reports/moh-711/sections/cervical-cancer.component.tsx +148 -0
  61. package/src/reports/moh-711/sections/chanis.component.tsx +367 -0
  62. package/src/reports/moh-711/sections/family-planning.component.tsx +221 -0
  63. package/src/reports/moh-711/sections/gbv.component.tsx +115 -0
  64. package/src/reports/moh-711/sections/maternity.component.tsx +326 -0
  65. package/src/reports/moh-711/sections/medical-social-work.component.tsx +83 -0
  66. package/src/reports/moh-711/sections/other.component.tsx +47 -0
  67. package/src/reports/moh-711/sections/physiotherapy.component.tsx +61 -0
  68. package/src/reports/moh-711/sections/pnc.component.tsx +125 -0
  69. package/src/reports/moh-711/sections/post-abortion.component.tsx +42 -0
  70. package/src/reports/moh-711/sections/rehabilitation.component.tsx +57 -0
  71. package/src/reports/moh-711/sections/report-compiled-by.component.tsx +42 -0
  72. package/src/reports/moh-711/sections/tb-screening.component.tsx +57 -0
  73. package/src/reports/moh-717/moh-717.component.tsx +120 -946
  74. package/src/reports/moh-717/moh717.scss +138 -3
  75. package/src/reports/moh-717/registers/nutrition-register.component.tsx +48 -0
  76. package/src/reports/moh-717/sections/finance.component.tsx +42 -0
  77. package/src/reports/moh-717/sections/inpatient.component.tsx +374 -0
  78. package/src/reports/moh-717/sections/maternity.component.tsx +126 -0
  79. package/src/reports/moh-717/sections/medical-records.component.tsx +35 -0
  80. package/src/reports/moh-717/sections/mortuary.component.tsx +43 -0
  81. package/src/reports/moh-717/sections/operations.component.tsx +53 -0
  82. package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +98 -0
  83. package/src/reports/moh-717/sections/outpatient.component.tsx +597 -0
  84. package/src/reports/moh-717/sections/pharmacy.component.tsx +43 -0
  85. package/src/reports/moh-717/sections/preparedby.component.tsx +47 -0
  86. package/src/reports/moh-717/sections/special-services.component.tsx +114 -0
  87. package/src/reports/moh-731/moh-731.component.tsx +181 -0
  88. package/src/reports/moh-731/moh-731.scss +118 -0
  89. package/src/reports/moh-731/registers/moh-366.component.tsx +478 -0
  90. package/src/reports/moh-731/registers/moh-366.scss +45 -0
  91. package/src/reports/moh-731/registers/prep-register.component.tsx +292 -0
  92. package/src/reports/moh-731/registers/prep-registers.scss +45 -0
  93. package/src/reports/moh-731/sections/hiv-and-tb-treatment.component.tsx +932 -0
  94. package/src/reports/moh-731/sections/hiv-testing-and-pre-exposure.component.tsx +569 -0
  95. package/src/reports/moh-731/sections/pmtct.component.tsx +451 -0
  96. package/src/reports/moh-740/moh-740.component.scss +120 -0
  97. package/src/reports/moh-740/moh-740.component.tsx +1271 -0
  98. package/src/reports/moh-740/moh-740.resource.ts +42 -0
  99. package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.scss +18 -0
  100. package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +104 -0
  101. package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.scss +18 -0
  102. package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +79 -0
  103. package/src/reports/moh-740/registers/moh-740-patient-list.scss +0 -0
  104. package/src/reports/moh-740/registers/moh-740-patient-list.tsx +66 -0
  105. package/src/reports/moh-740/shared/data-cell/data-cell.scss +6 -0
  106. package/src/reports/moh-740/shared/data-cell/data-cell.tsx +23 -0
  107. package/src/reports/moh-740/shared/utils/format-indicator.ts +22 -0
  108. package/src/reports/moh-740/shared/utils/indicator-register-map.ts +157 -0
  109. package/src/reports/moh-740/types/index.ts +216 -0
  110. package/src/reports/moh-745/moh-745.component.tsx +928 -0
  111. package/src/reports/moh-745/moh-745.scss +74 -0
  112. package/src/reports/moh-745/registers/moh-412-register.component.tsx +191 -0
  113. package/src/reports/moh-745/registers/type.ts +30 -0
  114. package/src/reports/table-wrapper/table-row-mapper.component.tsx +53 -0
  115. package/src/reports/table-wrapper/table-wrapper.component.tsx +21 -0
  116. package/src/reports/table-wrapper/table-wrapper.scss +31 -0
  117. package/src/resources/moh-505.resource.ts +86 -0
  118. package/src/resources/moh-705.resource.ts +117 -0
  119. package/src/resources/moh-706.resource.ts +86 -0
  120. package/src/resources/moh-710.resource.ts +28 -0
  121. package/src/resources/moh-711.resource.ts +146 -0
  122. package/src/resources/moh-717.resource.ts +27 -0
  123. package/src/resources/moh-731.resource.ts +96 -0
  124. package/src/resources/moh-745.resource.ts +64 -0
  125. package/src/root.component.tsx +39 -0
  126. package/src/routes.json +3 -1
  127. package/src/utils/utils.ts +36 -0
  128. package/dist/367.js +0 -2
  129. package/dist/367.js.map +0 -1
  130. package/dist/86.js +0 -1
  131. package/dist/86.js.map +0 -1
  132. /package/dist/{367.js.LICENSE.txt → 822.js.LICENSE.txt} +0 -0
@@ -0,0 +1,321 @@
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 { useLocation, 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 location = useLocation();
17
+ const startDate = searchParams.get('startDate');
18
+ const endDate = searchParams.get('endDate');
19
+ const locationUuids = searchParams.get('locationUuids');
20
+ const indicator = searchParams.get('indicator');
21
+
22
+ function navigateBack() {
23
+ navigate(location.state?.from || '/moh-705b');
24
+ }
25
+
26
+ useEffect(() => {
27
+ const fetchData = async () => {
28
+ if (!startDate || !endDate || !locationUuids || !indicator) return;
29
+
30
+ setIsLoading(true);
31
+
32
+ try {
33
+ const params = {
34
+ startDate,
35
+ endDate,
36
+ locationUuids,
37
+ indicator,
38
+ };
39
+
40
+ const data = await getMoh705aPatientList(params);
41
+ setPatientList(data?.results.results || []);
42
+ } catch (error) {
43
+ console.error('Failed to fetch register data', error);
44
+ } finally {
45
+ setIsLoading(false);
46
+ }
47
+ };
48
+
49
+ fetchData();
50
+ }, [startDate, endDate, locationUuids, indicator]);
51
+
52
+ return (
53
+ <>
54
+ <div className={styles.buttonContainer}>
55
+ <Button onClick={navigateBack}>Back</Button>
56
+ </div>
57
+ <div>{isLoading && <Loading />}</div>
58
+ <div className={styles.tableContainer}>
59
+ <Table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
60
+ <TableHead>
61
+ <TableRow>
62
+ <TableHeader>
63
+ Date <br /> (DD/MM/YYYY)
64
+ </TableHeader>
65
+ <TableHeader>
66
+ OPD No.
67
+ <br />
68
+ (New)
69
+ </TableHeader>
70
+ <TableHeader>
71
+ OPD No.
72
+ <br />
73
+ (Revisit)
74
+ </TableHeader>
75
+ <TableHeader>
76
+ Referred
77
+ <br />
78
+ From 1=CU,
79
+ <br />
80
+ 2=From Other
81
+ <br />
82
+ facility, 3=
83
+ <br />
84
+ Within 4=N/A
85
+ </TableHeader>
86
+ <TableHeader>Full Names (THREE names)</TableHeader>
87
+ <TableHeader>Age</TableHeader>
88
+ <TableHeader>Sex</TableHeader>
89
+ <TableHeader>Countu/Sub-county</TableHeader>
90
+ <TableHeader>
91
+ Village /Estate / <br />
92
+ Landmark
93
+ </TableHeader>
94
+ <TableHeader>
95
+ Parent/Caregivers's
96
+ <br />
97
+ Telephone
98
+ <br />
99
+ No.
100
+ </TableHeader>
101
+ <TableHeader>Weight(kg)</TableHeader>
102
+ <TableHeader>
103
+ Height
104
+ <br />
105
+ /Length
106
+ <br />
107
+ (cm)
108
+ </TableHeader>
109
+ <TableHeader>
110
+ MUAC
111
+ <br />
112
+ 1.Green
113
+ <br />
114
+ 2.Yellow
115
+ <br />
116
+ 3.Red
117
+ </TableHeader>
118
+ <TableHeader>
119
+ Temp
120
+ <br />
121
+ (oC)
122
+ </TableHeader>
123
+ <TableHeader>
124
+ Respiratory
125
+ <br />
126
+ Rate
127
+ </TableHeader>
128
+ <TableHeader>
129
+ Oxygen Saturation
130
+ <br />
131
+ Reading <br />
132
+ (SPO2)
133
+ </TableHeader>
134
+ <TableHeader>
135
+ Pulse
136
+ <br />
137
+ Rate
138
+ </TableHeader>
139
+ <TableHeader>
140
+ DANGER SIGNS
141
+ <br />
142
+ 1.Unable to drink or <br />
143
+ breastfeed
144
+ <br />
145
+ 2.Vomits everything
146
+ <br />
147
+ 3.Had convulsions
148
+ <br />
149
+ in this illness
150
+ <br />
151
+ 4.Is lethargic or <br />
152
+ unconscious
153
+ <br />
154
+ 5.Is convulsing now
155
+ </TableHeader>
156
+ <TableHeader>
157
+ Duration
158
+ <br />
159
+ of Current
160
+ <br />
161
+ Illness
162
+ <br />
163
+ (in hours/
164
+ <br />
165
+ days)
166
+ </TableHeader>
167
+ <TableHeader>
168
+ Malaria
169
+ <br />
170
+ 1.Presenting with symptoms NOT
171
+ <br />
172
+ Tested
173
+ <br />
174
+ 2.RDT Tested (-ve)
175
+ <br />
176
+ 3.Microscopy
177
+ <br />
178
+ Tested (-ve)
179
+ <br />
180
+ 4.RDT Tested (+ve)
181
+ <br />
182
+ 5. Microscopy
183
+ <br />
184
+ Tested (+ve)
185
+ </TableHeader>
186
+ <TableHeader>
187
+ IMNCI Classification or <br />
188
+ Diagnosis
189
+ </TableHeader>
190
+ <TableHeader>
191
+ TRACER DRUGS <br />
192
+ PRESCRIBED
193
+ <br />
194
+ 1. ORS & Zinc <br />
195
+ (Co-pack)
196
+ <br />
197
+ 2.Zinc Only
198
+ <br />
199
+ 3. ORS Only 4.
200
+ <br />
201
+ Amoxicillin DT
202
+ <br />
203
+ 5. Vitamin A <br />
204
+ 6.Oxygen <br />
205
+ 7. Albendazole <br />
206
+ 8.IV Fluids
207
+ </TableHeader>
208
+ <TableHeader>
209
+ Other <br />
210
+ ALL <br />
211
+ Treatments <br />
212
+ Prescribed 1. <br />
213
+ CPAP 2.
214
+ <br />
215
+ Other
216
+ </TableHeader>
217
+ <TableHeader>
218
+ Immunization
219
+ <br />
220
+ Status Up to <br />
221
+ Date (Y/N)
222
+ </TableHeader>
223
+ <TableHeader>
224
+ TB Screening 1. <br />
225
+ presumed TB 2. <br />
226
+ Referred
227
+ </TableHeader>
228
+ <TableHeader>
229
+ Nutrition and diatetics <br />
230
+ Interventions 1=Nutrition
231
+ <br />
232
+ counselling 2=Nutrition
233
+ <br />
234
+ therapeutic supplements 3<br />
235
+ =. Diatetics
236
+ </TableHeader>
237
+ <TableHeader>
238
+ Referred to (1=CU, 2= to <br />
239
+ other H/F, 3=within the <br />
240
+ facility/ 4=N/A)
241
+ </TableHeader>
242
+ <TableHeader>REMARKS/ Outcome</TableHeader>
243
+ </TableRow>
244
+ <TableRow>
245
+ <TableHeader>A</TableHeader>
246
+ <TableHeader>B</TableHeader>
247
+ <TableHeader>C</TableHeader>
248
+ <TableHeader>D</TableHeader>
249
+ <TableHeader>E</TableHeader>
250
+ <TableHeader>F</TableHeader>
251
+ <TableHeader>G</TableHeader>
252
+ <TableHeader>H</TableHeader>
253
+ <TableHeader>I</TableHeader>
254
+ <TableHeader>J</TableHeader>
255
+ <TableHeader>K</TableHeader>
256
+ <TableHeader>L</TableHeader>
257
+ <TableHeader>M</TableHeader>
258
+ <TableHeader>N</TableHeader>
259
+ <TableHeader>O</TableHeader>
260
+ <TableHeader>P</TableHeader>
261
+ <TableHeader>Q</TableHeader>
262
+ <TableHeader>R</TableHeader>
263
+ <TableHeader>S</TableHeader>
264
+ <TableHeader>T</TableHeader>
265
+ <TableHeader>U</TableHeader>
266
+ <TableHeader>V</TableHeader>
267
+ <TableHeader>W</TableHeader>
268
+ <TableHeader>X</TableHeader>
269
+ <TableHeader>Y</TableHeader>
270
+ <TableHeader>Z</TableHeader>
271
+ <TableHeader>AA</TableHeader>
272
+ <TableHeader>AB</TableHeader>
273
+ </TableRow>
274
+ </TableHead>
275
+ <TableBody>
276
+ {patientlist?.length > 0 ? (
277
+ patientlist?.map((patient) => (
278
+ <TableRow key={patient.person_id || patient.id}>
279
+ <TableCell>{patient.date}</TableCell>
280
+ <TableCell>{patient.opd_number_new_visit}</TableCell>
281
+ <TableCell>{patient.opd_number_return_visit}</TableCell>
282
+ <TableCell>{patient.referred_from}</TableCell>
283
+ <TableCell>{patient.full_names}</TableCell>
284
+ <TableCell>{patient.age}</TableCell>
285
+ <TableCell>{patient.sex}</TableCell>
286
+ <TableCell>{patient.county_sub_county}</TableCell>
287
+ <TableCell>{patient.village_estate_landmark}</TableCell>
288
+ <TableCell>{patient.caregiver_phone_number}</TableCell>
289
+ <TableCell>{patient.weight}</TableCell>
290
+ <TableCell>{patient.height}</TableCell>
291
+ <TableCell>{patient.muac}</TableCell>
292
+ <TableCell>{patient.temp}</TableCell>
293
+ <TableCell>{patient.respiratory_rate}</TableCell>
294
+ <TableCell>{patient.oxygen_saturation}</TableCell>
295
+ <TableCell>{patient.pulse_rate}</TableCell>
296
+ <TableCell>{patient.danger_signs}</TableCell>
297
+ <TableCell>{patient.duration_of_illness}</TableCell>
298
+ <TableCell>{patient.suspected_malaria_cases}</TableCell>
299
+ <TableCell>{patient.diagnosis}</TableCell>
300
+ <TableCell>{patient.tracer_drugs_prescribed}</TableCell>
301
+ <TableCell>{patient.all_other_treatments_prescribed}</TableCell>
302
+ <TableCell>{patient.immunization_status_up_to_date}</TableCell>
303
+ <TableCell>{patient.tb_screening}</TableCell>
304
+ <TableCell>{patient.nutrition_dietetics}</TableCell>
305
+ <TableCell>{patient.referred_to}</TableCell>
306
+ <TableCell>{patient.remarks}</TableCell>
307
+ </TableRow>
308
+ ))
309
+ ) : (
310
+ <TableRow>
311
+ <TableCell colSpan={28}>No data available</TableCell>
312
+ </TableRow>
313
+ )}
314
+ </TableBody>
315
+ </Table>
316
+ </div>
317
+ </>
318
+ );
319
+ };
320
+
321
+ export default Moh204ARegisterComponent;
@@ -0,0 +1,6 @@
1
+ export type ReportFilters = {
2
+ startDate?: string;
3
+ endDate?: string;
4
+ month?: string;
5
+ indicator?: string;
6
+ };
@@ -0,0 +1,61 @@
1
+ import React, { useMemo } from "react";
2
+ import TableWrapper from "../table-wrapper/table-wrapper.component";
3
+ import TableRowMapper from "../table-wrapper/table-row-mapper.component";
4
+ import { getCell } from "../../utils/utils";
5
+ import styles from './moh-706.scss';
6
+
7
+ const MOH706Header: React.FC = () => {
8
+ const tableRows = useMemo(() => {
9
+ return [
10
+ {
11
+ tableCells: [
12
+ getCell("", "County:", 1, 1, true),
13
+ getCell("", "", 3),
14
+ ],
15
+ },
16
+ {
17
+ tableCells: [
18
+ getCell("", "Sub-County:", 1, 1, true),
19
+ getCell("", "", 3),
20
+ ],
21
+ },
22
+ {
23
+ tableCells: [
24
+ getCell("", "Health Facility:", 1, 1, true),
25
+ getCell("", "", 3),
26
+ ],
27
+ },
28
+ {
29
+ tableCells: [
30
+ getCell("", "KMHFL Code:", 1, 1, true),
31
+ getCell("", "", 3),
32
+ ],
33
+ },
34
+ {
35
+ tableCells: [
36
+ getCell("", "Facility Type:", 1, 1, true),
37
+ getCell("", ""),
38
+ getCell("", "Man. Agency:", 1, 1, true),
39
+ getCell("", ""),
40
+ ],
41
+ },
42
+ {
43
+ tableCells: [
44
+ getCell("", "Start Date:", 1, 1, true),
45
+ getCell("", ""),
46
+ getCell("", "End Date:", 1, 1, true),
47
+ getCell("", ""),
48
+ ],
49
+ },
50
+ ];
51
+ }, []);
52
+
53
+ return <div className={styles.headerSection}>
54
+ <h3>MOH 706 _Laboratory (LAB) Services Summary</h3>
55
+ <TableWrapper>
56
+ <TableRowMapper tableRows={tableRows} />
57
+ </TableWrapper>
58
+ </div>
59
+ }
60
+
61
+ export default MOH706Header;
@@ -0,0 +1,117 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useSession } from '@openmrs/esm-framework';
3
+ import { Column, Grid, Loading } from '@carbon/react';
4
+ import UrineAnalysis from './sub-reports/urine-analysis/urine-analysis.component';
5
+ import BloodChemistry from './sub-reports/blood-chemistry/blood-chemistry.component';
6
+ import Parasitology from './sub-reports/parasitology/parasitology.component';
7
+ import Haematology from './sub-reports/haematology/haematology.component';
8
+ import Bacteriology from './sub-reports/bacteriology/bacteriology.component';
9
+ import HistologyAndCytology from './sub-reports/histology-and-cytology/histology-and-cytology.component';
10
+ import Serology from './sub-reports/serology/serology.component';
11
+ import SpecimenReferralToHigherLevels from './sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component';
12
+ import DrugSusceptibilityTesting from './sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component';
13
+ import ReportFiltersComponent from '../../common/report-filters/report-filters.component';
14
+ import { getMoh706 } from '../../resources/moh-706.resource';
15
+ import styles from './moh-706.scss';
16
+ import MOH706Header from './moh-706-header.component';
17
+ import { useSearchParams } from 'react-router-dom';
18
+
19
+ const MoH706Report: React.FC = () => {
20
+ const [moh706Data, setMoh706Data] = useState<any>({});
21
+ const [isLoading, setIsLoading] = useState<boolean>(false);
22
+ const [errorMessage, setErrorMessage] = useState<string>('');
23
+ const [filters, setFilters] = useState<{ locationUuids?: string; startDate?: string; endDate?: string }>({});
24
+
25
+ const session = useSession();
26
+ const locationUuids = session?.sessionLocation?.uuid;
27
+
28
+ const [searchParams] = useSearchParams();
29
+
30
+ useEffect(() => {
31
+ const startDate = searchParams.get('startDate');
32
+ const endDate = searchParams.get('endDate');
33
+
34
+ if (startDate && endDate) {
35
+ setFilters({ locationUuids, startDate, endDate });
36
+ fetchMoh706Data({ startDate, endDate });
37
+ }
38
+ }, [searchParams]);
39
+
40
+ const fetchMoh706Data = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
41
+ setErrorMessage('');
42
+ setIsLoading(true);
43
+
44
+ let startDate = filters.startDate;
45
+ let endDate = filters.endDate;
46
+
47
+ if (filters.month) {
48
+ const [year, monthIndex] = filters.month.split('-').map(Number);
49
+ const start = new Date(year, monthIndex - 1, 1);
50
+ const end = new Date(year, monthIndex, 0);
51
+
52
+ const formatLocalDate = (d: Date) => {
53
+ const y = d.getFullYear();
54
+ const m = String(d.getMonth() + 1).padStart(2, '0');
55
+ const day = String(d.getDate()).padStart(2, '0');
56
+ return `${y}-${m}-${day}`;
57
+ };
58
+
59
+ startDate = formatLocalDate(start);
60
+ endDate = formatLocalDate(end);
61
+ }
62
+
63
+ const params = {
64
+ locationUuids: locationUuids || '',
65
+ startDate,
66
+ endDate,
67
+ };
68
+
69
+ try {
70
+ const result = await getMoh706(params);
71
+ const flatData = Object.assign({}, ...result);
72
+ setMoh706Data(flatData);
73
+ setFilters({ locationUuids: params.locationUuids, startDate, endDate });
74
+ } catch (error: any) {
75
+ setErrorMessage(error instanceof Error ? error.message : String(error));
76
+ } finally {
77
+ setIsLoading(false);
78
+ }
79
+ };
80
+
81
+ return (
82
+ <>
83
+ <ReportFiltersComponent reportName="MOH-706 Report" mode="monthly" onGenerate={fetchMoh706Data} isLoding={isLoading} />
84
+ {isLoading && <Loading description="Fetching data...." />}
85
+ {!isLoading && errorMessage && (
86
+ <div>
87
+ <a href="#" className="close" data-dismiss="alert">
88
+ &times;
89
+ </a>
90
+ <h4>
91
+ <strong>
92
+ <span className="glyphicon glyphicon-warning-sign"></span>{' '}
93
+ </strong>{' '}
94
+ An error occurred while trying to load the report. Please try again.
95
+ </h4>
96
+ <p>
97
+ <small>{errorMessage}</small>
98
+ </p>
99
+ </div>
100
+ )}
101
+ <MOH706Header />
102
+ <div className={styles.reportSections}>
103
+ <UrineAnalysis data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
104
+ <BloodChemistry data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
105
+ <Parasitology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
106
+ <Haematology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
107
+ <Bacteriology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
108
+ <HistologyAndCytology />
109
+ <Serology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
110
+ <SpecimenReferralToHigherLevels />
111
+ <DrugSusceptibilityTesting />
112
+ </div>
113
+ </>
114
+ );
115
+ };
116
+
117
+ export default MoH706Report;
@@ -0,0 +1,30 @@
1
+ .tableWrapper {
2
+ overflow-x: auto;
3
+ border: 1px solid #d0d0d0;
4
+ border-radius: 4px;
5
+ }
6
+
7
+ .tableContainer {
8
+ width: 100%;
9
+ border-collapse: collapse;
10
+
11
+ thead {
12
+ background-color: #f4f4f4;
13
+ }
14
+
15
+ tbody tr {
16
+ border-bottom: 1px solid #e0e0e0;
17
+ }
18
+
19
+ }
20
+
21
+ .reportSections {
22
+ position: relative;
23
+ margin: 0px auto;
24
+ width: 100%;
25
+ padding: 12px;
26
+ }
27
+
28
+ .headerSection {
29
+ padding: 15px;
30
+ }
@@ -0,0 +1,124 @@
1
+ import React, { useMemo } from "react";
2
+ import TableWrapper from "../../../table-wrapper/table-wrapper.component";
3
+ import TableRowMapper from "../../../table-wrapper/table-row-mapper.component";
4
+ import { getCell } from "../../../../utils/utils";
5
+
6
+ interface BacteriologyProps {
7
+ data?: any,
8
+ locationUuids?: string,
9
+ startDate?: string,
10
+ endDate?: string
11
+ }
12
+
13
+ const Bacteriology: React.FC<BacteriologyProps> = ({ data, locationUuids, startDate, endDate }) => {
14
+ const tableRows = useMemo(() => {
15
+ return [
16
+ {
17
+ tableCells: [getCell("", "5 BACTERIOLOGY", 4, 1, true)]
18
+ },
19
+ {
20
+ tableCells: [
21
+ getCell("", "Bacteriological Sample", 1, 1, true),
22
+ getCell("", "Total Exam", 1, 1, true),
23
+ getCell("", "Total Cultures", 1, 1, true),
24
+ getCell("", "Number Culture Positive", 1, 1, true),
25
+ ]
26
+ },
27
+ { tableCells: [getCell("", "5.1 Urine"), getCell(), getCell(), getCell()] },
28
+ { tableCells: [getCell("", "5.2 Pus swabs"), getCell(), getCell(), getCell()] },
29
+ { tableCells: [getCell("", "5.3 High Vaginal Swabs"), getCell(), getCell(), getCell()] },
30
+ { tableCells: [getCell("", "5.4 Throat swab"), getCell(), getCell(), getCell()] },
31
+ { tableCells: [getCell("", "5.5 Rectal swab"), getCell(), getCell(), getCell()] },
32
+ { tableCells: [getCell("", "5.6 Blood"), getCell(), getCell(), getCell()] },
33
+ { tableCells: [getCell("", "5.7 Water"), getCell(), getCell(), getCell()] },
34
+ { tableCells: [getCell("", "5.8 Food"), getCell(), getCell(), getCell()] },
35
+ { tableCells: [getCell("", "5.9 Urethral swabs"), getCell(), getCell(), getCell()] },
36
+ {
37
+ tableCells: [
38
+ getCell("", "Bacterial enteric pathogens", 2, 1, true),
39
+ getCell("", "Total Exam", 1, 1, true),
40
+ getCell("", "Number Positive", 1, 1, true),
41
+ ]
42
+ },
43
+ {
44
+ tableCells: [
45
+ getCell("", "5.10 Stool Cultures", 2),
46
+ getCell(),
47
+ getCell(),
48
+ ]
49
+ },
50
+ {
51
+ tableCells: [
52
+ getCell("", "Stool Isolates", 3, 1, true),
53
+ getCell("", "Number Positive", 1, 1, true),
54
+ ]
55
+ },
56
+ { tableCells: [getCell("", "5.11 Salmonella typhi", 3), getCell("positive_salmonella")] },
57
+ { tableCells: [getCell("", "5.12 Shigella - dysenteriae type1", 3), getCell()] },
58
+ { tableCells: [getCell("", "5.13 E. coli O157:H7", 3), getCell()] },
59
+ { tableCells: [getCell("", "5.14 V. cholerae O1", 3), getCell()] },
60
+ { tableCells: [getCell("", "5.15 V. cholerae O139", 3), getCell()] },
61
+
62
+ {
63
+ tableCells: [getCell("", "Bacterial meningitis", 4, 1, true)]
64
+ },
65
+ {
66
+ tableCells: [
67
+ getCell("", "Bacterial meningitis", 1, 1, true),
68
+ getCell("", "Total Exam", 1, 1, true),
69
+ getCell("", "Number Positive", 1, 1, true),
70
+ getCell("", "Number Contaminated", 2, 1, true),
71
+ ]
72
+ },
73
+ {
74
+ tableCells: [
75
+ getCell("", "5.16 CSF"),
76
+ getCell(),
77
+ getCell(),
78
+ getCell(),
79
+ ]
80
+ },
81
+ {
82
+ tableCells: [
83
+ getCell("", "Bacterial meningitis Serotypes", 1, 1, true),
84
+ getCell("", "Number Positive", 3, 1, true),
85
+ ]
86
+ },
87
+ { tableCells: [getCell("", "5.17 Neisseria meningitidis A"), getCell("", "", 3)] },
88
+ { tableCells: [getCell("", "5.18 Neisseria meningitidis B"), getCell("", "", 3)] },
89
+ { tableCells: [getCell("", "5.19 Neisseria meningitidis C"), getCell("", "", 3)] },
90
+ { tableCells: [getCell("", "5.20 Neisseria meningitidis W135"), getCell("", "", 3)] },
91
+ { tableCells: [getCell("", "5.21 Neisseria meningitidis X"), getCell("", "", 3)] },
92
+ { tableCells: [getCell("", "5.22 Neisseria meningitidis Y"), getCell("", "", 3)] },
93
+ { tableCells: [getCell("", "5.23 Neisseria meningitidis (indeterminate)"), getCell("", "", 3)] },
94
+ { tableCells: [getCell("", "5.24 Streptococcus pneumoniae"), getCell("", "", 3)] },
95
+ { tableCells: [getCell("", "5.25 Haemophilus influenzae (type b)"), getCell("", "", 3)] },
96
+ { tableCells: [getCell("", "5.26 Cryptococcal Meningitis"), getCell("", "", 3)] },
97
+ {
98
+ tableCells: [getCell("", "Bacterial Pathogens from other types of specimen", 4, 1, true)]
99
+ },
100
+ { tableCells: [getCell("", "5.27 B. anthracis"), getCell("", "", 3)] },
101
+ { tableCells: [getCell("", "5.28 Y. pestis"), getCell("", "", 3)] },
102
+ { tableCells: [getCell("", "TB SPUTUM", 4)] },
103
+ {
104
+ tableCells: [
105
+ getCell("", "TB SPUTUM", 1, 1, true),
106
+ getCell("", "Total Exam", 1, 1, true),
107
+ getCell("", "Number Positive", 1, 1, true),
108
+ ]
109
+ },
110
+ { tableCells: [getCell("", "5.29 Total TB smears"), getCell(), getCell()] },
111
+ { tableCells: [getCell("", "5.30 New presumptive TB cases"), getCell(), getCell()] },
112
+ { tableCells: [getCell("", "5.31 TB Follow up"), getCell(), getCell()] },
113
+ { tableCells: [getCell("", "5.32 Rifampicin Resistant TB"), getCell(), getCell()] },
114
+ { tableCells: [getCell("", "5.33 MDR TB"), getCell(), getCell()] },
115
+ ]
116
+ }, []);
117
+
118
+
119
+ return <TableWrapper>
120
+ <TableRowMapper tableRows={tableRows} data={data} locationUuids={locationUuids} startDate={startDate} endDate={endDate} />
121
+ </TableWrapper>
122
+ }
123
+
124
+ export default Bacteriology;