@ampath/esm-reports-app 1.0.0-next.113 → 1.0.0-next.115

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,163 @@
1
+ @use '@openmrs/esm-styleguide/src/vars' as *;
2
+
3
+ /* MOH-710 laid out for A4, on the same scale as MOH-711, MOH-740 and MOH-745.
4
+ Its 106 rows across eleven tables run to about two pages, so this is a
5
+ flowing document: the blocks share their edges, and a lettered section is
6
+ kept whole across a page break. */
7
+
8
+ $ink: #000;
9
+ $bar: #d9d9d9;
10
+ $rule: 1px solid $ink;
11
+
12
+ $text: 7pt;
13
+ $title: 7.5pt;
14
+ $meta: 6.5pt;
15
+
16
+ $pad: 3mm;
17
+
18
+ /* Masthead */
19
+
20
+ .mainTitleBox {
21
+ padding: $pad;
22
+ text-align: center;
23
+ border: $rule;
24
+ }
25
+
26
+
27
+ .ministry {
28
+ font-size: $meta;
29
+ }
30
+
31
+ .reportTitle {
32
+ font-size: $title;
33
+ font-weight: 700;
34
+ color: $ink;
35
+ }
36
+
37
+ /* Facility and period strip, joined to the masthead above */
38
+
39
+ .location {
40
+ display: flex;
41
+ flex-wrap: nowrap;
42
+ align-items: baseline;
43
+ justify-content: space-between;
44
+ gap: 2.5mm;
45
+ padding: 2mm $pad;
46
+ font-size: $meta;
47
+ white-space: nowrap;
48
+ border: $rule;
49
+ border-top: none;
50
+ }
51
+
52
+ .line,
53
+ .shortLine {
54
+ display: inline-block;
55
+ padding: 0 0.5mm;
56
+ margin-left: 1mm;
57
+ overflow: hidden;
58
+ font-weight: 600;
59
+ text-align: center;
60
+ text-overflow: ellipsis;
61
+ vertical-align: bottom;
62
+ border-bottom: $rule;
63
+ }
64
+
65
+ .line {
66
+ width: 26mm;
67
+ }
68
+
69
+ .shortLine {
70
+ width: 14mm;
71
+ }
72
+
73
+ /* A lettered section, kept off a page break so a table never splits from the
74
+ heading that names it. Sections share edges rather than sitting apart. */
75
+
76
+ .container {
77
+ border: $rule;
78
+ border-top: none;
79
+ break-inside: avoid;
80
+ page-break-inside: avoid;
81
+ }
82
+
83
+ .title {
84
+ padding: 1.5mm $pad;
85
+ font-size: $text;
86
+ font-weight: 700;
87
+ color: $ink;
88
+ text-align: left;
89
+ background-color: $bar;
90
+ border-bottom: $rule;
91
+ break-after: avoid;
92
+ page-break-after: avoid;
93
+ }
94
+
95
+ .tableContainer {
96
+ overflow-x: auto;
97
+ padding: $pad;
98
+
99
+ & + .tableContainer {
100
+ padding-top: 0;
101
+ }
102
+ }
103
+
104
+ .table {
105
+ width: 100%;
106
+ border-collapse: collapse;
107
+ }
108
+
109
+ .tableBordered td,
110
+ .tableBordered th {
111
+ padding: 1mm 1.5mm;
112
+ font-size: $text;
113
+ text-align: left;
114
+ border: $rule;
115
+ }
116
+
117
+ .tableBordered th {
118
+ font-weight: 700;
119
+ color: $ink;
120
+ background-color: #f0f0f0;
121
+ }
122
+
123
+ .tableStriped tbody tr:nth-of-type(odd) {
124
+ background-color: #fafafa;
125
+ }
126
+
127
+ @media screen {
128
+ .tableStriped tbody tr:hover {
129
+ background-color: $brand-primary-10;
130
+ }
131
+ }
132
+
133
+ /* Sign-off, enclosed by the form rather than floating beneath it. Three fields
134
+ across the sheet, so its rules can be wider than the header strip's five. */
135
+
136
+ .signOff {
137
+ display: flex;
138
+ flex-wrap: nowrap;
139
+ align-items: baseline;
140
+ justify-content: space-between;
141
+ gap: 2.5mm;
142
+ padding: $pad;
143
+ font-size: $meta;
144
+ white-space: nowrap;
145
+ border: $rule;
146
+ border-top: none;
147
+
148
+ .line {
149
+ width: 45mm;
150
+ }
151
+
152
+ .shortLine {
153
+ width: 25mm;
154
+ }
155
+ }
156
+
157
+ /* On paper the striping is screen affordance that prints as grey noise */
158
+
159
+ @media print {
160
+ .tableStriped tbody tr:nth-of-type(odd) {
161
+ background-color: transparent;
162
+ }
163
+ }
@@ -236,6 +236,14 @@ export const registerCategories: ReportCategory[] = [
236
236
  icon: Activity,
237
237
  keywords: ['inpatient', 'nutrition'],
238
238
  },
239
+ {
240
+ code: 'MOH 409',
241
+ name: 'MOH 409 Register',
242
+ description: 'MOH 409 Register',
243
+ path: '/moh-409-register',
244
+ icon: Activity,
245
+ keywords: ['nutrition'],
246
+ },
239
247
  ],
240
248
  },
241
249
  {
@@ -0,0 +1,83 @@
1
+ import React, { useCallback } from 'react';
2
+ import { useSearchParams } from 'react-router-dom';
3
+
4
+ import { LinelistTable, type LinelistColumn, useAllRows } from '../../../common/linelist-table';
5
+ import { RegisterLayout, useLocationName } from '../../../common/report-register';
6
+ import { getMoh405PatientList } from '../../../resources/moh-711.resource';
7
+
8
+ const formatDate = (value: unknown) => (value ? new Date(String(value)).toLocaleDateString('en-GB') : '');
9
+
10
+ const MOH710_LINELIST_COLUMNS: LinelistColumn[] = [
11
+ { header: 'Date (DD/MM/YYYY) - A', value: (row) => row.date ?? '' },
12
+ {
13
+ header: "Child's Number - B",
14
+ value: (row) => row.child_number ?? '',
15
+ },
16
+ { header: "Child's Names - C", value: (row) => row.child_names ?? '' },
17
+ { header: 'Sex - D', value: (row) => row.sex ?? '' },
18
+ { header: 'Date of Birth - E', value: (row) => row.date_of_birth ?? '' },
19
+ { header: 'BCG - K', value: (row) => row.bcg ?? '' },
20
+ { header: 'Polio birth Dose - L', value: (row) => row.polio_birth_dose ?? '' },
21
+ { header: 'OPV 1 - M', value: (row) => row.opv_1 ?? '' },
22
+ { header: 'OPV 2 - N', value: (row) => row.opv_2 ?? '' },
23
+ { header: 'OPV 3 - O', value: (row) => row.opv_3 ?? '' },
24
+ { header: 'IPV - P', value: (row) => row.ipv ?? '' },
25
+ { header: 'DPT / Hep.B / Hib.1 - Q', value: (row) => row.dpt_hep_1 ?? '' },
26
+ { header: 'DPT / Hep.B / Hib.2 - R', value: (row) => row.dpt_hep_2 ?? '' },
27
+ { header: 'DPT / Hep.B / Hib.3 - S', value: (row) => row.dpt_hep_3 ?? '' },
28
+ { header: 'PCV 10 (Pneumococcal) T - AB', value: (row) => row.pneumococcal_1 ?? '' },
29
+ { header: 'PCV 10 (Pneumococcal) U - AB', value: (row) => row.pneumococcal_2 ?? '' },
30
+ { header: 'PCV 10 (Pneumococcal) V - AB', value: (row) => row.pneumococcal_3 ?? '' },
31
+ { header: 'Rota1 - W', value: (row) => row.rotavirus_1 ?? '' },
32
+ { header: 'Rota2 - X', value: (row) => row.rotavirus_2 ?? '' },
33
+ { header: 'Vitamin A(6-11 months) - Y', value: (row) => row.vitamin_a_6_11_months ?? '' },
34
+ { header: 'MR1 - Z', value: (row) => row.measles_rubella_1 ?? '' },
35
+ { header: 'Yellow Fever - AA', value: (row) => row.yellow_fever ?? '' },
36
+ { header: 'Fully Immunized Child - AB', value: (row) => row.fully_immunized_child ?? '' },
37
+ { header: 'MR2 - AC', value: (row) => row.measles_rubella_2 ?? '' },
38
+ { header: 'Remarks - AD', value: (row) => row.remarks ?? '' },
39
+ ];
40
+
41
+ const Moh710Linelist: React.FC = () => {
42
+ const [searchParams] = useSearchParams();
43
+ const startDate = searchParams.get('startDate');
44
+ const endDate = searchParams.get('endDate');
45
+ const locationUuids = searchParams.get('locationUuids');
46
+ const indicator = searchParams.get('indicator') ?? '';
47
+ const from = searchParams.get('from');
48
+ const locationName = useLocationName(locationUuids);
49
+
50
+ const fetchPatientList = useCallback(
51
+ ({ startIndex, limit }: { startIndex: number; limit: number }) =>
52
+ getMoh405PatientList({
53
+ startDate: startDate ?? undefined,
54
+ endDate: endDate ?? undefined,
55
+ locationUuids: locationUuids ?? '',
56
+ indicator,
57
+ reportName: 'moh711Report',
58
+ startIndex,
59
+ limit,
60
+ }),
61
+ [startDate, endDate, locationUuids, indicator, from],
62
+ );
63
+ const { rows, isLoading } = useAllRows(fetchPatientList, [startDate, endDate, locationUuids, indicator, from]);
64
+ return (
65
+ <RegisterLayout
66
+ parentLabel="MOH-710 Report"
67
+ parentPath="/moh-710"
68
+ title="MOH-710 Linelist"
69
+ location={locationName}
70
+ isLoading={isLoading}
71
+ isEmpty={!isLoading && rows.length === 0}
72
+ >
73
+ <LinelistTable
74
+ rows={rows}
75
+ columns={MOH710_LINELIST_COLUMNS}
76
+ layoutKey={`moh-710:${indicator}`}
77
+ exportName={`MOH-710 ${indicator} ${startDate ?? ''} ${endDate ?? ''}`}
78
+ />
79
+ </RegisterLayout>
80
+ );
81
+ };
82
+
83
+ export default Moh710Linelist;
@@ -323,12 +323,12 @@ const Moh710Report: React.FC = () => {
323
323
  </tr>
324
324
  <tr>
325
325
  <td>Typhoid Conjugate Vaccine (TCV) doses Administered</td>
326
- <td>
327
- {moh710Data.typhoid_conjugate_vaccine_age_greater_than_1yr}
328
- </td>
329
- <td>
326
+ <td onClick={() => navigateTo510Register('typhoid_conjugate_vaccine_age_less_than_1yr')}>
330
327
  {moh710Data.typhoid_conjugate_vaccine_age_less_than_1yr}
331
328
  </td>
329
+ <td onClick={() => navigateTo510Register('typhoid_conjugate_vaccine_age_greater_than_1yr')}>
330
+ {moh710Data.typhoid_conjugate_vaccine_age_greater_than_1yr}
331
+ </td>
332
332
  </tr>
333
333
  <tr>
334
334
  <td>Fully Immunized Children(FIC) under 1 year</td>
@@ -5,12 +5,12 @@ export function useOpenMoh711ChanisLinelist(startDate: string, endDate: string,
5
5
  const navigate = useNavigate();
6
6
 
7
7
  return useCallback(
8
- (indicator: string) => {
8
+ (indicator: string | string[]) => {
9
9
  const params = new URLSearchParams({
10
10
  startDate,
11
11
  endDate,
12
12
  locationUuids,
13
- indicator,
13
+ indicator: Array.isArray(indicator) ? indicator.join(',') : indicator,
14
14
  from: 'moh-711',
15
15
  });
16
16
  navigate(`/moh-711-chanis-linelist?${params}`);