@ampath/esm-reports-app 1.0.0-next.59 → 1.0.0-next.60

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.
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+
3
+ import styles from './moh-510.scss';
4
+ import { useSearchParams } from 'react-router-dom';
5
+ import { RegisterLayout, usePatientList } from '../../../../common/report-register';
6
+ import { getMoh710PatientList } from '../../../../resources/moh-710.resource';
7
+ import { moh510ExportColumns } from './moh-510.columns';
8
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
9
+ import classNames from 'classnames';
10
+
11
+ interface Moh510RegisterComponentProps {}
12
+
13
+ const Moh510RegisterComponent: React.FC<Moh510RegisterComponentProps> = () => {
14
+ const [searchParams] = useSearchParams();
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 = 'moh710Report';
20
+
21
+ const {
22
+ rows: patientlist,
23
+ total,
24
+ isTotalExact,
25
+ isLoading,
26
+ page,
27
+ pageSize,
28
+ onPageChange,
29
+ fetchAll,
30
+ } = usePatientList(
31
+ ({ startIndex, limit }) =>
32
+ getMoh710PatientList({
33
+ startDate: startDate!,
34
+ endDate: endDate!,
35
+ locationUuids: locationUuids!,
36
+ indicator: indicator!,
37
+ startIndex,
38
+ limit,
39
+ reportName: reportName,
40
+ }),
41
+ [startDate, endDate, locationUuids, indicator],
42
+ );
43
+ return (
44
+ <RegisterLayout
45
+ parentLabel="MOH-705A Report"
46
+ parentPath="/moh-705a"
47
+ title="MOH 204A Under-5 Outpatient Register"
48
+ isLoading={isLoading}
49
+ isEmpty={patientlist.length === 0}
50
+ page={page}
51
+ pageSize={pageSize}
52
+ total={total}
53
+ isTotalExact={isTotalExact}
54
+ onPageChange={onPageChange}
55
+ fetchAll={fetchAll}
56
+ columns={moh510ExportColumns}
57
+ >
58
+ <div className={styles.tableContainer}>
59
+ <Table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
60
+ <TableHead>
61
+ <TableRow>
62
+ <TableHeader>Date (DD/MM/YYYY)</TableHeader>
63
+ <TableHeader>Serial Number</TableHeader>
64
+ <TableHeader>Child's Number</TableHeader>
65
+ <TableHeader>Child's Names</TableHeader>
66
+ <TableHeader>Sex</TableHeader>
67
+ <TableHeader>Date of Birth</TableHeader>
68
+ <TableHeader>Date first Seen</TableHeader>
69
+ <TableHeader>Father's Full Names/Guardian</TableHeader>
70
+ <TableHeader>Mother's Full Names/Guardian</TableHeader>
71
+ <TableHeader>Village /Estate / Landmark</TableHeader>
72
+ <TableHeader>Telephone No.</TableHeader>
73
+ <TableHeader>BCG</TableHeader>
74
+ <TableHeader>Polio birth Dose</TableHeader>
75
+ <TableHeader>OPV 1</TableHeader>
76
+ <TableHeader>OPV 2</TableHeader>
77
+ <TableHeader>OPV 3</TableHeader>
78
+ <TableHeader>IPV</TableHeader>
79
+ <TableHeader>DPT / Hep.B / Hib.1</TableHeader>
80
+ <TableHeader>DPT / Hep.B / Hib.2</TableHeader>
81
+ <TableHeader>DPT / Hep.B / Hib.3</TableHeader>
82
+ <TableHeader>PCV 10 (Pneumococcal)</TableHeader>
83
+ <TableHeader>PCV 10 (Pneumococcal)</TableHeader>
84
+ <TableHeader>PCV 10 (Pneumococcal)</TableHeader>
85
+ <TableHeader>Rota1</TableHeader>
86
+ <TableHeader>Rota2</TableHeader>
87
+ <TableHeader>Vitamin A(6-11 months)</TableHeader>
88
+ <TableHeader>MR1</TableHeader>
89
+ <TableHeader>Yellow Fever</TableHeader>
90
+ <TableHeader>Fully Immunized Child</TableHeader>
91
+ <TableHeader>MR2</TableHeader>
92
+ <TableHeader>Remarks</TableHeader>
93
+ </TableRow>
94
+ </TableHead>
95
+ <TableBody>
96
+ {patientlist?.length > 0 ? (
97
+ patientlist?.map((patient, i) => (
98
+ <TableRow key={patient.person_id || patient.id}>
99
+ <TableCell>{patient.date}</TableCell>
100
+ <TableCell>{i + 1}</TableCell>
101
+ <TableCell>{patient.child_number}</TableCell>
102
+ <TableCell>{patient.child_names}</TableCell>
103
+ <TableCell>{patient.sex}</TableCell>
104
+ <TableCell>{patient.date_of_birth}</TableCell>
105
+ <TableCell>{patient.date_first_seen}</TableCell>
106
+ <TableCell>{patient.father_names}</TableCell>
107
+ <TableCell>{patient.mother_names}</TableCell>
108
+ <TableCell>{patient.village_estate_landmark}</TableCell>
109
+ <TableCell>{patient.phone_number}</TableCell>
110
+ <TableCell>{patient.bcg}</TableCell>
111
+ <TableCell>{patient.polio_birth_dose}</TableCell>
112
+ <TableCell>{patient.opv_1}</TableCell>
113
+ <TableCell>{patient.opv_2}</TableCell>
114
+ <TableCell>{patient.opv_3}</TableCell>
115
+ <TableCell>{patient.ipv}</TableCell>
116
+ <TableCell>{patient.dpt_hep_1}</TableCell>
117
+ <TableCell>{patient.dpt_hep_2}</TableCell>
118
+ <TableCell>{patient.dpt_hep_3}</TableCell>
119
+ <TableCell>{patient.pneumococcal_1}</TableCell>
120
+ <TableCell>{patient.pneumococcal_2}</TableCell>
121
+ <TableCell>{patient.pneumococcal_3}</TableCell>
122
+ <TableCell>{patient.rotavirus_1}</TableCell>
123
+ <TableCell>{patient.rotavirus_2}</TableCell>
124
+ <TableCell>{patient.vitamin_a_6_11_months}</TableCell>
125
+ <TableCell>{patient.measles_rubella_1}</TableCell>
126
+ <TableCell>{patient.yellow_fever}</TableCell>
127
+ <TableCell>{patient.fully_immunized_child}</TableCell>
128
+ <TableCell>{patient.measles_rubella_2}</TableCell>
129
+ <TableCell>{patient.remarks}</TableCell>
130
+ </TableRow>
131
+ ))
132
+ ) : (
133
+ <TableRow>
134
+ <TableCell colSpan={28}>No data available</TableCell>
135
+ </TableRow>
136
+ )}
137
+ </TableBody>
138
+ </Table>
139
+ </div>
140
+ </RegisterLayout>
141
+ );
142
+ };
143
+
144
+ export default Moh510RegisterComponent;
@@ -0,0 +1,130 @@
1
+ @use '@openmrs/esm-styleguide/src/vars' as *;
2
+
3
+ /* MOH-705A laid out for A4, on the same scale as the other reports. Its 76 rows
4
+ are a single diagnoses table, so the sheet is one continuous form: masthead,
5
+ facility strip, table and sign-off share their edges. */
6
+
7
+ $ink: #000;
8
+ $rule: 1px solid $ink;
9
+
10
+ $text: 7pt;
11
+ $title: 7.5pt;
12
+ $meta: 6.5pt;
13
+
14
+ $pad: 3mm;
15
+
16
+ .mainTitleBox {
17
+ padding: $pad;
18
+ text-align: center;
19
+ border: $rule;
20
+ }
21
+
22
+ .ministry {
23
+ font-size: $meta;
24
+ }
25
+
26
+ .reportTitle {
27
+ font-size: $title;
28
+ font-weight: 700;
29
+ color: $ink;
30
+ }
31
+
32
+ .location {
33
+ display: flex;
34
+ flex-wrap: nowrap;
35
+ align-items: baseline;
36
+ justify-content: space-between;
37
+ gap: 2.5mm;
38
+ padding: 2mm $pad;
39
+ font-size: $meta;
40
+ white-space: nowrap;
41
+ border: $rule;
42
+ border-top: none;
43
+ }
44
+
45
+ .line,
46
+ .shortLine {
47
+ display: inline-block;
48
+ padding: 0 0.5mm;
49
+ margin-left: 1mm;
50
+ overflow: hidden;
51
+ font-weight: 600;
52
+ text-align: center;
53
+ text-overflow: ellipsis;
54
+ vertical-align: bottom;
55
+ border-bottom: $rule;
56
+ }
57
+
58
+ .line {
59
+ width: 26mm;
60
+ }
61
+
62
+ .shortLine {
63
+ width: 14mm;
64
+ }
65
+
66
+ .container {
67
+ overflow-x: auto;
68
+ margin: 0;
69
+ }
70
+
71
+ .table {
72
+ width: 100%;
73
+ border-collapse: collapse;
74
+ }
75
+
76
+ .tableBordered td,
77
+ .tableBordered th {
78
+ padding: 1mm 1.5mm;
79
+ font-size: $text;
80
+ text-align: left;
81
+ border: $rule;
82
+ }
83
+
84
+ .tableBordered th {
85
+ font-weight: 700;
86
+ color: $ink;
87
+ background-color: #f0f0f0;
88
+ }
89
+
90
+ .tableStriped tbody tr:nth-of-type(odd) {
91
+ background-color: #fafafa;
92
+ }
93
+
94
+ @media screen {
95
+ .tableStriped tbody tr:hover {
96
+ background-color: $brand-primary-10;
97
+ }
98
+ }
99
+
100
+ /* Sign-off, enclosed by the form. Three fields across the sheet, so its rules
101
+ are wider than the header strip's five. */
102
+
103
+ .signOff {
104
+ display: flex;
105
+ flex-wrap: nowrap;
106
+ align-items: baseline;
107
+ justify-content: space-between;
108
+ gap: 2.5mm;
109
+ padding: $pad;
110
+ font-size: $meta;
111
+ white-space: nowrap;
112
+ border: $rule;
113
+ border-top: none;
114
+
115
+ .line {
116
+ width: 45mm;
117
+ }
118
+
119
+ .shortLine {
120
+ width: 25mm;
121
+ }
122
+ }
123
+
124
+ /* On paper the striping is screen affordance that prints as grey noise */
125
+
126
+ @media print {
127
+ .tableStriped tbody tr:nth-of-type(odd) {
128
+ background-color: transparent;
129
+ }
130
+ }
@@ -512,7 +512,7 @@ const Moh333Register: React.FC = () => {
512
512
  <td rowSpan={2}>
513
513
  {row.date_of_admission ? new Date(row.date_of_admission).toLocaleDateString('en-GB') : ''}
514
514
  </td>
515
- <td rowSpan={2}>{row.amrsID}</td>
515
+ <td rowSpan={2}>{row.amrs_id}</td>
516
516
  <td>{row.admission_number}</td>
517
517
  <td rowSpan={2}>{row.full_names}</td>
518
518
 
@@ -405,8 +405,8 @@ const Moh405Register: React.FC = () => {
405
405
  {patient.date_of_visit ? new Date(patient.date_of_visit).toLocaleDateString('en-GB') : ''}
406
406
  </td>
407
407
  <td>{patient.anc_number}</td>
408
- <td rowSpan={2}>{patient.anc_number_NUPI}</td>
409
- <td rowSpan={2}>{patient.amrsID}</td>
408
+ <td rowSpan={2}>{patient.anc_number}</td>
409
+ <td rowSpan={2}>{patient.amrs_id}</td>
410
410
  <td rowSpan={2}>{patient.number_of_anc_visits}</td>
411
411
  <td rowSpan={2}>{patient.full_names}</td>
412
412
  <td>{patient.date_of_birth ? new Date(patient.date_of_birth).toLocaleDateString('en-GB') : ''}</td>
@@ -476,7 +476,7 @@ const Moh405Register: React.FC = () => {
476
476
  </tr>
477
477
 
478
478
  <tr>
479
- <td>{patient.NUPI}</td>
479
+ <td>{patient.nupi}</td>
480
480
  <td>{patient.age}</td>
481
481
  <td>{patient.phone_number}</td>
482
482
  <td>{patient.fgm_complications}</td>
@@ -438,7 +438,7 @@ const Moh406Register: React.FC = () => {
438
438
  </td>
439
439
  <td>{patient.pnc_number}</td>
440
440
  <td rowSpan={2}>{patient.pnc_number}</td>
441
- <td rowSpan={2}>{patient.amrsID}</td>
441
+ <td rowSpan={2}>{patient.amrs_id}</td>
442
442
  <td rowSpan={2}>{patient.full_names}</td>
443
443
 
444
444
  <td>{patient.date_of_birth ? new Date(patient.date_of_birth).toLocaleDateString('en-GB') : ''}</td>
@@ -509,7 +509,7 @@ const Moh406Register: React.FC = () => {
509
509
  <td>{patient.phone_number}</td>
510
510
  <td>{patient.pallor}</td>
511
511
  <td>{patient.cervical_cancer_results}</td>
512
- <td>{patient.family_planning_method}</td>
512
+ <td>{patient.women_received_post_partum_fp}</td>
513
513
  </tr>
514
514
  </React.Fragment>
515
515
  ))
@@ -55,14 +55,14 @@ const FamilyPlanningComponent: React.FC<FamilyPlanningComponentProps> = ({ moh71
55
55
  <td>5</td>
56
56
  <td rowSpan={2}>Injectables</td>
57
57
  <td>FP Injections DMPA- IM</td>
58
- <td>{moh711Data.fp_injections_dmpa_im}</td>
59
- <td></td>
58
+ <td>{moh711Data.fp_injections_dmpa_im_new}</td>
59
+ <td>{moh711Data.fp_injections_dmpa_im_revisit}</td>
60
60
  </tr>
61
61
  <tr>
62
62
  <td>6</td>
63
63
  <td>FP Injections DMPA- SC</td>
64
- <td>{moh711Data.fp_injections_dmpa_sc}</td>
65
- <td></td>
64
+ <td>{moh711Data.fp_injections_dmpa_sc_new}</td>
65
+ <td>{moh711Data.fp_injections_dmpa_sc_revisit}</td>
66
66
  </tr>
67
67
  <tr>
68
68
  <td>7</td>
@@ -112,40 +112,40 @@ const FamilyPlanningComponent: React.FC<FamilyPlanningComponentProps> = ({ moh71
112
112
  <td>12</td>
113
113
  <td rowSpan={2}>Implants</td>
114
114
  <td>1 Rod</td>
115
- <td></td>
116
- <td></td>
115
+ <td>{moh711Data.implants_insertion_1_rod_first_time}</td>
116
+ <td>{moh711Data.implants_insertion_1_rod_re_insertion}</td>
117
117
  </tr>
118
118
  <tr>
119
119
  <td>13</td>
120
120
  <td>2 Rods</td>
121
- <td></td>
122
- <td></td>
121
+ <td>{moh711Data.implants_insertion_2_rod_first_time}</td>
122
+ <td>{moh711Data.implants_insertion_2_rod_re_insertion}</td>
123
123
  </tr>
124
124
  <tr>
125
125
  <td>14</td>
126
126
  <td rowSpan={2}>I.U.C.D insertion</td>
127
127
  <td>Hormonal</td>
128
- <td>{moh711Data.iucd_hormonal}</td>
129
- <td></td>
128
+ <td>{moh711Data.iucd_hormonal_first_time}</td>
129
+ <td>{moh711Data.iucd_hormonal_re_insertion}</td>
130
130
  </tr>
131
131
  <tr>
132
132
  <td>15</td>
133
133
  <td>Non Hormonal</td>
134
- <td>{moh711Data.iucd_non_hormonal}</td>
135
- <td></td>
134
+ <td>{moh711Data.iucd_non_hormonal_first_time}</td>
135
+ <td>{moh711Data.iucd_non_hormonal_re_insertion}</td>
136
136
  </tr>
137
137
  <tr>
138
138
  <td>16</td>
139
139
  <td rowSpan={2}>Voluntary surgical contraception</td>
140
140
  <td>BTL</td>
141
- <td>{moh711Data.surgical_contraception_btl}</td>
142
- <td className={styles.greyBackground}></td>
141
+ <td>{moh711Data.surgical_contraception_btl_first_time}</td>
142
+ <td className={styles.greyBackground}>{moh711Data.surgical_contraception_btl_re_insertion}</td>
143
143
  </tr>
144
144
  <tr>
145
145
  <td>17</td>
146
146
  <td>Vasectomy</td>
147
- <td>{moh711Data.vasectomy} </td>
148
- <td className={styles.greyBackground}></td>
147
+ <td>{moh711Data.vasectomy_insertion} </td>
148
+ <td className={styles.greyBackground}>{moh711Data.vasectomy_re_insertion}</td>
149
149
  </tr>
150
150
  <tr>
151
151
  <th colSpan={3}></th>
@@ -156,14 +156,14 @@ const FamilyPlanningComponent: React.FC<FamilyPlanningComponentProps> = ({ moh71
156
156
  <td>18</td>
157
157
  <td rowSpan={2}>Removals</td>
158
158
  <td>I.U.C.D</td>
159
- <td>{moh711Data.iucd_removals}</td>
160
- <td className={styles.greyBackground}></td>
159
+ <td>{moh711Data.iucd_removals_new}</td>
160
+ <td className={styles.greyBackground}>{moh711Data.iucd_removals_revisit}</td>
161
161
  </tr>
162
162
  <tr>
163
163
  <td>19</td>
164
164
  <td>Implants</td>
165
- <td>{moh711Data.implants_removal}</td>
166
- <td className={styles.greyBackground}></td>
165
+ <td>{moh711Data.implants_removal_new}</td>
166
+ <td className={styles.greyBackground}>{moh711Data.implants_removal_revisit}</td>
167
167
  </tr>
168
168
  <tr>
169
169
  <td>20</td>
@@ -203,8 +203,8 @@ const FamilyPlanningComponent: React.FC<FamilyPlanningComponentProps> = ({ moh71
203
203
  <tr>
204
204
  <td>25</td>
205
205
  <td>3 days to 6 weeks</td>
206
- <td>{moh711Data.post_partum_fp_4_6_weeks_new}</td>
207
- <td className={styles.greyBackground}>{moh711Data.post_partum_fp_4_6_weeks_revisit}</td>
206
+ <td>{moh711Data.post_partum_fp_3days_6_weeks_new}</td>
207
+ <td className={styles.greyBackground}>{moh711Data.post_partum_fp_3days_6_weeks_revisit}</td>
208
208
  </tr>
209
209
  <tr>
210
210
  <td>26</td>
@@ -6,6 +6,9 @@ interface Moh710Params {
6
6
  startDate?: string;
7
7
  endDate?: string;
8
8
  indicator?: string | string[];
9
+ startIndex?: number;
10
+ limit?: number;
11
+ reportName?: string;
9
12
  }
10
13
 
11
14
  export async function getMoh710(params: Moh710Params): Promise<any> {
@@ -30,12 +33,14 @@ export async function getMoh710(params: Moh710Params): Promise<any> {
30
33
  }
31
34
 
32
35
  export async function getMoh710PatientList(params: Moh710Params): Promise<any> {
33
- const url = await buildEtlUrl('moh-710-patient-list', {
36
+ const url = await buildEtlUrl('moh-510-patient-list', {
34
37
  locationUuids: params.locationUuids || '',
35
38
  startDate: params.startDate || '',
36
39
  endDate: params.endDate || '',
37
40
  indicator: Array.isArray(params.indicator) ? params.indicator.join(',') : params.indicator || '',
41
+ reportName: params.reportName || 'moh710Report',
38
42
  });
43
+
39
44
  try {
40
45
  const response = await openmrsFetch(url);
41
46
 
@@ -25,6 +25,7 @@ import Moh366Register from './reports/moh-731/registers/moh-366.component';
25
25
  import PrepRegisterComponent from './reports/moh-731/registers/prep-register.component';
26
26
  import Moh731Linelist from './reports/moh-731/linelist/moh-731-linelist.component';
27
27
  import styles from './root.scss';
28
+ import Moh510RegisterComponent from './reports/moh-710/registers/moh-510/moh-510.component';
28
29
 
29
30
  const RootComponent: React.FC = () => {
30
31
  const baseName = window.getOpenmrsSpaBase() + 'home/reports';
@@ -57,6 +58,7 @@ const RootComponent: React.FC = () => {
57
58
  <Route path="/moh-731-linelist" element={<Moh731Linelist />} />
58
59
  <Route path="/moh-366-register" element={<Moh366Register />} />
59
60
  <Route path="/prep-register" element={<PrepRegisterComponent />} />
61
+ <Route path="/moh-510-register" element={<Moh510RegisterComponent />} />
60
62
  </Routes>
61
63
  </div>
62
64
  </BrowserRouter>
package/webpack.config.js CHANGED
@@ -19,4 +19,4 @@ config.overrides.resolve = {
19
19
  },
20
20
  };
21
21
 
22
- module.exports = config;
22
+ module.exports = config;