@ampath/esm-reports-app 1.0.0-next.3 → 1.0.0-next.30

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 (140) hide show
  1. package/dist/138.js +2 -0
  2. package/dist/138.js.LICENSE.txt +20 -0
  3. package/dist/138.js.map +1 -0
  4. package/dist/184.js +1 -1
  5. package/dist/184.js.map +1 -1
  6. package/dist/205.js +1 -0
  7. package/dist/205.js.map +1 -0
  8. package/dist/282.js +1 -1
  9. package/dist/282.js.LICENSE.txt +3 -3
  10. package/dist/282.js.map +1 -1
  11. package/dist/311.js +1 -0
  12. package/dist/311.js.map +1 -0
  13. package/dist/353.js +1 -2
  14. package/dist/353.js.map +1 -1
  15. package/dist/478.js +2 -0
  16. package/dist/478.js.LICENSE.txt +9 -0
  17. package/dist/478.js.map +1 -0
  18. package/dist/540.js +1 -1
  19. package/dist/540.js.map +1 -1
  20. package/dist/645.js +1 -0
  21. package/dist/645.js.map +1 -0
  22. package/dist/812.js +1 -0
  23. package/dist/812.js.map +1 -0
  24. package/dist/961.js +1 -1
  25. package/dist/961.js.map +1 -1
  26. package/dist/ampath-esm-reports-app.js +1 -1
  27. package/dist/ampath-esm-reports-app.js.buildmanifest.json +174 -99
  28. package/dist/ampath-esm-reports-app.js.map +1 -1
  29. package/dist/main.js +1 -1
  30. package/dist/main.js.map +1 -1
  31. package/dist/routes.json +1 -1
  32. package/package.json +2 -1
  33. package/src/common/report-filters/report-filters.component.tsx +127 -0
  34. package/src/common/report-filters/report-filters.scss +49 -0
  35. package/src/dashboard/reports-dasboard.tsx +38 -1
  36. package/src/dashboard/reports-dashboard.module.scss +14 -0
  37. package/src/index.ts +1 -1
  38. package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +54 -0
  39. package/src/reports/moh-240/moh-240-header.component.tsx +61 -0
  40. package/src/reports/moh-240/moh-240.component.tsx +68 -0
  41. package/src/reports/moh-240/moh-240.scss +3 -0
  42. package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +72 -0
  43. package/src/reports/moh-240/sub-reports/page-summary.component.tsx +95 -0
  44. package/src/reports/moh-505/moh-505-header.component.tsx +62 -0
  45. package/src/reports/moh-505/moh-505.component.tsx +240 -0
  46. package/src/reports/moh-505/moh-505.scss +3 -0
  47. package/src/reports/moh-705B/moh-204b-register.component.tsx +235 -0
  48. package/src/reports/moh-705B/moh-705b.component.tsx +524 -0
  49. package/src/reports/moh-705B/moh-705b.scss +44 -0
  50. package/src/reports/moh-705a/moh-705a.component.tsx +528 -0
  51. package/src/reports/moh-705a/moh-705a.scss +45 -0
  52. package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +320 -0
  53. package/src/reports/moh-705a/type.ts +6 -0
  54. package/src/reports/moh-706/moh-706-header.component.tsx +61 -0
  55. package/src/reports/moh-706/moh-706.component.tsx +104 -0
  56. package/src/reports/moh-706/moh-706.scss +30 -0
  57. package/src/reports/moh-706/sub-reports/bacteriology/bacteriology.component.tsx +124 -0
  58. package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +318 -0
  59. package/src/reports/moh-706/sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component.tsx +137 -0
  60. package/src/reports/moh-706/sub-reports/haematology/haematology.component.tsx +179 -0
  61. package/src/reports/moh-706/sub-reports/histology-and-cytology/histology-and-cytology.component.tsx +88 -0
  62. package/src/reports/moh-706/sub-reports/parasitology/parasitology.component.tsx +121 -0
  63. package/src/reports/moh-706/sub-reports/serology/serology.component.tsx +47 -0
  64. package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +39 -0
  65. package/src/reports/moh-706/sub-reports/urine-analysis/urine-analysis.component.tsx +108 -0
  66. package/src/reports/moh-710/moh-710.component.tsx +665 -0
  67. package/src/reports/moh-710/moh-710.scss +45 -0
  68. package/src/reports/moh-710/patient-list/moh-710-patient-list.component.tsx +13 -0
  69. package/src/reports/moh-711/moh-711.component.tsx +139 -0
  70. package/src/reports/moh-711/moh711.scss +82 -0
  71. package/src/reports/moh-711/registers/moh-333-register.component.tsx +636 -0
  72. package/src/reports/moh-711/registers/moh-405-register.component.tsx +518 -0
  73. package/src/reports/moh-711/registers/moh-406-register.component.tsx +530 -0
  74. package/src/reports/moh-711/registers/moh-510-register.component.tsx +61 -0
  75. package/src/reports/moh-711/registers/moh-511-register.component.tsx +263 -0
  76. package/src/reports/moh-711/registers/type.ts +194 -0
  77. package/src/reports/moh-711/sections/anc.component.tsx +153 -0
  78. package/src/reports/moh-711/sections/cervical-cancer.component.tsx +104 -0
  79. package/src/reports/moh-711/sections/chanis.component.tsx +367 -0
  80. package/src/reports/moh-711/sections/family-planning.component.tsx +221 -0
  81. package/src/reports/moh-711/sections/gbv.component.tsx +115 -0
  82. package/src/reports/moh-711/sections/maternity.component.tsx +319 -0
  83. package/src/reports/moh-711/sections/medical-social-work.component.tsx +83 -0
  84. package/src/reports/moh-711/sections/other.component.tsx +47 -0
  85. package/src/reports/moh-711/sections/physiotherapy.component.tsx +61 -0
  86. package/src/reports/moh-711/sections/pnc.component.tsx +118 -0
  87. package/src/reports/moh-711/sections/post-abortion.component.tsx +42 -0
  88. package/src/reports/moh-711/sections/rehabilitation.component.tsx +57 -0
  89. package/src/reports/moh-711/sections/report-compiled-by.component.tsx +42 -0
  90. package/src/reports/moh-711/sections/tb-screening.component.tsx +57 -0
  91. package/src/reports/moh-717/moh-717.component.tsx +170 -0
  92. package/src/reports/moh-717/moh717.scss +154 -0
  93. package/src/reports/moh-717/sections/finance.component.tsx +42 -0
  94. package/src/reports/moh-717/sections/inpatient.component.tsx +374 -0
  95. package/src/reports/moh-717/sections/maternity.component.tsx +119 -0
  96. package/src/reports/moh-717/sections/medical-records.component.tsx +35 -0
  97. package/src/reports/moh-717/sections/mortuary.component.tsx +43 -0
  98. package/src/reports/moh-717/sections/operations.component.tsx +53 -0
  99. package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +98 -0
  100. package/src/reports/moh-717/sections/outpatient.component.tsx +489 -0
  101. package/src/reports/moh-717/sections/pharmacy.component.tsx +43 -0
  102. package/src/reports/moh-717/sections/preparedby.component.tsx +47 -0
  103. package/src/reports/moh-717/sections/special-services.component.tsx +114 -0
  104. package/src/reports/moh-740/moh-740.component.scss +120 -0
  105. package/src/reports/moh-740/moh-740.component.tsx +1263 -0
  106. package/src/reports/moh-740/moh-740.resource.ts +42 -0
  107. package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +6 -0
  108. package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.scss +18 -0
  109. package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +79 -0
  110. package/src/reports/moh-740/registers/moh-740-patient-list.scss +0 -0
  111. package/src/reports/moh-740/registers/moh-740-patient-list.tsx +43 -0
  112. package/src/reports/moh-740/shared/data-cell/data-cell.scss +6 -0
  113. package/src/reports/moh-740/shared/data-cell/data-cell.tsx +23 -0
  114. package/src/reports/moh-740/shared/utils/format-indicator.ts +22 -0
  115. package/src/reports/moh-740/types/index.ts +183 -0
  116. package/src/reports/moh-745/moh-745.component.tsx +928 -0
  117. package/src/reports/moh-745/moh-745.scss +74 -0
  118. package/src/reports/moh-745/registers/moh-412-register.component.tsx +191 -0
  119. package/src/reports/moh-745/registers/type.ts +29 -0
  120. package/src/reports/table-wrapper/table-row-mapper.component.tsx +51 -0
  121. package/src/reports/table-wrapper/table-wrapper.component.tsx +21 -0
  122. package/src/reports/table-wrapper/table-wrapper.scss +31 -0
  123. package/src/resources/moh-705.resource.ts +117 -0
  124. package/src/resources/moh-706.resource.ts +86 -0
  125. package/src/resources/moh-710.resource.ts +60 -0
  126. package/src/resources/moh-711.resource.ts +175 -0
  127. package/src/resources/moh-717.resource.ts +35 -0
  128. package/src/resources/moh-745.resource.ts +64 -0
  129. package/src/root.component.tsx +38 -0
  130. package/src/utils/get-base-url.ts +12 -0
  131. package/src/utils/utils.ts +36 -0
  132. package/dist/255.js +0 -1
  133. package/dist/255.js.map +0 -1
  134. package/dist/353.js.LICENSE.txt +0 -39
  135. package/dist/36.js +0 -1
  136. package/dist/36.js.map +0 -1
  137. package/dist/734.js +0 -1
  138. package/dist/734.js.map +0 -1
  139. package/dist/97.js +0 -1
  140. package/dist/97.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
+ };
@@ -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,104 @@
1
+ import React, { 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
+
18
+ const MoH706Report: React.FC = () => {
19
+ const [moh706Data, setMoh706Data] = useState<any>({});
20
+ const [isLoading, setIsLoading] = useState<boolean>(false);
21
+ const [errorMessage, setErrorMessage] = useState<string>('');
22
+ const [filters, setFilters] = useState<{ locationUuids?: string; startDate?: string; endDate?: string }>({});
23
+
24
+ const session = useSession();
25
+ const locationUuids = session?.sessionLocation?.uuid;
26
+
27
+ const fetchMoh706Data = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
28
+ setErrorMessage('');
29
+ setIsLoading(true);
30
+
31
+ let startDate = filters.startDate;
32
+ let endDate = filters.endDate;
33
+
34
+ if (filters.month) {
35
+ const [year, monthIndex] = filters.month.split('-').map(Number);
36
+ const start = new Date(year, monthIndex - 1, 1);
37
+ const end = new Date(year, monthIndex, 0);
38
+
39
+ const formatLocalDate = (d: Date) => {
40
+ const y = d.getFullYear();
41
+ const m = String(d.getMonth() + 1).padStart(2, '0');
42
+ const day = String(d.getDate()).padStart(2, '0');
43
+ return `${y}-${m}-${day}`;
44
+ };
45
+
46
+ startDate = formatLocalDate(start);
47
+ endDate = formatLocalDate(end);
48
+ }
49
+
50
+ const params = {
51
+ locationUuids: locationUuids || '',
52
+ startDate,
53
+ endDate,
54
+ };
55
+
56
+ try {
57
+ const result = await getMoh706(params);
58
+ const flatData = Object.assign({}, ...result);
59
+ setMoh706Data(flatData);
60
+ setFilters({ locationUuids: params.locationUuids, startDate, endDate });
61
+ } catch (error: any) {
62
+ setErrorMessage(error instanceof Error ? error.message : String(error));
63
+ } finally {
64
+ setIsLoading(false);
65
+ }
66
+ };
67
+
68
+ return (
69
+ <>
70
+ <ReportFiltersComponent reportName="MOH-706 Report" mode="monthly" onGenerate={fetchMoh706Data} isLoding={isLoading} />
71
+ {isLoading && <Loading description="Fetching data...." />}
72
+ {!isLoading && errorMessage && (
73
+ <div>
74
+ <a href="#" className="close" data-dismiss="alert">
75
+ &times;
76
+ </a>
77
+ <h4>
78
+ <strong>
79
+ <span className="glyphicon glyphicon-warning-sign"></span>{' '}
80
+ </strong>{' '}
81
+ An error occurred while trying to load the report. Please try again.
82
+ </h4>
83
+ <p>
84
+ <small>{errorMessage}</small>
85
+ </p>
86
+ </div>
87
+ )}
88
+ <MOH706Header />
89
+ <div className={styles.reportSections}>
90
+ <UrineAnalysis data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
91
+ <BloodChemistry data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
92
+ <Parasitology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
93
+ <Haematology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
94
+ <Bacteriology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
95
+ <HistologyAndCytology />
96
+ <Serology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
97
+ <SpecimenReferralToHigherLevels />
98
+ <DrugSusceptibilityTesting />
99
+ </div>
100
+ </>
101
+ );
102
+ };
103
+
104
+ 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: 70%;
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;