@ampath/esm-reports-app 1.0.0-next.48 → 1.0.0-next.49

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 (30) hide show
  1. package/dist/410.js +1 -1
  2. package/dist/{143.css → 907.css} +1 -1
  3. package/dist/907.css.map +1 -0
  4. package/dist/907.js +1 -0
  5. package/dist/907.js.map +1 -0
  6. package/dist/ampath-esm-reports-app.js +1 -1
  7. package/dist/routes.json +1 -1
  8. package/package.json +1 -1
  9. package/src/common/report-header/index.ts +1 -0
  10. package/src/common/report-header/use-location-details.ts +58 -0
  11. package/src/common/report-register/register-columns.ts +12 -0
  12. package/src/common/report-register/register-layout.component.tsx +7 -1
  13. package/src/common/report-register/register-table.scss +9 -0
  14. package/src/common/report-register/rows-to-csv.ts +35 -5
  15. package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +16 -3
  16. package/src/reports/moh-240/moh-240-header.component.tsx +7 -4
  17. package/src/reports/moh-240/moh-240.columns.ts +42 -1
  18. package/src/reports/moh-240/moh-240.component.tsx +3 -2
  19. package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +3 -4
  20. package/src/reports/moh-240/sub-reports/page-summary.component.tsx +143 -93
  21. package/src/reports/moh-505/moh-505-header.component.tsx +7 -4
  22. package/src/reports/moh-706/moh-706-header.component.tsx +7 -4
  23. package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +16 -16
  24. package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +2 -2
  25. package/src/reports/moh-717/moh-717.component.tsx +5 -3
  26. package/src/resources/moh-706.resource.ts +9 -2
  27. package/src/resources/patient-list-page.ts +0 -1
  28. package/dist/143.css.map +0 -1
  29. package/dist/143.js +0 -1
  30. package/dist/143.js.map +0 -1
@@ -1,98 +1,148 @@
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-240.scss";
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-240.scss';
6
6
 
7
- const Moh240PageSummary: React.FC = () => {
8
- const tableRows = useMemo(() => {
9
- return [
10
- {
11
- tableCells: [
12
- getCell("", "Page Summary", 8, 1, true),
13
- ]
14
- },
15
- {
16
- tableCells: [
17
- getCell("", "Malaria Testing", 3, 1, true),
18
- getCell("", "Type of test", 2, 1, true),
19
- getCell("", "Referrals", 3, 1, true),
20
- ]
21
- },
22
- {
23
- tableCells: [
24
- getCell("", "", 1, 2, true),
25
- getCell("", "Number", 2, 1, true),
26
- getCell("", "", 1, 2, true),
27
- getCell("", "Number", 1, 2, true),
28
- getCell("", "", 1, 1, true),
29
- getCell("", "Number", 2, 1, true),
30
- ]
31
- },
32
- {
33
- tableCells: [
34
- ,
35
- getCell("", "OPD", 1, 1, true),
36
- getCell("", "IP", 1, 1, true),
37
- ,
38
- ,
39
- getCell(),
40
- getCell("", "Routine", 1, 1, true),
41
- getCell("", "Specialized", 1, 1, true),
42
- ]
43
- },
44
- {
45
- tableCells: [
46
- getCell("", "Malaria BS (Under five years)"),
47
- getCell(),
48
- getCell(),
49
- getCell("", "No. of Routine tests", 1, 2),
50
- getCell("", "", 1, 2),
51
- getCell("", "From Other HF"),
52
- getCell(),
53
- getCell()
54
- ]
55
- },
56
- {
57
- tableCells: [
58
- getCell("", "Malaria BS (5 years and above)"),
59
- getCell(),
60
- getCell(),
61
- ,
62
- ,
63
- getCell("", "To Other HF"),
64
- getCell(),
65
- getCell(),
66
- ]
67
- },
68
- {
69
- tableCells: [
70
- getCell("", "Malaria Rapid Diagnostic Tests (Under five years)"),
71
- getCell(),
72
- getCell(),
73
- getCell("", "No. of Special tests", 1, 2),
74
- getCell("", "", 1, 2),
75
- getCell("", "To Reference Laboratories", 1, 2),
76
- getCell("", "", 1, 2),
77
- getCell("", "", 1, 2)
78
- ]
79
- },
80
- {
81
- tableCells: [
82
- getCell("", "Malaria Rapid Diagnostic Tests (5 years and above)"),
83
- getCell(),
84
- getCell()
85
- ]
86
- },
87
- ]
88
- }, []);
7
+ /**
8
+ * Encounter types that count as inpatient (IP). The OPD/IP split on this
9
+ * summary depends on the site's encounter dictionary, which this module
10
+ * cannot know; while the set is empty the combined count is shown under OPD
11
+ * and the IP cell stays blank rather than claiming a split.
12
+ */
13
+ const INPATIENT_ENCOUNTER_TYPES: number[] = [];
89
14
 
15
+ /** Reference-lab tests count as the form's "special" tests; the rest are routine */
16
+ const SPECIAL_TEST_FLAGS = ['total_cd4', 'total_viral_load_specimens', 'total_tb_culture_specimens'];
90
17
 
91
- return <div className={styles.summarySection}>
92
- <TableWrapper className={styles.formTable}>
93
- <TableRowMapper tableRows={tableRows} />
94
- </TableWrapper>
95
- </div>
18
+ interface Moh240PageSummaryProps {
19
+ /** The register rows currently fetched; the printed form summarises a page */
20
+ rows?: Array<Record<string, any>>;
96
21
  }
97
22
 
98
- export default Moh240PageSummary;
23
+ const Moh240PageSummary: React.FC<Moh240PageSummaryProps> = ({ rows = [] }) => {
24
+ const flagCount = (flag: string, inpatient: boolean) =>
25
+ rows.filter(
26
+ (row) => Number(row[flag]) === 1 && INPATIENT_ENCOUNTER_TYPES.includes(Number(row.encounter_type)) === inpatient,
27
+ ).length;
28
+
29
+ /* combined OPD+IP under the OPD cell while the split is undeterminable */
30
+ const malariaCell = (flag: string, inpatient: boolean) =>
31
+ INPATIENT_ENCOUNTER_TYPES.length === 0
32
+ ? inpatient
33
+ ? ''
34
+ : String(flagCount(flag, false) + flagCount(flag, true))
35
+ : String(flagCount(flag, inpatient));
36
+
37
+ const summary = useMemo(
38
+ () => ({
39
+ bsUnderFive: [malariaCell('total_malaria_bs_under_5', false), malariaCell('total_malaria_bs_under_5', true)],
40
+ bsFiveAndAbove: [
41
+ malariaCell('total_malaria_bs_5_and_above', false),
42
+ malariaCell('total_malaria_bs_5_and_above', true),
43
+ ],
44
+ rdtUnderFive: [malariaCell('total_malaria_rdt_under_5', false), malariaCell('total_malaria_rdt_under_5', true)],
45
+ rdtFiveAndAbove: [
46
+ malariaCell('total_malaria_rdt_5_and_above', false),
47
+ malariaCell('total_malaria_rdt_5_and_above', true),
48
+ ],
49
+ routineTests: rows.filter(
50
+ (row) => Number(row.total_exam) === 1 && !SPECIAL_TEST_FLAGS.some((flag) => Number(row[flag]) === 1),
51
+ ).length,
52
+ specialTests: rows.filter((row) => SPECIAL_TEST_FLAGS.some((flag) => Number(row[flag]) === 1)).length,
53
+ }),
54
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ [rows],
56
+ );
57
+
58
+ const tableRows = useMemo(
59
+ () => [
60
+ {
61
+ tableCells: [getCell('', 'Page Summary', 8, 1, true)],
62
+ },
63
+ {
64
+ tableCells: [
65
+ getCell('', 'Malaria Testing', 3, 1, true),
66
+ getCell('', 'Type of test', 2, 1, true),
67
+ getCell('', 'Referrals', 3, 1, true),
68
+ ],
69
+ },
70
+ {
71
+ tableCells: [
72
+ getCell('', '', 1, 2, true),
73
+ getCell('', 'Number', 2, 1, true),
74
+ getCell('', '', 1, 2, true),
75
+ getCell('', 'Number', 1, 2, true),
76
+ getCell('', '', 1, 1, true),
77
+ getCell('', 'Number', 2, 1, true),
78
+ ],
79
+ },
80
+ {
81
+ tableCells: [
82
+ ,
83
+ getCell('', 'OPD', 1, 1, true),
84
+ getCell('', 'IP', 1, 1, true),
85
+ ,
86
+ ,
87
+ getCell(),
88
+ getCell('', 'Routine', 1, 1, true),
89
+ getCell('', 'Specialized', 1, 1, true),
90
+ ],
91
+ },
92
+ {
93
+ tableCells: [
94
+ getCell('', 'Malaria BS (Under five years)'),
95
+ getCell('', summary.bsUnderFive[0]),
96
+ getCell('', summary.bsUnderFive[1]),
97
+ getCell('', 'No. of Routine tests', 1, 2),
98
+ getCell('', String(summary.routineTests), 1, 2),
99
+ getCell('', 'From Other HF'),
100
+ getCell(),
101
+ getCell(),
102
+ ],
103
+ },
104
+ {
105
+ tableCells: [
106
+ getCell('', 'Malaria BS (5 years and above)'),
107
+ getCell('', summary.bsFiveAndAbove[0]),
108
+ getCell('', summary.bsFiveAndAbove[1]),
109
+ ,
110
+ ,
111
+ getCell('', 'To Other HF'),
112
+ getCell(),
113
+ getCell(),
114
+ ],
115
+ },
116
+ {
117
+ tableCells: [
118
+ getCell('', 'Malaria Rapid Diagnostic Tests (Under five years)'),
119
+ getCell('', summary.rdtUnderFive[0]),
120
+ getCell('', summary.rdtUnderFive[1]),
121
+ getCell('', 'No. of Special tests', 1, 2),
122
+ getCell('', String(summary.specialTests), 1, 2),
123
+ getCell('', 'To Reference Laboratories', 1, 2),
124
+ getCell('', '', 1, 2),
125
+ getCell('', '', 1, 2),
126
+ ],
127
+ },
128
+ {
129
+ tableCells: [
130
+ getCell('', 'Malaria Rapid Diagnostic Tests (5 years and above)'),
131
+ getCell('', summary.rdtFiveAndAbove[0]),
132
+ getCell('', summary.rdtFiveAndAbove[1]),
133
+ ],
134
+ },
135
+ ],
136
+ [summary],
137
+ );
138
+
139
+ return (
140
+ <div className={styles.summarySection}>
141
+ <TableWrapper className={styles.formTable}>
142
+ <TableRowMapper tableRows={tableRows} />
143
+ </TableWrapper>
144
+ </div>
145
+ );
146
+ };
147
+
148
+ export default Moh240PageSummary;
@@ -3,6 +3,7 @@ import dayjs from 'dayjs';
3
3
  import TableWrapper from '../table-wrapper/table-wrapper.component';
4
4
  import TableRowMapper from '../table-wrapper/table-row-mapper.component';
5
5
  import { getCell } from '../../utils/utils';
6
+ import { useLocationDetails } from '../../common/report-header';
6
7
  import styles from './moh-505.scss';
7
8
 
8
9
  interface MOH505HeaderProps {
@@ -14,19 +15,21 @@ interface MOH505HeaderProps {
14
15
  const asDate = (value?: string) => (value ? dayjs(value).format('DD/MM/YYYY') : '');
15
16
 
16
17
  const MOH505Header: React.FC<MOH505HeaderProps> = ({ facility = '', startDate, endDate }) => {
18
+ const { county, subCounty, kmhflCode } = useLocationDetails();
19
+
17
20
  const tableRows = useMemo(() => {
18
21
  return [
19
22
  {
20
- tableCells: [getCell('', 'County:', 1, 1, true), getCell('', '', 3)],
23
+ tableCells: [getCell('', 'County:', 1, 1, true), getCell('', county ?? '', 3)],
21
24
  },
22
25
  {
23
- tableCells: [getCell('', 'Sub-County:', 1, 1, true), getCell('', '', 3)],
26
+ tableCells: [getCell('', 'Sub-County:', 1, 1, true), getCell('', subCounty ?? '', 3)],
24
27
  },
25
28
  {
26
29
  tableCells: [getCell('', 'Health Facility:', 1, 1, true), getCell('', facility, 3)],
27
30
  },
28
31
  {
29
- tableCells: [getCell('', 'KMHFL code:', 1, 1, true), getCell('', '', 3)],
32
+ tableCells: [getCell('', 'KMHFL code:', 1, 1, true), getCell('', kmhflCode ?? '', 3)],
30
33
  },
31
34
  {
32
35
  tableCells: [
@@ -45,7 +48,7 @@ const MOH505Header: React.FC<MOH505HeaderProps> = ({ facility = '', startDate, e
45
48
  ],
46
49
  },
47
50
  ];
48
- }, [facility, startDate, endDate]);
51
+ }, [county, subCounty, kmhflCode, facility, startDate, endDate]);
49
52
 
50
53
  return (
51
54
  <div className={styles.headerSection}>
@@ -3,6 +3,7 @@ import dayjs from 'dayjs';
3
3
  import TableWrapper from '../table-wrapper/table-wrapper.component';
4
4
  import TableRowMapper from '../table-wrapper/table-row-mapper.component';
5
5
  import { getCell } from '../../utils/utils';
6
+ import { useLocationDetails } from '../../common/report-header';
6
7
  import styles from './moh-706.scss';
7
8
 
8
9
  interface MOH706HeaderProps {
@@ -14,19 +15,21 @@ interface MOH706HeaderProps {
14
15
  const asDate = (value?: string) => (value ? dayjs(value).format('DD/MM/YYYY') : '');
15
16
 
16
17
  const MOH706Header: React.FC<MOH706HeaderProps> = ({ facility = '', startDate, endDate }) => {
18
+ const { county, subCounty, kmhflCode } = useLocationDetails();
19
+
17
20
  const tableRows = useMemo(() => {
18
21
  return [
19
22
  {
20
- tableCells: [getCell('', 'County:', 1, 1, true), getCell('', '', 3)],
23
+ tableCells: [getCell('', 'County:', 1, 1, true), getCell('', county ?? '', 3)],
21
24
  },
22
25
  {
23
- tableCells: [getCell('', 'Sub-County:', 1, 1, true), getCell('', '', 3)],
26
+ tableCells: [getCell('', 'Sub-County:', 1, 1, true), getCell('', subCounty ?? '', 3)],
24
27
  },
25
28
  {
26
29
  tableCells: [getCell('', 'Health Facility:', 1, 1, true), getCell('', facility, 3)],
27
30
  },
28
31
  {
29
- tableCells: [getCell('', 'KMHFL Code:', 1, 1, true), getCell('', '', 3)],
32
+ tableCells: [getCell('', 'KMHFL Code:', 1, 1, true), getCell('', kmhflCode ?? '', 3)],
30
33
  },
31
34
  {
32
35
  tableCells: [
@@ -45,7 +48,7 @@ const MOH706Header: React.FC<MOH706HeaderProps> = ({ facility = '', startDate, e
45
48
  ],
46
49
  },
47
50
  ];
48
- }, [facility, startDate, endDate]);
51
+ }, [county, subCounty, kmhflCode, facility, startDate, endDate]);
49
52
 
50
53
  return (
51
54
  <div className={styles.headerSection}>
@@ -43,7 +43,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
43
43
  {
44
44
  tableCells: [
45
45
  getCell("", "2.2 OGTT"),
46
- getCell(),
46
+ getCell("total_ogtt"),
47
47
  getCell("min_ogtt"),
48
48
  getCell("max_ogtt"),
49
49
  ]
@@ -59,7 +59,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
59
59
  {
60
60
  tableCells: [
61
61
  getCell("", "2.4 Creatinine"),
62
- getCell(),
62
+ getCell("total_creatinine"),
63
63
  getCell("min_creatinine"),
64
64
  getCell("max_creatinine"),
65
65
  ]
@@ -75,7 +75,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
75
75
  {
76
76
  tableCells: [
77
77
  getCell("", "2.5 Urea"),
78
- getCell(),
78
+ getCell("total_urea"),
79
79
  getCell("min_urea"),
80
80
  getCell("max_urea"),
81
81
  ]
@@ -116,7 +116,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
116
116
  {
117
117
  tableCells: [
118
118
  getCell("", "2.9 Direct bilirubin"),
119
- getCell(),
119
+ getCell("total_direct_bili"),
120
120
  getCell("min_direct_bili"),
121
121
  getCell("max_direct_bili"),
122
122
  ]
@@ -124,7 +124,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
124
124
  {
125
125
  tableCells: [
126
126
  getCell("", "2.10 Total bilirubin"),
127
- getCell(),
127
+ getCell("total_total_bili"),
128
128
  getCell("min_total_bili"),
129
129
  getCell("max_total_bili"),
130
130
  ]
@@ -132,7 +132,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
132
132
  {
133
133
  tableCells: [
134
134
  getCell("", "2.11 ASAT (SGOT)"),
135
- getCell(),
135
+ getCell("total_ast"),
136
136
  getCell("min_ast"),
137
137
  getCell("max_ast"),
138
138
  ]
@@ -140,7 +140,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
140
140
  {
141
141
  tableCells: [
142
142
  getCell("", "2.12 ALAT (SGPT)"),
143
- getCell(),
143
+ getCell("total_alt"),
144
144
  getCell("min_alt"),
145
145
  getCell("max_alt"),
146
146
  ]
@@ -148,7 +148,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
148
148
  {
149
149
  tableCells: [
150
150
  getCell("", "2.13 Serum Protein"),
151
- getCell(),
151
+ getCell("total_total_protein"),
152
152
  getCell("min_total_protein"),
153
153
  getCell("max_total_protein"),
154
154
  ]
@@ -164,7 +164,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
164
164
  {
165
165
  tableCells: [
166
166
  getCell("", "2.15 Alkaline Phosphatase"),
167
- getCell(),
167
+ getCell("total_alk_phos"),
168
168
  getCell("min_alk_phos"),
169
169
  getCell("max_alk_phos"),
170
170
  ]
@@ -172,7 +172,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
172
172
  {
173
173
  tableCells: [
174
174
  getCell("", "2.16 Lipid Profile", 1, 1, true),
175
- getCell(),
175
+ getCell("total_lipid_profile"),
176
176
  getCell("min_lipid_profile"),
177
177
  getCell("max_lipid_profile"),
178
178
  ]
@@ -180,7 +180,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
180
180
  {
181
181
  tableCells: [
182
182
  getCell("", "2.17 Total cholesterol"),
183
- getCell(),
183
+ getCell("total_total_cholesterol"),
184
184
  getCell("min_total_cholesterol"),
185
185
  getCell("max_total_cholesterol"),
186
186
  ]
@@ -189,7 +189,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
189
189
  {
190
190
  tableCells: [
191
191
  getCell("", "2.18 Triglycerides"),
192
- getCell(),
192
+ getCell("total_triglycerides"),
193
193
  getCell("min_triglycerides"),
194
194
  getCell("max_triglycerides"),
195
195
  ]
@@ -197,7 +197,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
197
197
  {
198
198
  tableCells: [
199
199
  getCell("", "2.19 LDL"),
200
- getCell(),
200
+ getCell("total_ldl"),
201
201
  getCell("min_ldl"),
202
202
  getCell("max_ldl"),
203
203
  ]
@@ -213,7 +213,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
213
213
  {
214
214
  tableCells: [
215
215
  getCell("", "2.20 T3"),
216
- getCell(),
216
+ getCell("total_t3"),
217
217
  getCell("min_t3"),
218
218
  getCell("max_t3"),
219
219
  ]
@@ -221,7 +221,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
221
221
  {
222
222
  tableCells: [
223
223
  getCell("", "2.21 T4"),
224
- getCell(),
224
+ getCell("total_t4"),
225
225
  getCell("min_t4"),
226
226
  getCell("max_t4"),
227
227
  ]
@@ -229,7 +229,7 @@ const BloodChemistry: React.FC<BloodChemistryProps> = ({ data, locationUuids, st
229
229
  {
230
230
  tableCells: [
231
231
  getCell("", "2.22 TSH"),
232
- getCell(),
232
+ getCell("total_tsh"),
233
233
  getCell("min_tsh"),
234
234
  getCell("max_tsh"),
235
235
  ]
@@ -17,10 +17,10 @@ const SpecimenReferralToHigherLevels: React.FC = () => {
17
17
  ]
18
18
  },
19
19
  { tableCells: [getCell("", "8.1 CD4"), getCell(), getCell()] },
20
- { tableCells: [getCell("", "8.2 Viral load"), getCell(), getCell()] },
20
+ { tableCells: [getCell("", "8.2 Viral load"), getCell("total_viral_load_specimens"), getCell("viral_load_results_received")] },
21
21
  { tableCells: [getCell("", "8.3 EID"), getCell(), getCell()] },
22
22
  { tableCells: [getCell("", "8.4 Discodant/discrepant"), getCell(), getCell()] },
23
- { tableCells: [getCell("", "8.5 TB Culture"), getCell(), getCell()] },
23
+ { tableCells: [getCell("", "8.5 TB Culture"), getCell("total_tb_culture_specimens"), getCell("tb_culture_results_received")] },
24
24
  { tableCells: [getCell("", "8.6 Virological"), getCell(), getCell()] },
25
25
  { tableCells: [getCell("", "8.7 Clinical Chemistry"), getCell(), getCell()] },
26
26
  { tableCells: [getCell("", "8.8 Histology/cytology"), getCell(), getCell()] },
@@ -6,6 +6,7 @@ import { hasReportData, ReportPlaceholder } from '../../common/report-placeholde
6
6
  import styles from './moh717.scss';
7
7
  import classNames from 'classnames';
8
8
  import { useSession } from '@openmrs/esm-framework';
9
+ import { useLocationDetails } from '../../common/report-header';
9
10
  import dayjs from 'dayjs';
10
11
  import { getMoh717 } from '../../resources/moh-717.resource';
11
12
  import OutpatientComponent from './sections/outpatient.component';
@@ -53,6 +54,7 @@ const Moh717Report: React.FC = () => {
53
54
 
54
55
  /* The masthead fills itself in, as on the other reports */
55
56
  const facility = session?.sessionLocation?.display ?? '';
57
+ const { county, subCounty, kmhflCode } = useLocationDetails();
56
58
  const reportMonth = startDate ? dayjs(startDate).format('MMMM') : '';
57
59
  const reportYear = startDate ? dayjs(startDate).format('YYYY') : '';
58
60
 
@@ -96,10 +98,10 @@ const Moh717Report: React.FC = () => {
96
98
  <h3 className={styles.subTitle}>Monthly Service Workload Report for Health Facilities</h3>
97
99
  <div className={styles.locationContainer}>
98
100
  <span>
99
- County: <span className={styles.shortLine}></span>
101
+ County: <span className={styles.shortLine}>{county ?? ''}</span>
100
102
  </span>
101
103
  <span>
102
- Sub-County: <span className={styles.shortLine}></span>
104
+ Sub-County: <span className={styles.shortLine}>{subCounty ?? ''}</span>
103
105
  </span>
104
106
  <span>
105
107
  Health Facility: <span className={styles.line}>{facility}</span>
@@ -113,7 +115,7 @@ const Moh717Report: React.FC = () => {
113
115
  Year: <span className={styles.shortLine}>{reportYear}</span>
114
116
  </span>
115
117
  <span>
116
- KMHFL Code: <span className={styles.shortLine}></span>
118
+ KMHFL Code: <span className={styles.shortLine}>{kmhflCode ?? ''}</span>
117
119
  </span>
118
120
  </div>
119
121
  </div>
@@ -22,6 +22,13 @@ interface Moh706PatientListResponse {
22
22
  result: Array<Record<string, unknown>>;
23
23
  }
24
24
 
25
+ /**
26
+ * The ETL server validates the OpenMRS session cookie (JSESSIONID), so every
27
+ * request must carry it. `credentials: 'include'` keeps same-origin proxies
28
+ * working and is required when the ETL base URL is another origin.
29
+ */
30
+ const WITH_SESSION_COOKIE = { credentials: 'include' as RequestCredentials };
31
+
25
32
  export async function getMoh706(params: Moh706Params): Promise<Array<Record<string, unknown>>> {
26
33
  const url = await buildEtlUrl('lab-706', {
27
34
  locationUuids: params.locationUuids || '',
@@ -29,7 +36,7 @@ export async function getMoh706(params: Moh706Params): Promise<Array<Record<stri
29
36
  endDate: params.endDate || '',
30
37
  });
31
38
  try {
32
- const response = await openmrsFetch(url);
39
+ const response = await openmrsFetch(url, WITH_SESSION_COOKIE);
33
40
 
34
41
  if (!response.ok) {
35
42
  const errorText = await response.text();
@@ -57,7 +64,7 @@ export async function getMoh706PatientList(params: PatientListParams): Promise<P
57
64
  ...pageParams(params),
58
65
  });
59
66
  try {
60
- const response = await openmrsFetch(url);
67
+ const response = await openmrsFetch(url, WITH_SESSION_COOKIE);
61
68
 
62
69
  if (!response.ok) {
63
70
  const errorText = await response.text();
@@ -47,7 +47,6 @@ export function toPatientListPage(data: any, startIndex: number, limit: number):
47
47
  : Array.isArray(container)
48
48
  ? container
49
49
  : [];
50
-
51
50
  const reported = [container?.total, container?.totalCount, container?.count, data?.total, data?.totalCount].find(
52
51
  (value) => typeof value === 'number',
53
52
  );
package/dist/143.css.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"143.css","mappings":"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","sources":["webpack://@ampath/esm-reports-app/./src/dashboard/reports-dashboard.module.scss","webpack://@ampath/esm-reports-app/./src/common/report-filters/report-filters.scss","webpack://@ampath/esm-reports-app/./src/common/report-placeholder/report-placeholder.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-710/moh-710.scss","webpack://@ampath/esm-reports-app/./src/common/report-skeleton/report-skeleton.scss","webpack://@ampath/esm-reports-app/./src/common/report-page/report-page.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-711/moh711.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-717/moh717.scss","webpack://@ampath/esm-reports-app/./src/reports/table-wrapper/table-wrapper.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-706/moh-706.scss","webpack://@ampath/esm-reports-app/./src/common/report-register/register-table.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-240/moh-240.scss","webpack://@ampath/esm-reports-app/./src/common/report-register/register-layout.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-505/moh-505.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-705B/moh-705b.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-705a/moh-705a.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-745/moh-745.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-740/moh-740.component.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-740/shared/data-cell/data-cell.scss","webpack://@ampath/esm-reports-app/./src/reports/moh-731/moh-731.scss","webpack://@ampath/esm-reports-app/./node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://@ampath/esm-reports-app/./src/root.scss"],"names":[],"sourceRoot":""}