@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
@@ -2,12 +2,23 @@ import React from 'react';
2
2
 
3
3
  import styles from '../moh711.scss';
4
4
  import classNames from 'classnames';
5
+ import { useNavigate } from 'react-router-dom';
5
6
 
6
7
  interface MaternityComponentProps {
7
8
  moh711Data: any;
9
+ startDate: string;
10
+ endDate: string;
11
+ locationUuids: string;
8
12
  }
9
13
 
10
- const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data }) => {
14
+ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data, startDate, endDate, locationUuids }) => {
15
+ const navigate = useNavigate();
16
+ const navigateToRegister = (indicator: string) => {
17
+ navigate(
18
+ `/moh-333-register?startDate=${startDate}&endDate=${endDate}&locationUuids=${locationUuids}&indicator=${indicator}`,
19
+ );
20
+ };
21
+
11
22
  return (
12
23
  <>
13
24
  <table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
@@ -21,22 +32,24 @@ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data }) =
21
32
  <tr>
22
33
  <td>1</td>
23
34
  <td colSpan={2}>Normal Deliveries</td>
24
- <td>{moh711Data.normal_deliveries}</td>
35
+ <td onClick={() => navigateToRegister('normal_deliveries')}>{moh711Data.normal_deliveries}</td>
25
36
  </tr>
26
37
  <tr>
27
38
  <td>2</td>
28
39
  <td colSpan={2}>Caesarean Sections</td>
29
- <td>{moh711Data.caesarian_sections}</td>
40
+ <td onClick={() => navigateToRegister('caesarian_sections')}>{moh711Data.caesarian_sections}</td>
30
41
  </tr>
31
42
  <tr>
32
43
  <td>3</td>
33
44
  <td colSpan={2}>Breach Delivery</td>
34
- <td>{moh711Data.breach_delivery}</td>
45
+ <td onClick={() => navigateToRegister('breach_delivery')}>{moh711Data.breach_delivery}</td>
35
46
  </tr>
36
47
  <tr>
37
48
  <td>4</td>
38
49
  <td colSpan={2}>Assisted Vaginal Deliveries(Vacuum Extraction)</td>
39
- <td>{moh711Data.assisted_vaginal_delivery}</td>
50
+ <td onClick={() => navigateToRegister('assisted_vaginal_delivery')}>
51
+ {moh711Data.assisted_vaginal_delivery}
52
+ </td>
40
53
  </tr>
41
54
  <tr>
42
55
  <td></td>
@@ -56,119 +69,137 @@ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data }) =
56
69
  <td rowSpan={2}>5</td>
57
70
  <td rowSpan={2}>No. of mothers given uterotonics within 1 minute</td>
58
71
  <td>Oxytocin</td>
59
- <td>{moh711Data.oxytocin_uterotonic}</td>
72
+ <td onClick={() => navigateToRegister('oxytocin_uterotonic')}>{moh711Data.oxytocin_uterotonic}</td>
60
73
  </tr>
61
74
  <tr>
62
75
  <td>Carbatosin</td>
63
- <td>{moh711Data.carbatocin_uterotonic}</td>
76
+ <td onClick={() => navigateToRegister('carbatocin_uterotonic')}>{moh711Data.carbatocin_uterotonic}</td>
64
77
  </tr>
65
78
  <tr>
66
79
  <td>6</td>
67
80
  <td colSpan={2}>Live Births</td>
68
- <td>{moh711Data.live_birth}</td>
81
+ <td onClick={() => navigateToRegister('live_birth')}>{moh711Data.live_birth}</td>
69
82
  </tr>
70
83
  <tr>
71
84
  <td>7</td>
72
85
  <td colSpan={2}>No. of Low Birth Weight Babies (below 2500gms)</td>
73
- <td>{moh711Data.low_birth_weight}</td>
86
+ <td onClick={() => navigateToRegister('low_birth_weight')}>{moh711Data.low_birth_weight}</td>
74
87
  </tr>
75
88
  <tr>
76
89
  <td>8</td>
77
90
  <td colSpan={2}>
78
91
  No. of Low APGAR Score(<strong>&le; 6 at 5 Min</strong>)
79
92
  </td>
80
- <td>{moh711Data.low_apgar_score}</td>
93
+ <td onClick={() => navigateToRegister('low_apgar_score')}>{moh711Data.low_apgar_score}</td>
81
94
  </tr>
82
95
  <tr>
83
96
  <td>9</td>
84
97
  <td colSpan={2}>No. of Birth with diformities</td>
85
- <td>{moh711Data.birth_with_deformity}</td>
98
+ <td onClick={() => navigateToRegister('birth_with_deformity')}>{moh711Data.birth_with_deformity}</td>
86
99
  </tr>
87
100
  <tr>
88
101
  <td>10</td>
89
102
  <td colSpan={2}>No. of Babies applied chlorhexidine for cord care</td>
90
- <td>{moh711Data.chlorhexidine_applied}</td>
103
+ <td onClick={() => navigateToRegister('chlorhexidine_applied')}>{moh711Data.chlorhexidine_applied}</td>
91
104
  </tr>
92
105
  <tr>
93
106
  <td>11</td>
94
107
  <td colSpan={2}>No. of Neonates given Vit "K"</td>
95
- <td>{moh711Data.vitamin_k}</td>
108
+ <td onClick={() => navigateToRegister('vitamin_k')}>{moh711Data.vitamin_k}</td>
96
109
  </tr>
97
110
  <tr>
98
111
  <td>12</td>
99
112
  <td colSpan={2}>No. of Babies given tetracycline at birth</td>
100
- <td>{moh711Data.tetracycline_given}</td>
113
+ <td onClick={() => navigateToRegister('tetracycline_given')}>{moh711Data.tetracycline_given}</td>
101
114
  </tr>
102
115
  <tr>
103
116
  <td>13</td>
104
117
  <td colSpan={2}>Pre-Term babies</td>
105
- <td>{moh711Data.pre_term_babies}</td>
118
+ <td onClick={() => navigateToRegister('pre_term_babies')}>{moh711Data.pre_term_babies}</td>
106
119
  </tr>
107
120
  <tr>
108
121
  <td>14</td>
109
122
  <td colSpan={2}>No. of Babies discharge Alive</td>
110
- <td>{moh711Data.discharge_alive}</td>
123
+ <td onClick={() => navigateToRegister('discharge_alive')}>{moh711Data.discharge_alive}</td>
111
124
  </tr>
112
125
  <tr>
113
126
  <td>15</td>
114
127
  <td colSpan={2}>No. of Infants initiated on breast feeding within 1 hour after birth</td>
115
- <td>{moh711Data.bf_within_1_hour}</td>
128
+ <td onClick={() => navigateToRegister('bf_within_1_hour')}>{moh711Data.bf_within_1_hour}</td>
116
129
  </tr>
117
130
  <tr>
118
131
  <td>16</td>
119
132
  <td colSpan={2}>Total Deliveries from HIV +ve Women</td>
120
- <td>{moh711Data.deliveries_from_positive_women}</td>
133
+ <td onClick={() => navigateToRegister('deliveries_from_positive_women')}>
134
+ {moh711Data.deliveries_from_positive_women}
135
+ </td>
121
136
  </tr>
122
137
  <tr>
123
138
  <td>17</td>
124
139
  <td rowSpan={3}>Perinatal Deaths</td>
125
140
  <td>Fresh Still Birth</td>
126
- <td>{moh711Data.fresh_still_birth}</td>
141
+ <td onClick={() => navigateToRegister('fresh_still_birth')}>{moh711Data.fresh_still_birth}</td>
127
142
  </tr>
128
143
  <tr>
129
144
  <td>18</td>
130
145
  <td>Macerated still Birth</td>
131
- <td>{moh711Data.macerated_still_birth}</td>
146
+ <td onClick={() => navigateToRegister('macerated_still_birth')}>{moh711Data.macerated_still_birth}</td>
132
147
  </tr>
133
148
  <tr>
134
149
  <td>19</td>
135
150
  <td>Deaths 0-7 days</td>
136
- <td>{moh711Data.perinatal_deaths_0_7_days}</td>
151
+ <td onClick={() => navigateToRegister('perinatal_deaths_0_7_days')}>
152
+ {moh711Data.perinatal_deaths_0_7_days}
153
+ </td>
137
154
  </tr>
138
155
  <tr>
139
156
  <td>20</td>
140
157
  <td colSpan={2}>Neonatal deaths 0-28 Days</td>
141
- <td>{moh711Data.neonatal_deaths_0_28_days}</td>
158
+ <td onClick={() => navigateToRegister('neonatal_deaths_0_28_days')}>
159
+ {moh711Data.neonatal_deaths_0_28_days}
160
+ </td>
142
161
  </tr>
143
162
  <tr>
144
163
  <td>21</td>
145
164
  <td colSpan={2}>Maternal deaths 10-14 Years</td>
146
- <td>{moh711Data.maternal_deaths_10_14_years}</td>
165
+ <td onClick={() => navigateToRegister('maternal_deaths_10_14_years')}>
166
+ {moh711Data.maternal_deaths_10_14_years}
167
+ </td>
147
168
  </tr>
148
169
  <tr>
149
170
  <td>22</td>
150
171
  <td colSpan={2}>Maternal deaths 15-19 Years</td>
151
- <td>{moh711Data.maternal_deaths_15_19_years}</td>
172
+ <td onClick={() => navigateToRegister('maternal_deaths_15_19_years')}>
173
+ {moh711Data.maternal_deaths_15_19_years}
174
+ </td>
152
175
  </tr>
153
176
  <tr>
154
177
  <td>23</td>
155
178
  <td colSpan={2}>Maternal deaths 20-24 Years</td>
156
- <td>{moh711Data.maternal_deaths_20_24_years}</td>
179
+ <td onClick={() => navigateToRegister('maternal_deaths_20_24_years')}>
180
+ {moh711Data.maternal_deaths_20_24_years}
181
+ </td>
157
182
  </tr>
158
183
  <tr>
159
184
  <td>24</td>
160
185
  <td colSpan={2}>Maternal deaths 25+ Years</td>
161
- <td>{moh711Data.maternal_deaths_25_above_years}</td>
186
+ <td onClick={() => navigateToRegister('maternal_deaths_25_above_years')}>
187
+ {moh711Data.maternal_deaths_25_above_years}
188
+ </td>
162
189
  </tr>
163
190
  <tr>
164
191
  <td>25</td>
165
192
  <td colSpan={2}>Maternal Deaths Audited Within 7 Days</td>
166
- <td>{moh711Data.maternal_deaths_audited_within_7_days}</td>
193
+ <td onClick={() => navigateToRegister('maternal_deaths_audited_within_7_days')}>
194
+ {moh711Data.maternal_deaths_audited_within_7_days}
195
+ </td>
167
196
  </tr>
168
197
  <tr>
169
198
  <td>26</td>
170
199
  <td colSpan={2}>No. of Neonatal deaths audited within 7 days</td>
171
- <td>{moh711Data.neonatal_deaths_audited_within_7_days}</td>
200
+ <td onClick={() => navigateToRegister('neonatal_deaths_audited_within_7_days')}>
201
+ {moh711Data.neonatal_deaths_audited_within_7_days}
202
+ </td>
172
203
  </tr>
173
204
  </tbody>
174
205
  </table>
@@ -185,42 +216,42 @@ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data }) =
185
216
  <tr>
186
217
  <td>27</td>
187
218
  <td>A.P.H (Ante partum Haemorrage)</td>
188
- <td>{moh711Data.ante_partum_haemorrage}</td>
219
+ <td onClick={() => navigateToRegister('ante_partum_haemorrage')}>{moh711Data.ante_partum_haemorrage}</td>
189
220
  <td></td>
190
221
  <td></td>
191
222
  </tr>
192
223
  <tr>
193
224
  <td>28</td>
194
225
  <td>P.P.H (Post Partum Haemorrage)</td>
195
- <td>{moh711Data.post_partum_haemorrage}</td>
226
+ <td onClick={() => navigateToRegister('post_partum_haemorrage')}>{moh711Data.post_partum_haemorrage}</td>
196
227
  <td></td>
197
228
  <td></td>
198
229
  </tr>
199
230
  <tr>
200
231
  <td>29</td>
201
232
  <td>Eclampsia</td>
202
- <td>{moh711Data.eclampsia}</td>
233
+ <td onClick={() => navigateToRegister('eclampsia')}>{moh711Data.eclampsia}</td>
203
234
  <td></td>
204
235
  <td></td>
205
236
  </tr>
206
237
  <tr>
207
238
  <td>30</td>
208
239
  <td>Ruptured Uterus</td>
209
- <td>{moh711Data.ruptured_uterus}</td>
240
+ <td onClick={() => navigateToRegister('ruptured_uterus')}>{moh711Data.ruptured_uterus}</td>
210
241
  <td></td>
211
242
  <td></td>
212
243
  </tr>
213
244
  <tr>
214
245
  <td>31</td>
215
246
  <td>Obstructed Labour</td>
216
- <td>{moh711Data.obstructed_labour}</td>
247
+ <td onClick={() => navigateToRegister('obstructed_labour')}>{moh711Data.obstructed_labour}</td>
217
248
  <td></td>
218
249
  <td></td>
219
250
  </tr>
220
251
  <tr>
221
252
  <td>32</td>
222
253
  <td>Sepsis</td>
223
- <td>{moh711Data.sepsis}</td>
254
+ <td onClick={() => navigateToRegister('sepsis')}>{moh711Data.sepsis}</td>
224
255
  <td></td>
225
256
  <td></td>
226
257
  </tr>
@@ -230,7 +261,9 @@ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data }) =
230
261
  Number of Mothers with delivery complications associated
231
262
  <br /> with FGM
232
263
  </td>
233
- <td>{moh711Data.fgm_delivery_complications}</td>
264
+ <td onClick={() => navigateToRegister('fgm_delivery_complications')}>
265
+ {moh711Data.fgm_delivery_complications}
266
+ </td>
234
267
  <td></td>
235
268
  <td></td>
236
269
  </tr>
@@ -249,27 +282,33 @@ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh711Data }) =
249
282
  <td>34</td>
250
283
  <td rowSpan={3}>Causes of neonatal deaths</td>
251
284
  <td>No. of neonatal deaths due to Sepsis</td>
252
- <td>{moh711Data.neonatal_deaths_sepsis}</td>
285
+ <td onClick={() => navigateToRegister('neonatal_deaths_sepsis')}>{moh711Data.neonatal_deaths_sepsis}</td>
253
286
  </tr>
254
287
  <tr>
255
288
  <td>35</td>
256
289
  <td>No. of neonatal deaths due to Prematurity</td>
257
- <td>{moh711Data.neonatal_deaths_prematurity}</td>
290
+ <td onClick={() => navigateToRegister('neonatal_deaths_prematurity')}>
291
+ {moh711Data.neonatal_deaths_prematurity}
292
+ </td>
258
293
  </tr>
259
294
  <tr>
260
295
  <td>36</td>
261
296
  <td>No. of neonatal deaths due to Asphyxia</td>
262
- <td>{moh711Data.neonatal_deaths_asphyxia}</td>
297
+ <td onClick={() => navigateToRegister('neonatal_deaths_asphyxia')}>
298
+ {moh711Data.neonatal_deaths_asphyxia}
299
+ </td>
263
300
  </tr>
264
301
  <tr>
265
302
  <td>37</td>
266
303
  <td colSpan={2}>No. of Neonates initiated on Kangaroo Mother Care</td>
267
- <td>{moh711Data.kangaroo_mother_care}</td>
304
+ <td onClick={() => navigateToRegister('kangaroo_mother_care')}>{moh711Data.kangaroo_mother_care}</td>
268
305
  </tr>
269
306
  <tr>
270
307
  <td>38</td>
271
308
  <td colSpan={2}>Maternal Referrals From Community Unit</td>
272
- <td>{moh711Data.referrals_from_community}</td>
309
+ <td onClick={() => navigateToRegister('referrals_from_community')}>
310
+ {moh711Data.referrals_from_community}
311
+ </td>
273
312
  </tr>
274
313
  </tbody>
275
314
  </table>
@@ -2,12 +2,22 @@ import React from 'react';
2
2
 
3
3
  import styles from '../moh711.scss';
4
4
  import classNames from 'classnames';
5
+ import { useNavigate } from 'react-router-dom';
5
6
 
6
7
  interface PNCComponentProps {
7
8
  moh711Data: any;
9
+ startDate: string;
10
+ endDate: string;
11
+ locationUuids: string;
8
12
  }
9
13
 
10
- const PNCComponent: React.FC<PNCComponentProps> = ({ moh711Data }) => {
14
+ const PNCComponent: React.FC<PNCComponentProps> = ({ moh711Data, startDate, endDate, locationUuids }) => {
15
+ const navigate = useNavigate();
16
+ const navigateToRegister = (indicator: string) => {
17
+ navigate(
18
+ `/moh-406-register?startDate=${startDate}&endDate=${endDate}&locationUuids=${locationUuids}&indicator=${indicator}`,
19
+ );
20
+ };
11
21
  return (
12
22
  <>
13
23
  <table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
@@ -26,62 +36,78 @@ const PNCComponent: React.FC<PNCComponentProps> = ({ moh711Data }) => {
26
36
  <td>1</td>
27
37
  <td rowSpan={2}>No. of PNC Clients</td>
28
38
  <td>New</td>
29
- <td>{moh711Data.pnc_new_clients}</td>
39
+ <td onClick={() => navigateToRegister('pnc_new_clients')}>{moh711Data.pnc_new_clients}</td>
30
40
  </tr>
31
41
  <tr>
32
42
  <td>2</td>
33
43
  <td>Revisit</td>
34
- <td>{moh711Data.pnc_revisit_clients}</td>
44
+ <td onClick={() => navigateToRegister('pnc_revisit_clients')}>{moh711Data.pnc_revisit_clients}</td>
35
45
  </tr>
36
46
  <tr>
37
47
  <td>3</td>
38
48
  <td colSpan={2}>No of Women counselled on Post Partum FP</td>
39
- <td>{moh711Data.women_couselled_on_post_partum_fp}</td>
49
+ <td onClick={() => navigateToRegister('women_couselled_on_post_partum_fp')}>
50
+ {moh711Data.women_couselled_on_post_partum_fp}
51
+ </td>
40
52
  </tr>
41
53
  <tr>
42
54
  <td>4</td>
43
55
  <td colSpan={2}>No of Clients who received Post Partum FP</td>
44
- <td>{moh711Data.women_received_post_partum_fp}</td>
56
+ <td onClick={() => navigateToRegister('women_received_post_partum_fp')}>
57
+ {moh711Data.women_received_post_partum_fp}
58
+ </td>
45
59
  </tr>
46
60
  <tr>
47
61
  <td>5</td>
48
62
  <td rowSpan={3}>No. of Mothers receiving Postpartum Care</td>
49
63
  <td>within 48 hours</td>
50
- <td>{moh711Data.mothers_post_partum_care_48_hours}</td>
64
+ <td onClick={() => navigateToRegister('mothers_post_partum_care_48_hours')}>
65
+ {moh711Data.mothers_post_partum_care_48_hours}
66
+ </td>
51
67
  </tr>
52
68
  <tr>
53
69
  <td></td>
54
70
  <td>Between 3 days to 6 weeks</td>
55
- <td>{moh711Data.mothers_post_partum_care_3_6_weeks}</td>
71
+ <td onClick={() => navigateToRegister('mothers_post_partum_care_3_6_weeks')}>
72
+ {moh711Data.mothers_post_partum_care_3_6_weeks}
73
+ </td>
56
74
  </tr>
57
75
  <tr>
58
76
  <td></td>
59
77
  <td>After 6 weeks</td>
60
- <td>{moh711Data.mothers_post_partum_care_after_6_weeks}</td>
78
+ <td onClick={() => navigateToRegister('mothers_post_partum_care_after_6_weeks')}>
79
+ {moh711Data.mothers_post_partum_care_after_6_weeks}
80
+ </td>
61
81
  </tr>
62
82
  <tr>
63
83
  <td rowSpan={3}>6</td>
64
84
  <td rowSpan={3}>No. of Babies received Postpartum Care</td>
65
85
  <td>Within 48 hours</td>
66
- <td>{moh711Data.infants_post_partum_care_48_hours}</td>
86
+ <td onClick={() => navigateToRegister('infants_post_partum_care_48_hours')}>
87
+ {moh711Data.infants_post_partum_care_48_hours}
88
+ </td>
67
89
  </tr>
68
90
  <tr>
69
91
  <td>Between 3 days to 6 weeks</td>
70
- <td>{moh711Data.infants_post_partum_care_3_6_weeks}</td>
92
+ <td onClick={() => navigateToRegister('infants_post_partum_care_3_6_weeks')}>
93
+ {moh711Data.infants_post_partum_care_3_6_weeks}
94
+ </td>
71
95
  </tr>
72
96
  <tr>
73
97
  <td>After 6 weeks</td>
74
- <td>{moh711Data.infants_post_partum_care_after_6_weeks}</td>
98
+ <td onClick={() => navigateToRegister('infants_post_partum_care_after_6_weeks')}>
99
+ {moh711Data.infants_post_partum_care_after_6_weeks}
100
+ </td>
75
101
  </tr>
76
102
  <tr>
77
103
  <td>7</td>
78
104
  <td colSpan={2}>Number of Cases of Fistula</td>
79
- <td>{moh711Data.fistula_cases}</td>
105
+ <td onClick={() => navigateToRegister('pnc_new_clients')}>{moh711Data.fistula_cases}</td>
80
106
  </tr>
81
107
  <tr>
82
108
  <td>8</td>
83
109
  <td colSpan={2}>No referred from the Community unit to PNC</td>
84
- <td>{moh711Data.referrals_from_community}</td>
110
+ <td onClick={() => navigateToRegister('pnc_new_clients')}>{moh711Data.referrals_from_community}</td>
85
111
  </tr>
86
112
  </tbody>
87
113
  </table>
@@ -17,18 +17,20 @@ import MortuaryComponent from './sections/mortuary.component';
17
17
  import MedicalRecordsComponent from './sections/medical-records.component';
18
18
  import FinanceComponent from './sections/finance.component';
19
19
  import PreparedbyComponent from './sections/preparedby.component';
20
+ import { type ReportFilters } from '../moh-705a/type';
20
21
 
21
22
  const Moh717Report: React.FC = () => {
22
23
  let errorMessage: string = '';
23
24
  const [moh717ReportData, setMoh717ReportData] = useState<any>([]);
24
25
  const [isLoading, setIsLoading] = useState<boolean>(false);
26
+ const [startDate, setStartDate] = useState<string>('');
27
+ const [endDate, setEndDate] = useState<string>('');
25
28
 
26
29
  const session = useSession();
27
30
  const locationUuid = session?.sessionLocation?.uuid;
28
- const fetchMoh717ReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
29
- setIsLoading(true);
30
- let startDate = filters.startDate;
31
- let endDate = filters.endDate;
31
+
32
+ const getReportParams = (filters: ReportFilters) => {
33
+ let { startDate: sDate, endDate: eDate } = filters;
32
34
 
33
35
  if (filters.month) {
34
36
  const [year, monthIndex] = filters.month.split('-').map(Number);
@@ -37,16 +39,27 @@ const Moh717Report: React.FC = () => {
37
39
  const end = new Date(year, monthIndex, 0);
38
40
 
39
41
  const formatLocalDate = (d: Date) => {
40
- const year = d.getFullYear();
41
- const month = String(d.getMonth() + 1).padStart(2, '0');
42
+ const y = d.getFullYear();
43
+ const m = String(d.getMonth() + 1).padStart(2, '0');
42
44
  const day = String(d.getDate()).padStart(2, '0');
43
- return `${year}-${month}-${day}`;
45
+ return `${y}-${m}-${day}`;
44
46
  };
45
47
 
46
- startDate = formatLocalDate(start);
47
- endDate = formatLocalDate(end);
48
+ sDate = formatLocalDate(start);
49
+ eDate = formatLocalDate(end);
48
50
  }
49
51
 
52
+ setStartDate(sDate || '');
53
+ setEndDate(eDate || '');
54
+
55
+ return { startDate: sDate, endDate: eDate };
56
+ };
57
+
58
+ const fetchMoh717ReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
59
+ setIsLoading(true);
60
+
61
+ const { startDate, endDate } = getReportParams(filters);
62
+
50
63
  const params = {
51
64
  locationUuids: locationUuid || '',
52
65
  startDate,
@@ -118,7 +131,12 @@ const Moh717Report: React.FC = () => {
118
131
  <InpatientComponent moh717ReportData={moh717ReportData} />
119
132
  <div className={styles.sectionContainer}>
120
133
  <div className={styles.left}>
121
- <MaternityComponent moh717ReportData={moh717ReportData} />
134
+ <MaternityComponent
135
+ moh717ReportData={moh717ReportData}
136
+ startDate={startDate}
137
+ endDate={endDate}
138
+ locationUuids={locationUuid!}
139
+ />
122
140
  </div>
123
141
  <div className={styles.right}>
124
142
  <OperationsComponent moh717ReportData={moh717ReportData} />
@@ -147,4 +147,8 @@ h3 {
147
147
 
148
148
  span {
149
149
  font-weight: bold;
150
+ }
151
+
152
+ .buttonContainer {
153
+ margin: 1rem;
150
154
  }
@@ -2,12 +2,27 @@ import React from 'react';
2
2
 
3
3
  import styles from '../moh717.scss';
4
4
  import classNames from 'classnames';
5
+ import { useNavigate } from 'react-router-dom';
5
6
 
6
7
  interface MaternityComponentProps {
7
8
  moh717ReportData: any;
9
+ startDate: string;
10
+ endDate: string;
11
+ locationUuids: string;
8
12
  }
9
13
 
10
- const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh717ReportData }: { moh717ReportData: any }) => {
14
+ const MaternityComponent: React.FC<MaternityComponentProps> = ({
15
+ moh717ReportData,
16
+ startDate,
17
+ endDate,
18
+ locationUuids,
19
+ }) => {
20
+ const navigate = useNavigate();
21
+ const navigateToRegister = (indicator?: string) => {
22
+ navigate(
23
+ `/moh-333-register?startDate=${startDate}&endDate=${endDate}&locationUuids=${locationUuids}&indicator=${indicator}`,
24
+ );
25
+ };
11
26
  return (
12
27
  <>
13
28
  <table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
@@ -23,62 +38,72 @@ const MaternityComponent: React.FC<MaternityComponentProps> = ({ moh717ReportDat
23
38
  <tr>
24
39
  <td>B.2.1</td>
25
40
  <td>Normal Deliveries</td>
26
- <td>{moh717ReportData.normal_deliveries}</td>
41
+ <td onClick={() => navigateToRegister('normal_deliveries')}>{moh717ReportData.normal_deliveries}</td>
27
42
  </tr>
28
43
  <tr>
29
44
  <td>B.2.2</td>
30
45
  <td>Caesarian Sections</td>
31
- <td>{moh717ReportData.caesarian_sections}</td>
46
+ <td onClick={() => navigateToRegister('caesarian_sections')}>{moh717ReportData.caesarian_sections}</td>
32
47
  </tr>
33
48
  <tr>
34
49
  <td>B.2.3</td>
35
50
  <td>Breach Deliveries</td>
36
- <td>{moh717ReportData.breach_deliveries}</td>
51
+ <td onClick={() => navigateToRegister('breach_deliveries')}>{moh717ReportData.breach_deliveries}</td>
37
52
  </tr>
38
53
  <tr>
39
54
  <td>B.2.4</td>
40
55
  <td>Assisted Vaginal Delivery</td>
41
- <td>{moh717ReportData.assisted_vaginal_deliveries}</td>
56
+ <td onClick={() => navigateToRegister('assisted_vaginal_deliveries')}>
57
+ {moh717ReportData.assisted_vaginal_deliveries}
58
+ </td>
42
59
  </tr>
43
60
  <tr>
44
61
  <td>B.2.5a</td>
45
62
  <td>BBA (Born before arrival)</td>
46
- <td>{moh717ReportData.born_before_arrival}</td>
63
+ <td onClick={() => navigateToRegister('born_before_arrival')}>{moh717ReportData.born_before_arrival}</td>
47
64
  </tr>
48
65
  <tr>
49
66
  <td>B.2.5b</td>
50
67
  <td>Maternal deaths</td>
51
- <td>{moh717ReportData.maternal_deaths}</td>
68
+ <td onClick={() => navigateToRegister('maternal_deaths')}>{moh717ReportData.maternal_deaths}</td>
52
69
  </tr>
53
70
  <tr>
54
71
  <td>B.2.6</td>
55
72
  <td>Maternal Deaths Audited</td>
56
- <td>{moh717ReportData.maternal_deaths_audited_within_7_days}</td>
73
+ <td onClick={() => navigateToRegister('maternal_deaths_audited_within_7_days')}>
74
+ {moh717ReportData.maternal_deaths_audited_within_7_days}
75
+ </td>
57
76
  </tr>
58
77
  <tr>
59
78
  <td>B.2.7</td>
60
79
  <td>Live births</td>
61
- <td>{moh717ReportData.live_births}</td>
80
+ <td onClick={() => navigateToRegister('live_births')}>{moh717ReportData.live_births}</td>
62
81
  </tr>
63
82
  <tr>
64
83
  <td>B.2.8</td>
65
84
  <td>Still births</td>
66
- <td>{moh717ReportData.still_births}</td>
85
+ <td onClick={() => navigateToRegister('still_births')}>{moh717ReportData.still_births}</td>
67
86
  </tr>
68
87
  <tr>
69
88
  <td>B.2.9</td>
70
89
  <td>Neonatal deaths</td>
71
- <td>{moh717ReportData.neonatal_deaths_0_28_days}</td>
90
+ <td onClick={() => navigateToRegister('neonatal_deaths_0_28_days')}>
91
+ {moh717ReportData.neonatal_deaths_0_28_days}
92
+ </td>
72
93
  </tr>
73
94
  <tr>
74
95
  <td>B.2.10</td>
75
96
  <td>Neonatal deaths Audits</td>
76
- <td>{moh717ReportData.neonatal_deaths_audits}</td>
97
+ <td onClick={() => navigateToRegister('neonatal_deaths_audits')}>
98
+ {moh717ReportData.neonatal_deaths_audits}
99
+ </td>
77
100
  </tr>
78
101
  <tr>
79
102
  <td>B.2.11</td>
80
103
  <td>Low Birth Weight babies (under 2500gms)</td>
81
- <td>{moh717ReportData.low_birth_weight_less_2500gms}</td>
104
+ <td onClick={() => navigateToRegister('low_birth_weight_less_2500gms')}>
105
+ {moh717ReportData.low_birth_weight_less_2500gms}
106
+ </td>
82
107
  </tr>
83
108
  <tr>
84
109
  <td>B.2.12</td>