@ampath/esm-reports-app 1.0.0-next.76 → 1.0.0-next.78

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.
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
- import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
1
+ import React, { useState } from 'react';
2
+ import { useLocation, useSearchParams } from 'react-router-dom';
3
+ import { useSession } from '@openmrs/esm-framework';
3
4
 
4
5
  import styles from '../../../common/report-register/register-table.scss';
5
6
  import classNames from 'classnames';
@@ -7,17 +8,27 @@ import { getMoh333PatientList } from '../../../resources/moh-711.resource';
7
8
  import { moh333Columns } from './type';
8
9
  import { moh333ExportColumns } from './moh-333.columns';
9
10
  import { RegisterLayout, usePatientList } from '../../../common/report-register';
11
+ import { ReportFiltersComponent, type ReportPeriod } from '../../../common/report-filters';
10
12
 
11
13
  const Moh333Register: React.FC = () => {
12
- const [searchParams] = useSearchParams();
14
+ const [searchParams, setSearchParams] = useSearchParams();
13
15
  const location = useLocation();
16
+ const session = useSession();
14
17
 
15
- const startDate = searchParams.get('startDate');
16
- const endDate = searchParams.get('endDate');
17
- const locationUuids = searchParams.get('locationUuids');
18
- const indicator = searchParams.get('indicator');
19
- const reportName = location.state?.reportName || '';
20
18
  const from = searchParams.get('from');
19
+ const isDrilldown = Boolean(from);
20
+ const [generatedPeriod, setGeneratedPeriod] = useState<{ startDate: string; endDate: string } | null>(() => {
21
+ const startDate = searchParams.get('startDate');
22
+ const endDate = searchParams.get('endDate');
23
+ return !isDrilldown && startDate && endDate ? { startDate, endDate } : null;
24
+ });
25
+ const isGenerated = isDrilldown || Boolean(generatedPeriod);
26
+
27
+ const startDate = generatedPeriod?.startDate ?? searchParams.get('startDate');
28
+ const endDate = generatedPeriod?.endDate ?? searchParams.get('endDate');
29
+ const locationUuids = searchParams.get('locationUuids') ?? session?.sessionLocation?.uuid ?? '';
30
+ const indicator = searchParams.get('indicator');
31
+ const reportName = location.state?.reportName || 'moh711Report';
21
32
 
22
33
  const {
23
34
  rows: patientlist,
@@ -29,8 +40,12 @@ const Moh333Register: React.FC = () => {
29
40
  onPageChange,
30
41
  fetchAll,
31
42
  } = usePatientList(
32
- ({ startIndex, limit }) =>
33
- getMoh333PatientList({
43
+ ({ startIndex, limit }) => {
44
+ if (!isDrilldown && !generatedPeriod) {
45
+ return Promise.resolve({ results: [], total: 0, isTotalExact: true });
46
+ }
47
+
48
+ return getMoh333PatientList({
34
49
  startDate,
35
50
  endDate,
36
51
  locationUuids,
@@ -38,601 +53,627 @@ const Moh333Register: React.FC = () => {
38
53
  reportName,
39
54
  startIndex,
40
55
  limit,
41
- from
42
- }),
43
- [startDate, endDate, locationUuids, indicator, reportName],
56
+ from,
57
+ });
58
+ },
59
+ [startDate, endDate, locationUuids, indicator, reportName, from, isDrilldown, generatedPeriod],
44
60
  );
45
61
 
62
+ const generate = ({ startDate, endDate }: ReportPeriod) => {
63
+ setGeneratedPeriod({ startDate, endDate });
64
+ setSearchParams((currentParams) => {
65
+ const nextParams = new URLSearchParams(currentParams);
66
+ nextParams.set('startDate', startDate);
67
+ nextParams.set('endDate', endDate);
68
+ if (!nextParams.has('locationUuids') && locationUuids) {
69
+ nextParams.set('locationUuids', locationUuids);
70
+ }
71
+ return nextParams;
72
+ });
73
+ };
74
+
46
75
  return (
47
- <RegisterLayout
48
- parentLabel="MOH-711 Report"
49
- parentPath="/moh-711"
50
- title="MOH 333 Register"
51
- isLoading={isLoading}
52
- isEmpty={patientlist.length === 0}
53
- page={page}
54
- pageSize={pageSize}
55
- total={total}
56
- isTotalExact={isTotalExact}
57
- onPageChange={onPageChange}
58
- fetchAll={fetchAll}
59
- columns={moh333ExportColumns}
60
- >
61
- {' '}
62
- <div className={styles.tableContainer}>
63
- <table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
64
- <thead>
65
- <tr>
66
- <th rowSpan={6}>
67
- Date of
68
- <br />
69
- Admission <br />
70
- (dd/mm/yyyy)
71
- </th>
72
- <th rowSpan={6}>CRId</th>
73
- <th>Admission number (yyyy-mm-nnnn)</th>
74
- <th rowSpan={6}>
75
- Full Name
76
- <br />
77
- (First, Middle, surname)
78
- </th>
79
- <th>
80
- Date of Birth <br />
81
- (dd/mm/yyyy)
82
- </th>
83
- <th rowSpan={6}>
84
- County/ <br />
85
- Subcounty
86
- </th>
87
- <th>
88
- Village/
89
- <br />
90
- Estate/
91
- <br />
92
- Land mark
93
- </th>
94
- <th rowSpan={6}>
95
- Marital Status <br />
96
- 1 = Married
97
- <br />
98
- 2 = Widowed <br />
99
- 3 = Single
100
- <br />
101
- 4 = Divorced
102
- <br />5 = Separated
103
- </th>
104
- <th rowSpan={6}>
105
- Parity
106
- <br />
107
- (X+Y)
108
- </th>
109
- <th rowSpan={6}>Gravidae</th>
110
- <th rowSpan={6}>
111
- No. of <br />
112
- ANC <br />
113
- visits
114
- </th>
115
- <th rowSpan={6}>
116
- Date of Last
117
- <br />
118
- Menstrual
119
- <br />
120
- Period (LMP) <br />
121
- (dd/mm/yyyy)
122
- </th>
123
- <th rowSpan={6}>
124
- Estimated Date <br />
125
- of Delivery
126
- <br />
127
- (EDD)
128
- <br />
129
- (dd/mm/yyyy)
130
- </th>
131
- <th rowSpan={6}>Diagnosis</th>
132
- <th colSpan={13}>Delivery</th>
133
- <th colSpan={9}></th>
134
- <th>
135
- VDRL/
136
- <br />
137
- RPR
138
- <br />
139
- Results
140
- <br />
141
- (Specify
142
- <br />
143
- 1-VDRL
144
- <br />
145
- 2-RPR
146
- <br />
147
- 3-Duo
148
- <br />
149
- testing)
150
- </th>
151
- <th colSpan={4}>Baby</th>
152
- <th>
153
- Maternal <br />
154
- HAART
155
- </th>
156
- <th>
157
- Infant <br />
158
- Prophylaxis
159
- </th>
160
- <th>
161
- Partner <br />
162
- Tested for <br />
163
- HIV
164
- </th>
165
- <th rowSpan={6}>
166
- Counselled <br />
167
- on infant <br />
168
- feeding <br />
169
- (Y/N/NA)
170
- </th>
171
- <th rowSpan={6}>
172
- Delivery <br />
173
- Conducted by <br />
174
- (Enter Name)
175
- </th>
176
- <th rowSpan={6}>
177
- Birth <br />
178
- Notification <br />
179
- Number
180
- </th>
181
- <th colSpan={2}>Discharge</th>
182
- <th colSpan={3}>Referral</th>
183
- <th rowSpan={6}>Comments</th>
184
- </tr>
185
- <tr>
186
- <th rowSpan={5}>NUPI</th>
187
- <th rowSpan={5}>Age</th>
188
- <th rowSpan={5}>Phone number</th>
189
- <th rowSpan={5}>
190
- Duration of <br />
191
- labour
192
- <br />
193
- (hours)
194
- </th>
195
- <th rowSpan={5}>
196
- Date of
197
- <br />
198
- Delivery <br />
199
- (dd/mm/yyyy)
200
- </th>
201
- <th rowSpan={5}>
202
- Time of
203
- <br />
204
- Delivery
205
- </th>
206
- <th rowSpan={5}>
207
- Gestation
208
- <br />
209
- at Birth
210
- <br />
211
- (wks)
212
- </th>
213
- <th rowSpan={5}>
214
- Mode of <br />
215
- Delivery <br />
216
- 1) SVD
217
- <br />
218
- 2) CS
219
- <br />
220
- 3) Breech
221
- <br />
222
- 4) AVD
223
- </th>
224
- <th rowSpan={5}>
225
- No.of babies <br />
226
- delivered
227
- </th>
228
- <th rowSpan={5}>
229
- Placenta
230
- <br />
231
- Complete <br />
232
- 1=Yes
233
- <br />
234
- 2=No
235
- <br />
236
- 3=BBA
237
- </th>
238
- <th rowSpan={5}>
239
- Uterotonic <br />
240
- given <br />
241
- 1=oxytocin <br />
242
- 2=Carbetocin <br />
243
- 3=Others <br />
244
- Specify
245
- <br />
246
- 4= None
247
- </th>
248
- <th rowSpan={5}>
249
- Vaginal
250
- <br />
251
- Examination
252
- <br />
253
- 1= Normal
254
- <br />
255
- 2=Episiotomy
256
- <br />
257
- 3=Vaginal tear
258
- <br />
259
- 4=FGM
260
- <br />
261
- 5=Vaginal warts
262
- </th>
263
- <th rowSpan={5}>
264
- Blood
265
- <br />
266
- loss
267
- <br />
268
- (mls)
269
- </th>
270
- <th rowSpan={5}>
271
- Mother's <br />
272
- status after <br />
273
- Delivery
274
- <br />
275
- (Alive/ <br />
276
- Dead)
277
- </th>
278
- <th>
279
- Maternal deaths <br />
280
- Notified <br />
281
- (Y/N/NA)
282
- </th>
283
- <th rowSpan={5}>
284
- Delivery
285
- <br />
286
- Complications
287
- <br />
288
- 1=A.P.H. (Ante Partum <br />
289
- Haemorrhage); <br />
290
- 2=P.P.H. (Post Partum <br />
291
- Haemorrhage); <br />
292
- 3= Eclampsia; <br />
293
- 4=Ruptured Uterus;
294
- <br />
295
- 5=Obstructed labour; <br />
296
- 6=Sepsis <br />
297
- 7= NA
298
- </th>
299
- <th rowSpan={5}>
300
- APGAR <br />
301
- Score
302
- </th>
303
- <th rowSpan={5}>
304
- Birth
305
- <br />
306
- Outcome
307
- <br />
308
- (LB/FSB/ <br />
309
- MSB)
310
- </th>
311
- <th rowSpan={5}>
312
- Birth <br />
313
- Weight
314
- <br />
315
- (grams)
316
- </th>
317
- <th rowSpan={5}>
318
- Sex <br />
319
- (M/F)
320
- </th>
321
- <th>
322
- Initiated on <br />
323
- BF in
324
- <br />
325
- &lt; 1hr
326
- <br />
327
- (Y/N)
328
- </th>
329
- <th rowSpan={5}>
330
- TEO
331
- <br />
332
- given at
333
- <br />
334
- birth? <br />
335
- (Y/N)
336
- </th>
337
- <th rowSpan={5}>
338
- Chlorhexidine <br />
339
- applied on <br />
340
- cord stump
341
- <br />
342
- (Y/N)
343
- </th>
344
- <th>
345
- Birth with <br />
346
- deformity <br />
347
- (Y/N)
348
- </th>
349
- <th rowSpan={5}>
350
- Given
351
- <br />
352
- Vitamin <br />
353
- K <br />
354
- (Y/N)
355
- </th>
356
- <th rowSpan={5}>(P/N/ND)</th>
357
- <th>HIV Test 1</th>
358
- <th>HIV Test 2</th>
359
- <th>HIV Test 3</th>
360
- <th>
361
- HIV Result <br />
362
- Maternity <br />
363
- (N/P/Inc/U/NA)
364
- </th>
365
- <th>
366
- Start at <br />
367
- Maternity
368
- </th>
369
- <th rowSpan={5}>(Y/N/NA)</th>
370
- <th rowSpan={5}>(Y/N/NA)</th>
371
- <th rowSpan={5}>
372
- Date <br />
373
- (dd/mm/yyyy)
374
- </th>
375
- <th rowSpan={5}>
376
- Status of <br />
377
- Baby
378
- <br />
379
- A= Alive
380
- <br />
381
- D= Dead
382
- </th>
383
- <th>From</th>
384
- <th>To</th>
385
- <th rowSpan={5}>Reason for referral</th>
386
- </tr>
387
- <tr>
388
- <th rowSpan={4}>
389
- Date Death <br />
390
- notified
391
- </th>
392
- <th rowSpan={4}>
393
- Kangaroo <br />
394
- Mother <br />
395
- Care <br />
396
- (Y/N)
397
- </th>
398
- <th rowSpan={4}>
399
- 1- congenital <br />
400
- syphilis.
401
- <br />
402
- 2- spina bifida, <br />
403
- 3- Hydrocephalus,
404
- <br />
405
- 4- Talipes
406
- </th>
407
- <th>Kit Name:</th>
408
- <th>Kit Name:</th>
409
- <th>Kit Name:</th>
410
- <th rowSpan={4}>
411
- Initial/Retest/
412
- <br />
413
- NA
414
- </th>
415
- <th rowSpan={4}>(Y/N/NA)</th>
416
- <th rowSpan={4}>
417
- 1= From Community <br />
418
- Unit,
419
- <br />
420
- 2= From Another
421
- <br />
422
- Health Facility, <br />
423
- 3=Not Applicable
424
- </th>
425
- <th rowSpan={4}>
426
- 1= To Community
427
- <br />
428
- Unit, <br />
429
- 2=Referred to HIV <br />
430
- preventive services
431
- <br />
432
- 3=Another Health <br />
433
- Facility,
434
- <br />
435
- 4=Not Applicable
436
- </th>
437
- </tr>
438
- <tr>
439
- <th>Lot No.</th>
440
- <th>Lot No.</th>
441
- <th>Lot No.</th>
442
- </tr>
443
- <tr>
444
- <th>Expiry / /</th>
445
- <th>Expiry / /</th>
446
- <th>Expiry / /</th>
447
- </tr>
448
- <tr>
449
- <th>(N/P/I/NA)</th>
450
- <th>(N/P/I/NA)</th>
451
- <th>(N/P/I/NA)</th>
452
- </tr>
453
- </thead>
454
- <tbody>
455
- <tr>
456
- <td className={styles.textCentre}>(a)</td>
457
- <td className={styles.textCentre}>(b)</td>
458
- <td className={styles.textCentre}>(c)</td>
459
- <td className={styles.textCentre}>(d)</td>
460
- <td className={styles.textCentre}>(e)</td>
461
- <td className={styles.textCentre}>(f)</td>
462
- <td className={styles.textCentre}>(g)</td>
463
- <td className={styles.textCentre}>(h)</td>
464
- <td className={styles.textCentre}>(i)</td>
465
- <td className={styles.textCentre}>(j)</td>
466
- <td className={styles.textCentre}>(k)</td>
467
- <td className={styles.textCentre}>(l)</td>
468
- <td className={styles.textCentre}>(m)</td>
469
- <td className={styles.textCentre}>(n)</td>
470
- <td className={styles.textCentre}>(o)</td>
471
- <td className={styles.textCentre}>(p)</td>
472
- <td className={styles.textCentre}>(q)</td>
473
- <td className={styles.textCentre}>(r)</td>
474
- <td className={styles.textCentre}>(s)</td>
475
- <td className={styles.textCentre}>(t)</td>
476
- <td className={styles.textCentre}>(u)</td>
477
- <td className={styles.textCentre}>(v)</td>
478
- <td className={styles.textCentre}>(w)</td>
479
- <td className={styles.textCentre}>(x)</td>
480
- <td className={styles.textCentre}>(y)</td>
481
- <td className={styles.textCentre}>(z)</td>
482
- <td className={styles.textCentre}>(aa)</td>
483
- <td className={styles.textCentre}>(ab)</td>
484
- <td className={styles.textCentre}>(ac)</td>
485
- <td className={styles.textCentre}>(ad)</td>
486
- <td className={styles.textCentre}>(ae)</td>
487
- <td className={styles.textCentre}>(af)</td>
488
- <td className={styles.textCentre}>(ag)</td>
489
- <td className={styles.textCentre}>(ah)</td>
490
- <td className={styles.textCentre}>(ai)</td>
491
- <td className={styles.textCentre}>(aj)</td>
492
- <td colSpan={3} className={styles.textCentre}>
493
- (ak)
494
- </td>
495
- <td className={styles.textCentre}>(al)</td>
496
- <td className={styles.textCentre}>(am)</td>
497
- <td className={styles.textCentre}>(an)</td>
498
- <td className={styles.textCentre}>(ao)</td>
499
- <td className={styles.textCentre}>(ap)</td>
500
- <td className={styles.textCentre}>(aq)</td>
501
- <td className={styles.textCentre}>(ar)</td>
502
- <td className={styles.textCentre}>(as)</td>
503
- <td className={styles.textCentre}>(at)</td>
504
- <td className={styles.textCentre}>(au)</td>
505
- <td className={styles.textCentre}>(av)</td>
506
- <td className={styles.textCentre}>(aw)</td>
507
- <td className={styles.textCentre}>(ax)</td>
508
- <td className={styles.textCentre}>(ay)</td>
509
- </tr>
510
- {patientlist?.length > 0 ? (
511
- patientlist.map((row, i) => (
512
- <React.Fragment key={i}>
513
- <tr>
514
- <td rowSpan={2}>
515
- {row.admission_date ? new Date(row.admission_date).toLocaleDateString('en-GB') : ''}
516
- </td>
517
- <td rowSpan={2}>{row.cr_id}</td>
518
- <td>{row.admission_number}</td>
519
- <td rowSpan={2}>{row.full_names}</td>
76
+ <>
77
+ {!isDrilldown && (
78
+ <ReportFiltersComponent
79
+ reportName="MOH 333 Register"
80
+ mode="range"
81
+ onGenerate={generate}
82
+ isLoading={isLoading}
83
+ isReportGenerated={Boolean(generatedPeriod)}
84
+ generatedPeriod={generatedPeriod ?? undefined}
85
+ backLink={{ label: 'All registers', to: '/?tab=registers' }}
86
+ />
87
+ )}
88
+ <RegisterLayout
89
+ parentLabel={isDrilldown ? 'MOH-711 Report' : 'All registers'}
90
+ parentPath={isDrilldown ? '/moh-711' : '/?tab=registers'}
91
+ title="MOH 333 Register"
92
+ isLoading={isLoading}
93
+ isEmpty={isGenerated && patientlist.length === 0}
94
+ page={page}
95
+ pageSize={pageSize}
96
+ total={total}
97
+ isTotalExact={isTotalExact}
98
+ onPageChange={onPageChange}
99
+ fetchAll={isGenerated ? fetchAll : undefined}
100
+ columns={moh333ExportColumns}
101
+ >
102
+ <div className={styles.tableContainer}>
103
+ <table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
104
+ <thead>
105
+ <tr>
106
+ <th rowSpan={6}>
107
+ Date of
108
+ <br />
109
+ Admission <br />
110
+ (dd/mm/yyyy)
111
+ </th>
112
+ <th rowSpan={6}>CRId</th>
113
+ <th>Admission number (yyyy-mm-nnnn)</th>
114
+ <th rowSpan={6}>
115
+ Full Name
116
+ <br />
117
+ (First, Middle, surname)
118
+ </th>
119
+ <th>
120
+ Date of Birth <br />
121
+ (dd/mm/yyyy)
122
+ </th>
123
+ <th rowSpan={6}>
124
+ County/ <br />
125
+ Subcounty
126
+ </th>
127
+ <th>
128
+ Village/
129
+ <br />
130
+ Estate/
131
+ <br />
132
+ Land mark
133
+ </th>
134
+ <th rowSpan={6}>
135
+ Marital Status <br />
136
+ 1 = Married
137
+ <br />
138
+ 2 = Widowed <br />
139
+ 3 = Single
140
+ <br />
141
+ 4 = Divorced
142
+ <br />5 = Separated
143
+ </th>
144
+ <th rowSpan={6}>
145
+ Parity
146
+ <br />
147
+ (X+Y)
148
+ </th>
149
+ <th rowSpan={6}>Gravidae</th>
150
+ <th rowSpan={6}>
151
+ No. of <br />
152
+ ANC <br />
153
+ visits
154
+ </th>
155
+ <th rowSpan={6}>
156
+ Date of Last
157
+ <br />
158
+ Menstrual
159
+ <br />
160
+ Period (LMP) <br />
161
+ (dd/mm/yyyy)
162
+ </th>
163
+ <th rowSpan={6}>
164
+ Estimated Date <br />
165
+ of Delivery
166
+ <br />
167
+ (EDD)
168
+ <br />
169
+ (dd/mm/yyyy)
170
+ </th>
171
+ <th rowSpan={6}>Diagnosis</th>
172
+ <th colSpan={13}>Delivery</th>
173
+ <th colSpan={9}></th>
174
+ <th>
175
+ VDRL/
176
+ <br />
177
+ RPR
178
+ <br />
179
+ Results
180
+ <br />
181
+ (Specify
182
+ <br />
183
+ 1-VDRL
184
+ <br />
185
+ 2-RPR
186
+ <br />
187
+ 3-Duo
188
+ <br />
189
+ testing)
190
+ </th>
191
+ <th colSpan={4}>Baby</th>
192
+ <th>
193
+ Maternal <br />
194
+ HAART
195
+ </th>
196
+ <th>
197
+ Infant <br />
198
+ Prophylaxis
199
+ </th>
200
+ <th>
201
+ Partner <br />
202
+ Tested for <br />
203
+ HIV
204
+ </th>
205
+ <th rowSpan={6}>
206
+ Counselled <br />
207
+ on infant <br />
208
+ feeding <br />
209
+ (Y/N/NA)
210
+ </th>
211
+ <th rowSpan={6}>
212
+ Delivery <br />
213
+ Conducted by <br />
214
+ (Enter Name)
215
+ </th>
216
+ <th rowSpan={6}>
217
+ Birth <br />
218
+ Notification <br />
219
+ Number
220
+ </th>
221
+ <th colSpan={2}>Discharge</th>
222
+ <th colSpan={3}>Referral</th>
223
+ <th rowSpan={6}>Comments</th>
224
+ </tr>
225
+ <tr>
226
+ <th rowSpan={5}>NUPI</th>
227
+ <th rowSpan={5}>Age</th>
228
+ <th rowSpan={5}>Phone number</th>
229
+ <th rowSpan={5}>
230
+ Duration of <br />
231
+ labour
232
+ <br />
233
+ (hours)
234
+ </th>
235
+ <th rowSpan={5}>
236
+ Date of
237
+ <br />
238
+ Delivery <br />
239
+ (dd/mm/yyyy)
240
+ </th>
241
+ <th rowSpan={5}>
242
+ Time of
243
+ <br />
244
+ Delivery
245
+ </th>
246
+ <th rowSpan={5}>
247
+ Gestation
248
+ <br />
249
+ at Birth
250
+ <br />
251
+ (wks)
252
+ </th>
253
+ <th rowSpan={5}>
254
+ Mode of <br />
255
+ Delivery <br />
256
+ 1) SVD
257
+ <br />
258
+ 2) CS
259
+ <br />
260
+ 3) Breech
261
+ <br />
262
+ 4) AVD
263
+ </th>
264
+ <th rowSpan={5}>
265
+ No.of babies <br />
266
+ delivered
267
+ </th>
268
+ <th rowSpan={5}>
269
+ Placenta
270
+ <br />
271
+ Complete <br />
272
+ 1=Yes
273
+ <br />
274
+ 2=No
275
+ <br />
276
+ 3=BBA
277
+ </th>
278
+ <th rowSpan={5}>
279
+ Uterotonic <br />
280
+ given <br />
281
+ 1=oxytocin <br />
282
+ 2=Carbetocin <br />
283
+ 3=Others <br />
284
+ Specify
285
+ <br />
286
+ 4= None
287
+ </th>
288
+ <th rowSpan={5}>
289
+ Vaginal
290
+ <br />
291
+ Examination
292
+ <br />
293
+ 1= Normal
294
+ <br />
295
+ 2=Episiotomy
296
+ <br />
297
+ 3=Vaginal tear
298
+ <br />
299
+ 4=FGM
300
+ <br />
301
+ 5=Vaginal warts
302
+ </th>
303
+ <th rowSpan={5}>
304
+ Blood
305
+ <br />
306
+ loss
307
+ <br />
308
+ (mls)
309
+ </th>
310
+ <th rowSpan={5}>
311
+ Mother's <br />
312
+ status after <br />
313
+ Delivery
314
+ <br />
315
+ (Alive/ <br />
316
+ Dead)
317
+ </th>
318
+ <th>
319
+ Maternal deaths <br />
320
+ Notified <br />
321
+ (Y/N/NA)
322
+ </th>
323
+ <th rowSpan={5}>
324
+ Delivery
325
+ <br />
326
+ Complications
327
+ <br />
328
+ 1=A.P.H. (Ante Partum <br />
329
+ Haemorrhage); <br />
330
+ 2=P.P.H. (Post Partum <br />
331
+ Haemorrhage); <br />
332
+ 3= Eclampsia; <br />
333
+ 4=Ruptured Uterus;
334
+ <br />
335
+ 5=Obstructed labour; <br />
336
+ 6=Sepsis <br />
337
+ 7= NA
338
+ </th>
339
+ <th rowSpan={5}>
340
+ APGAR <br />
341
+ Score
342
+ </th>
343
+ <th rowSpan={5}>
344
+ Birth
345
+ <br />
346
+ Outcome
347
+ <br />
348
+ (LB/FSB/ <br />
349
+ MSB)
350
+ </th>
351
+ <th rowSpan={5}>
352
+ Birth <br />
353
+ Weight
354
+ <br />
355
+ (grams)
356
+ </th>
357
+ <th rowSpan={5}>
358
+ Sex <br />
359
+ (M/F)
360
+ </th>
361
+ <th>
362
+ Initiated on <br />
363
+ BF in
364
+ <br />
365
+ &lt; 1hr
366
+ <br />
367
+ (Y/N)
368
+ </th>
369
+ <th rowSpan={5}>
370
+ TEO
371
+ <br />
372
+ given at
373
+ <br />
374
+ birth? <br />
375
+ (Y/N)
376
+ </th>
377
+ <th rowSpan={5}>
378
+ Chlorhexidine <br />
379
+ applied on <br />
380
+ cord stump
381
+ <br />
382
+ (Y/N)
383
+ </th>
384
+ <th>
385
+ Birth with <br />
386
+ deformity <br />
387
+ (Y/N)
388
+ </th>
389
+ <th rowSpan={5}>
390
+ Given
391
+ <br />
392
+ Vitamin <br />
393
+ K <br />
394
+ (Y/N)
395
+ </th>
396
+ <th rowSpan={5}>(P/N/ND)</th>
397
+ <th>HIV Test 1</th>
398
+ <th>HIV Test 2</th>
399
+ <th>HIV Test 3</th>
400
+ <th>
401
+ HIV Result <br />
402
+ Maternity <br />
403
+ (N/P/Inc/U/NA)
404
+ </th>
405
+ <th>
406
+ Start at <br />
407
+ Maternity
408
+ </th>
409
+ <th rowSpan={5}>(Y/N/NA)</th>
410
+ <th rowSpan={5}>(Y/N/NA)</th>
411
+ <th rowSpan={5}>
412
+ Date <br />
413
+ (dd/mm/yyyy)
414
+ </th>
415
+ <th rowSpan={5}>
416
+ Status of <br />
417
+ Baby
418
+ <br />
419
+ A= Alive
420
+ <br />
421
+ D= Dead
422
+ </th>
423
+ <th>From</th>
424
+ <th>To</th>
425
+ <th rowSpan={5}>Reason for referral</th>
426
+ </tr>
427
+ <tr>
428
+ <th rowSpan={4}>
429
+ Date Death <br />
430
+ notified
431
+ </th>
432
+ <th rowSpan={4}>
433
+ Kangaroo <br />
434
+ Mother <br />
435
+ Care <br />
436
+ (Y/N)
437
+ </th>
438
+ <th rowSpan={4}>
439
+ 1- congenital <br />
440
+ syphilis.
441
+ <br />
442
+ 2- spina bifida, <br />
443
+ 3- Hydrocephalus,
444
+ <br />
445
+ 4- Talipes
446
+ </th>
447
+ <th>Kit Name:</th>
448
+ <th>Kit Name:</th>
449
+ <th>Kit Name:</th>
450
+ <th rowSpan={4}>
451
+ Initial/Retest/
452
+ <br />
453
+ NA
454
+ </th>
455
+ <th rowSpan={4}>(Y/N/NA)</th>
456
+ <th rowSpan={4}>
457
+ 1= From Community <br />
458
+ Unit,
459
+ <br />
460
+ 2= From Another
461
+ <br />
462
+ Health Facility, <br />
463
+ 3=Not Applicable
464
+ </th>
465
+ <th rowSpan={4}>
466
+ 1= To Community
467
+ <br />
468
+ Unit, <br />
469
+ 2=Referred to HIV <br />
470
+ preventive services
471
+ <br />
472
+ 3=Another Health <br />
473
+ Facility,
474
+ <br />
475
+ 4=Not Applicable
476
+ </th>
477
+ </tr>
478
+ <tr>
479
+ <th>Lot No.</th>
480
+ <th>Lot No.</th>
481
+ <th>Lot No.</th>
482
+ </tr>
483
+ <tr>
484
+ <th>Expiry / /</th>
485
+ <th>Expiry / /</th>
486
+ <th>Expiry / /</th>
487
+ </tr>
488
+ <tr>
489
+ <th>(N/P/I/NA)</th>
490
+ <th>(N/P/I/NA)</th>
491
+ <th>(N/P/I/NA)</th>
492
+ </tr>
493
+ </thead>
494
+ <tbody>
495
+ <tr>
496
+ <td className={styles.textCentre}>(a)</td>
497
+ <td className={styles.textCentre}>(b)</td>
498
+ <td className={styles.textCentre}>(c)</td>
499
+ <td className={styles.textCentre}>(d)</td>
500
+ <td className={styles.textCentre}>(e)</td>
501
+ <td className={styles.textCentre}>(f)</td>
502
+ <td className={styles.textCentre}>(g)</td>
503
+ <td className={styles.textCentre}>(h)</td>
504
+ <td className={styles.textCentre}>(i)</td>
505
+ <td className={styles.textCentre}>(j)</td>
506
+ <td className={styles.textCentre}>(k)</td>
507
+ <td className={styles.textCentre}>(l)</td>
508
+ <td className={styles.textCentre}>(m)</td>
509
+ <td className={styles.textCentre}>(n)</td>
510
+ <td className={styles.textCentre}>(o)</td>
511
+ <td className={styles.textCentre}>(p)</td>
512
+ <td className={styles.textCentre}>(q)</td>
513
+ <td className={styles.textCentre}>(r)</td>
514
+ <td className={styles.textCentre}>(s)</td>
515
+ <td className={styles.textCentre}>(t)</td>
516
+ <td className={styles.textCentre}>(u)</td>
517
+ <td className={styles.textCentre}>(v)</td>
518
+ <td className={styles.textCentre}>(w)</td>
519
+ <td className={styles.textCentre}>(x)</td>
520
+ <td className={styles.textCentre}>(y)</td>
521
+ <td className={styles.textCentre}>(z)</td>
522
+ <td className={styles.textCentre}>(aa)</td>
523
+ <td className={styles.textCentre}>(ab)</td>
524
+ <td className={styles.textCentre}>(ac)</td>
525
+ <td className={styles.textCentre}>(ad)</td>
526
+ <td className={styles.textCentre}>(ae)</td>
527
+ <td className={styles.textCentre}>(af)</td>
528
+ <td className={styles.textCentre}>(ag)</td>
529
+ <td className={styles.textCentre}>(ah)</td>
530
+ <td className={styles.textCentre}>(ai)</td>
531
+ <td className={styles.textCentre}>(aj)</td>
532
+ <td colSpan={3} className={styles.textCentre}>
533
+ (ak)
534
+ </td>
535
+ <td className={styles.textCentre}>(al)</td>
536
+ <td className={styles.textCentre}>(am)</td>
537
+ <td className={styles.textCentre}>(an)</td>
538
+ <td className={styles.textCentre}>(ao)</td>
539
+ <td className={styles.textCentre}>(ap)</td>
540
+ <td className={styles.textCentre}>(aq)</td>
541
+ <td className={styles.textCentre}>(ar)</td>
542
+ <td className={styles.textCentre}>(as)</td>
543
+ <td className={styles.textCentre}>(at)</td>
544
+ <td className={styles.textCentre}>(au)</td>
545
+ <td className={styles.textCentre}>(av)</td>
546
+ <td className={styles.textCentre}>(aw)</td>
547
+ <td className={styles.textCentre}>(ax)</td>
548
+ <td className={styles.textCentre}>(ay)</td>
549
+ </tr>
550
+ {patientlist?.length > 0 ? (
551
+ patientlist.map((row, i) => (
552
+ <React.Fragment key={i}>
553
+ <tr>
554
+ <td rowSpan={2}>
555
+ {row.admission_date ? new Date(row.admission_date).toLocaleDateString('en-GB') : ''}
556
+ </td>
557
+ <td rowSpan={2}>{row.cr_id}</td>
558
+ <td>{row.admission_number}</td>
559
+ <td rowSpan={2}>{row.full_names}</td>
520
560
 
521
- <td>{row.date_of_birth ? new Date(row.date_of_birth).toLocaleDateString('en-GB') : ''}</td>
561
+ <td>{row.date_of_birth ? new Date(row.date_of_birth).toLocaleDateString('en-GB') : ''}</td>
522
562
 
523
- <td rowSpan={2}>{row.subcounty_county}</td>
524
- <td>{row.village_estate_landmark}</td>
525
- <td rowSpan={2}>{row.marital_status}</td>
526
- <td rowSpan={2}>{row.parity}</td>
527
- <td rowSpan={2}>{row.gravidae}</td>
528
- <td rowSpan={2}>{row.no_of_anc_visits}</td>
563
+ <td rowSpan={2}>{row.subcounty_county}</td>
564
+ <td>{row.village_estate_landmark}</td>
565
+ <td rowSpan={2}>{row.marital_status}</td>
566
+ <td rowSpan={2}>{row.parity}</td>
567
+ <td rowSpan={2}>{row.gravidae}</td>
568
+ <td rowSpan={2}>{row.no_of_anc_visits}</td>
529
569
 
530
- <td rowSpan={2}>{row.lmp ? new Date(row.lmp).toLocaleDateString('en-GB') : ''}</td>
570
+ <td rowSpan={2}>{row.lmp ? new Date(row.lmp).toLocaleDateString('en-GB') : ''}</td>
531
571
 
532
- <td rowSpan={2}>{row.edd ? new Date(row.edd).toLocaleDateString('en-GB') : ''}</td>
572
+ <td rowSpan={2}>{row.edd ? new Date(row.edd).toLocaleDateString('en-GB') : ''}</td>
533
573
 
534
- <td rowSpan={2}>{row.diagnosis}</td>
535
- <td rowSpan={2}>{row.duration_of_labour}</td>
574
+ <td rowSpan={2}>{row.diagnosis}</td>
575
+ <td rowSpan={2}>{row.duration_of_labour}</td>
536
576
 
537
- <td rowSpan={2}>
538
- {row.date_of_delivery ? new Date(row.date_of_delivery).toLocaleDateString('en-GB') : ''}
539
- </td>
577
+ <td rowSpan={2}>
578
+ {row.date_of_delivery ? new Date(row.date_of_delivery).toLocaleDateString('en-GB') : ''}
579
+ </td>
540
580
 
541
- <td rowSpan={2}>{row.time_of_delivery}</td>
542
- <td rowSpan={2}>{row.gestation_at_birth}</td>
543
- <td rowSpan={2}>{row.mode_of_delivery}</td>
544
- <td rowSpan={2}>{row.no_of_babies_delivered}</td>
545
- <td rowSpan={2}>{row.placenta_complete}</td>
546
- <td rowSpan={2}>{row.uterotonic_given}</td>
547
- <td rowSpan={2}>{row.vaginal_examination}</td>
548
- <td rowSpan={2}>{row.blood_loss}</td>
549
- <td rowSpan={2}>{row.mother_status_after_delivery}</td>
581
+ <td rowSpan={2}>{row.time_of_delivery}</td>
582
+ <td rowSpan={2}>{row.gestation_at_birth}</td>
583
+ <td rowSpan={2}>{row.mode_of_delivery}</td>
584
+ <td rowSpan={2}>{row.no_of_babies_delivered}</td>
585
+ <td rowSpan={2}>{row.placenta_complete}</td>
586
+ <td rowSpan={2}>{row.uterotonic_given}</td>
587
+ <td rowSpan={2}>{row.vaginal_examination}</td>
588
+ <td rowSpan={2}>{row.blood_loss}</td>
589
+ <td rowSpan={2}>{row.mother_status_after_delivery}</td>
550
590
 
551
- <td>{row.maternal_deaths_notified}</td>
591
+ <td>{row.maternal_deaths_notified}</td>
552
592
 
553
- <td rowSpan={2}>{row.delivery_complications}</td>
554
- <td rowSpan={2}>{row.apgar_score}</td>
555
- <td rowSpan={2}>{row.birth_outcome}</td>
556
- <td rowSpan={2}>{row.birth_weight}</td>
557
- <td rowSpan={2}>{row.sex}</td>
593
+ <td rowSpan={2}>{row.delivery_complications}</td>
594
+ <td rowSpan={2}>{row.apgar_score}</td>
595
+ <td rowSpan={2}>{row.birth_outcome}</td>
596
+ <td rowSpan={2}>{row.birth_weight}</td>
597
+ <td rowSpan={2}>{row.sex}</td>
558
598
 
559
- <td>{row.initiated_on_bf_less_one_hour}</td>
599
+ <td>{row.initiated_on_bf_less_one_hour}</td>
560
600
 
561
- <td rowSpan={2}>{row.teo_given_at_birth}</td>
562
- <td rowSpan={2}>{row.chlorhexdine_applied_on_cord_stump}</td>
563
- <td>{row.birth_with_deformity}</td>
564
- <td rowSpan={2}>{row.given_vitamin_k}</td>
601
+ <td rowSpan={2}>{row.teo_given_at_birth}</td>
602
+ <td rowSpan={2}>{row.chlorhexdine_applied_on_cord_stump}</td>
603
+ <td>{row.birth_with_deformity}</td>
604
+ <td rowSpan={2}>{row.given_vitamin_k}</td>
565
605
 
566
- <td>{row.duo_test_result}</td>
606
+ <td>{row.duo_test_result}</td>
567
607
 
568
- <td rowSpan={2}>
569
- {row.hiv_test_1_kit_name} / {row.hiv_test_1_lot_no} /{' '}
570
- {row.hiv_test_1_expiry_date
571
- ? new Date(row.hiv_test_1_expiry_date).toLocaleDateString('en-GB')
572
- : ''}
573
- </td>
608
+ <td rowSpan={2}>
609
+ {row.hiv_test_1_kit_name} / {row.hiv_test_1_lot_no} /{' '}
610
+ {row.hiv_test_1_expiry_date
611
+ ? new Date(row.hiv_test_1_expiry_date).toLocaleDateString('en-GB')
612
+ : ''}
613
+ </td>
574
614
 
575
- <td rowSpan={2}>
576
- {row.hiv_test_2_kit_name} / {row.hiv_test_2_lot_no} /{' '}
577
- {row.hiv_test_2_expiry_date
578
- ? new Date(row.hiv_test_2_expiry_date).toLocaleDateString('en-GB')
579
- : ''}
580
- </td>
615
+ <td rowSpan={2}>
616
+ {row.hiv_test_2_kit_name} / {row.hiv_test_2_lot_no} /{' '}
617
+ {row.hiv_test_2_expiry_date
618
+ ? new Date(row.hiv_test_2_expiry_date).toLocaleDateString('en-GB')
619
+ : ''}
620
+ </td>
581
621
 
582
- <td rowSpan={2}>
583
- {row.hiv_test_3_kit_name} / {row.hiv_test_3_lot_no} /{' '}
584
- {row.hiv_test_3_expiry_date
585
- ? new Date(row.hiv_test_3_expiry_date).toLocaleDateString('en-GB')
586
- : ''}
587
- </td>
622
+ <td rowSpan={2}>
623
+ {row.hiv_test_3_kit_name} / {row.hiv_test_3_lot_no} /{' '}
624
+ {row.hiv_test_3_expiry_date
625
+ ? new Date(row.hiv_test_3_expiry_date).toLocaleDateString('en-GB')
626
+ : ''}
627
+ </td>
588
628
 
589
- <td>{row.hiv_test_results_maternity}</td>
629
+ <td>{row.hiv_test_results_maternity}</td>
590
630
 
591
- <td rowSpan={2}>{row.maternal_haart}</td>
592
- <td rowSpan={2}>{row.infant_prophylaxis}</td>
593
- <td rowSpan={2}>{row.partner_tested_for_hiv}</td>
594
- <td rowSpan={2}>{row.counselled_on_infant_feeding}</td>
595
- <td rowSpan={2}>{row.deleivery_conducted_by}</td>
596
- <td rowSpan={2}>{row.birth_notification_number}</td>
631
+ <td rowSpan={2}>{row.maternal_haart}</td>
632
+ <td rowSpan={2}>{row.infant_prophylaxis}</td>
633
+ <td rowSpan={2}>{row.partner_tested_for_hiv}</td>
634
+ <td rowSpan={2}>{row.counselled_on_infant_feeding}</td>
635
+ <td rowSpan={2}>{row.deleivery_conducted_by}</td>
636
+ <td rowSpan={2}>{row.birth_notification_number}</td>
597
637
 
598
- <td rowSpan={2}>
599
- {row.discharge_date ? new Date(row.discharge_date).toLocaleDateString('en-GB') : ''}
600
- </td>
638
+ <td rowSpan={2}>
639
+ {row.discharge_date ? new Date(row.discharge_date).toLocaleDateString('en-GB') : ''}
640
+ </td>
601
641
 
602
- <td rowSpan={2}>{row.discharge_status_of_baby}</td>
603
- <td rowSpan={2}>{row.referrals_from}</td>
604
- <td rowSpan={2}>{row.referrals_to}</td>
605
- <td rowSpan={2}>{row.reasons_for_refferal}</td>
606
- <td rowSpan={2}>{row.comments}</td>
607
- </tr>
642
+ <td rowSpan={2}>{row.discharge_status_of_baby}</td>
643
+ <td rowSpan={2}>{row.referrals_from}</td>
644
+ <td rowSpan={2}>{row.referrals_to}</td>
645
+ <td rowSpan={2}>{row.reasons_for_refferal}</td>
646
+ <td rowSpan={2}>{row.comments}</td>
647
+ </tr>
608
648
 
609
- <tr>
610
- <td>{row.nupi}</td>
611
- <td>{row.age}</td>
612
- <td>{row.phone_number}</td>
649
+ <tr>
650
+ <td>{row.nupi}</td>
651
+ <td>{row.age}</td>
652
+ <td>{row.phone_number}</td>
613
653
 
614
- <td>
615
- {row.date_maternal_death_notified
616
- ? new Date(row.date_maternal_death_notified).toLocaleDateString('en-GB')
617
- : ''}
618
- </td>
654
+ <td>
655
+ {row.date_maternal_death_notified
656
+ ? new Date(row.date_maternal_death_notified).toLocaleDateString('en-GB')
657
+ : ''}
658
+ </td>
619
659
 
620
- <td>{row.kangaroo_mother_care}</td>
621
- <td>{row.type_of_deformity}</td>
622
- <td>{row.hiv_test_type}</td>
623
- <td>{row.hiv_test_type}</td>
624
- </tr>
625
- </React.Fragment>
626
- ))
627
- ) : (
628
- <tr>
629
- <td colSpan={moh333Columns.length}>No data available</td>
630
- </tr>
631
- )}
632
- </tbody>
633
- </table>
634
- </div>
635
- </RegisterLayout>
660
+ <td>{row.kangaroo_mother_care}</td>
661
+ <td>{row.type_of_deformity}</td>
662
+ <td>{row.hiv_test_type}</td>
663
+ <td>{row.hiv_test_type}</td>
664
+ </tr>
665
+ </React.Fragment>
666
+ ))
667
+ ) : isGenerated ? (
668
+ <tr>
669
+ <td colSpan={moh333Columns.length}>No data available</td>
670
+ </tr>
671
+ ) : null}
672
+ </tbody>
673
+ </table>
674
+ </div>
675
+ </RegisterLayout>
676
+ </>
636
677
  );
637
678
  };
638
679