@ampath/esm-reports-app 1.0.0-next.41 → 1.0.0-next.45
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.
- package/dist/143.css +1 -0
- package/dist/143.css.map +1 -0
- package/dist/143.js +1 -0
- package/dist/143.js.map +1 -0
- package/dist/197.js +1 -1
- package/dist/282.js +1 -1
- package/dist/282.js.map +1 -1
- package/dist/295.css +1 -0
- package/dist/295.css.map +1 -0
- package/dist/295.js +1 -0
- package/dist/295.js.map +1 -0
- package/dist/300.js +1 -1
- package/dist/311.js +1 -1
- package/dist/311.js.map +1 -1
- package/dist/335.js +1 -1
- package/dist/353.js +1 -1
- package/dist/353.js.map +1 -1
- package/dist/410.js +1 -0
- package/dist/410.js.map +1 -0
- package/dist/427.js +2 -0
- package/dist/427.js.LICENSE.txt +35 -0
- package/dist/427.js.map +1 -0
- package/dist/441.js +1 -0
- package/dist/441.js.map +1 -0
- package/dist/478.js +1 -1
- package/dist/478.js.map +1 -1
- package/dist/540.js +1 -1
- package/dist/540.js.map +1 -1
- package/dist/55.js +1 -1
- package/dist/652.js +1 -1
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/99.js +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/ampath-esm-reports-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/common/report-error/index.ts +1 -0
- package/src/common/report-error/show-report-error.ts +25 -0
- package/src/common/report-filters/date-range.ts +137 -0
- package/src/common/report-filters/index.ts +4 -0
- package/src/common/report-filters/report-filters.component.tsx +281 -151
- package/src/common/report-filters/report-filters.scss +180 -55
- package/src/common/report-filters/types.ts +66 -0
- package/src/common/report-filters/use-restore-period.ts +43 -0
- package/src/common/report-page/index.ts +2 -0
- package/src/common/report-page/report-page.component.tsx +32 -0
- package/src/common/report-page/report-page.scss +45 -0
- package/src/common/report-page/use-page-scale.ts +50 -0
- package/src/common/report-placeholder/has-report-data.ts +15 -0
- package/src/common/report-placeholder/index.ts +2 -0
- package/src/common/report-placeholder/report-placeholder.component.tsx +56 -0
- package/src/common/report-placeholder/report-placeholder.scss +46 -0
- package/src/common/report-register/index.ts +5 -0
- package/src/common/report-register/register-columns.ts +34 -0
- package/src/common/report-register/register-layout.component.tsx +237 -0
- package/src/common/report-register/register-layout.scss +140 -0
- package/src/common/report-register/register-table.scss +62 -0
- package/src/common/report-register/report-parents.ts +27 -0
- package/src/common/report-register/rows-to-csv.ts +59 -0
- package/src/common/report-register/use-patient-list.ts +92 -0
- package/src/common/report-skeleton/index.ts +1 -0
- package/src/common/report-skeleton/report-skeleton.component.tsx +46 -0
- package/src/common/report-skeleton/report-skeleton.scss +29 -0
- package/src/config-schema.ts +9 -1
- package/src/dashboard/report-catalog.ts +173 -0
- package/src/dashboard/reports-dasboard.tsx +101 -35
- package/src/dashboard/reports-dashboard.module.scss +269 -11
- package/src/index.ts +13 -1
- package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +50 -48
- package/src/reports/moh-240/moh-240-header.component.tsx +54 -56
- package/src/reports/moh-240/moh-240.columns.ts +64 -0
- package/src/reports/moh-240/moh-240.component.tsx +65 -84
- package/src/reports/moh-240/moh-240.scss +36 -7
- package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +27 -65
- package/src/reports/moh-240/sub-reports/page-summary.component.tsx +2 -2
- package/src/reports/moh-505/moh-505-header.component.tsx +59 -57
- package/src/reports/moh-505/moh-505.component.tsx +51 -56
- package/src/reports/moh-505/moh-505.scss +116 -2
- package/src/reports/moh-705B/moh-204b-register.component.tsx +41 -42
- package/src/reports/moh-705B/moh-204b.columns.ts +39 -0
- package/src/reports/moh-705B/moh-705b.component.tsx +492 -473
- package/src/reports/moh-705B/moh-705b.scss +110 -24
- package/src/reports/moh-705a/moh-705a.component.tsx +496 -476
- package/src/reports/moh-705a/moh-705a.scss +109 -24
- package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +41 -42
- package/src/reports/moh-705a/registers/moh-204a.columns.ts +57 -0
- package/src/reports/moh-706/moh-706-header.component.tsx +58 -56
- package/src/reports/moh-706/moh-706.component.tsx +84 -55
- package/src/reports/moh-706/moh-706.scss +115 -19
- package/src/reports/moh-710/moh-710.component.tsx +743 -727
- package/src/reports/moh-710/moh-710.scss +140 -23
- package/src/reports/moh-710/registers/moh-511-710-register.component.tsx +48 -43
- package/src/reports/moh-710/registers/moh-511-710.columns.ts +52 -0
- package/src/reports/moh-711/moh-711.component.tsx +94 -106
- package/src/reports/moh-711/moh711.scss +95 -64
- package/src/reports/moh-711/registers/moh-333-register.component.tsx +92 -94
- package/src/reports/moh-711/registers/moh-333.columns.ts +119 -0
- package/src/reports/moh-711/registers/moh-405-register.component.tsx +88 -89
- package/src/reports/moh-711/registers/moh-405.columns.ts +120 -0
- package/src/reports/moh-711/registers/moh-406-register.component.tsx +85 -88
- package/src/reports/moh-711/registers/moh-406.columns.ts +133 -0
- package/src/reports/moh-711/registers/moh-510-register.component.tsx +38 -44
- package/src/reports/moh-711/registers/moh-511-register.component.tsx +42 -43
- package/src/reports/moh-711/registers/moh-511.columns.ts +59 -0
- package/src/reports/moh-711/sections/anc.component.tsx +3 -3
- package/src/reports/moh-711/sections/cervical-cancer.component.tsx +3 -3
- package/src/reports/moh-711/sections/chanis.component.tsx +2 -3
- package/src/reports/moh-711/sections/family-planning.component.tsx +2 -2
- package/src/reports/moh-711/sections/gbv.component.tsx +2 -2
- package/src/reports/moh-711/sections/maternity.component.tsx +3 -8
- package/src/reports/moh-711/sections/medical-social-work.component.tsx +2 -12
- package/src/reports/moh-711/sections/other.component.tsx +2 -2
- package/src/reports/moh-711/sections/physiotherapy.component.tsx +2 -2
- package/src/reports/moh-711/sections/pnc.component.tsx +7 -5
- package/src/reports/moh-711/sections/post-abortion.component.tsx +2 -2
- package/src/reports/moh-711/sections/rehabilitation.component.tsx +2 -2
- package/src/reports/moh-711/sections/report-compiled-by.component.tsx +12 -4
- package/src/reports/moh-711/sections/tb-screening.component.tsx +2 -2
- package/src/reports/moh-717/moh-717.component.tsx +100 -121
- package/src/reports/moh-717/moh717.scss +163 -102
- package/src/reports/moh-717/sections/maternity.component.tsx +1 -1
- package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +1 -1
- package/src/reports/moh-717/sections/outpatient.component.tsx +23 -23
- package/src/reports/moh-717/sections/preparedby.component.tsx +7 -2
- package/src/reports/moh-717/sections/special-services.component.tsx +1 -1
- package/src/reports/moh-731/moh-731.component.tsx +127 -110
- package/src/reports/moh-731/moh-731.scss +396 -68
- package/src/reports/moh-731/registers/moh-366.columns.ts +38 -0
- package/src/reports/moh-731/registers/moh-366.component.tsx +76 -83
- package/src/reports/moh-731/registers/prep-register.component.tsx +70 -78
- package/src/reports/moh-731/registers/prep.columns.ts +34 -0
- package/src/reports/moh-731/sections/hiv-and-tb-treatment.component.tsx +1031 -751
- package/src/reports/moh-731/sections/hiv-testing-and-pre-exposure.component.tsx +230 -86
- package/src/reports/moh-731/sections/pmtct.component.tsx +185 -64
- package/src/reports/moh-740/moh-740.component.scss +159 -79
- package/src/reports/moh-740/moh-740.component.tsx +261 -230
- package/src/reports/moh-740/moh-740.resource.ts +17 -10
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +77 -96
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +50 -70
- package/src/reports/moh-740/registers/moh-740-patient-list.tsx +61 -32
- package/src/reports/moh-740/registers/moh-740.columns.ts +52 -0
- package/src/reports/moh-740/shared/utils/indicator-register-map.ts +3 -3
- package/src/reports/moh-740/types/index.ts +3 -3
- package/src/reports/moh-745/moh-745.component.tsx +897 -877
- package/src/reports/moh-745/moh-745.scss +104 -46
- package/src/reports/moh-745/registers/moh-412-register.component.tsx +42 -43
- package/src/reports/moh-745/registers/moh-412.columns.ts +52 -0
- package/src/reports/table-wrapper/table-wrapper.component.tsx +23 -14
- package/src/reports/table-wrapper/table-wrapper.scss +1 -16
- package/src/resources/moh-505.resource.ts +18 -35
- package/src/resources/moh-705.resource.ts +28 -39
- package/src/resources/moh-706.resource.ts +17 -30
- package/src/resources/moh-710.resource.ts +7 -17
- package/src/resources/moh-711.resource.ts +46 -64
- package/src/resources/moh-717.resource.ts +7 -17
- package/src/resources/moh-731.resource.ts +26 -32
- package/src/resources/moh-745.resource.ts +18 -20
- package/src/resources/patient-list-page.ts +66 -0
- package/src/root.component.tsx +28 -26
- package/src/root.scss +36 -0
- package/src/utils/get-base-url.ts +39 -7
- package/tsconfig.json +1 -1
- package/dist/110.js +0 -1
- package/dist/110.js.map +0 -1
- package/dist/184.js +0 -2
- package/dist/184.js.LICENSE.txt +0 -14
- package/dist/184.js.map +0 -1
- package/dist/205.js +0 -1
- package/dist/205.js.map +0 -1
- package/dist/812.js +0 -1
- package/dist/812.js.map +0 -1
- package/dist/822.js +0 -2
- package/dist/822.js.LICENSE.txt +0 -20
- package/dist/822.js.map +0 -1
- package/dist/ampath-esm-reports-app.js.buildmanifest.json +0 -560
- package/dist/main.js +0 -1
- package/dist/main.js.map +0 -1
- package/src/reports/moh-731/registers/moh-366.scss +0 -45
- package/src/reports/moh-731/registers/prep-registers.scss +0 -45
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.scss +0 -18
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.scss +0 -18
- /package/src/{reports/moh-740/shared/utils → utils}/format-indicator.ts +0 -0
|
@@ -1,45 +1,162 @@
|
|
|
1
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
4
24
|
}
|
|
5
25
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
margin: 0 2rem;
|
|
9
|
-
margin-top: 0.5px;
|
|
26
|
+
.ministry {
|
|
27
|
+
font-size: $meta;
|
|
10
28
|
}
|
|
11
29
|
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
30
|
+
.reportTitle {
|
|
31
|
+
font-size: $title;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
color: $ink;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Facility and period strip, joined to the masthead above */
|
|
37
|
+
|
|
38
|
+
.location {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-wrap: nowrap;
|
|
41
|
+
align-items: baseline;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
gap: 2.5mm;
|
|
44
|
+
padding: 2mm $pad;
|
|
45
|
+
font-size: $meta;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
border: $rule;
|
|
48
|
+
border-top: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.line,
|
|
52
|
+
.shortLine {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
padding: 0 0.5mm;
|
|
55
|
+
margin-left: 1mm;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
text-align: center;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
vertical-align: bottom;
|
|
61
|
+
border-bottom: $rule;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.line {
|
|
65
|
+
width: 26mm;
|
|
15
66
|
}
|
|
16
67
|
|
|
17
|
-
.
|
|
18
|
-
|
|
68
|
+
.shortLine {
|
|
69
|
+
width: 14mm;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* A lettered section, kept off a page break so a table never splits from the
|
|
73
|
+
heading that names it. Sections share edges rather than sitting apart. */
|
|
74
|
+
|
|
75
|
+
.container {
|
|
76
|
+
border: $rule;
|
|
77
|
+
border-top: none;
|
|
78
|
+
break-inside: avoid;
|
|
79
|
+
page-break-inside: avoid;
|
|
19
80
|
}
|
|
20
81
|
|
|
21
82
|
.title {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
83
|
+
padding: 1.5mm $pad;
|
|
84
|
+
font-size: $text;
|
|
85
|
+
font-weight: 700;
|
|
86
|
+
color: $ink;
|
|
87
|
+
text-align: left;
|
|
88
|
+
background-color: $bar;
|
|
89
|
+
border-bottom: $rule;
|
|
90
|
+
break-after: avoid;
|
|
91
|
+
page-break-after: avoid;
|
|
25
92
|
}
|
|
93
|
+
|
|
94
|
+
.tableContainer {
|
|
95
|
+
overflow-x: auto;
|
|
96
|
+
padding: $pad;
|
|
97
|
+
|
|
98
|
+
& + .tableContainer {
|
|
99
|
+
padding-top: 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
26
103
|
.table {
|
|
27
|
-
width:
|
|
104
|
+
width: 100%;
|
|
28
105
|
border-collapse: collapse;
|
|
29
|
-
|
|
30
106
|
}
|
|
31
107
|
|
|
32
108
|
.tableBordered td,
|
|
33
109
|
.tableBordered th {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
110
|
+
padding: 1mm 1.5mm;
|
|
111
|
+
font-size: $text;
|
|
112
|
+
text-align: left;
|
|
113
|
+
border: $rule;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.tableBordered th {
|
|
117
|
+
font-weight: 700;
|
|
118
|
+
color: $ink;
|
|
119
|
+
background-color: #f0f0f0;
|
|
37
120
|
}
|
|
38
121
|
|
|
39
122
|
.tableStriped tbody tr:nth-of-type(odd) {
|
|
40
|
-
background-color: #
|
|
123
|
+
background-color: #fafafa;
|
|
41
124
|
}
|
|
42
125
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
126
|
+
@media screen {
|
|
127
|
+
.tableStriped tbody tr:hover {
|
|
128
|
+
background-color: $brand-primary-10;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Sign-off, enclosed by the form rather than floating beneath it. Three fields
|
|
133
|
+
across the sheet, so its rules can be wider than the header strip's five. */
|
|
134
|
+
|
|
135
|
+
.signOff {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-wrap: nowrap;
|
|
138
|
+
align-items: baseline;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
gap: 2.5mm;
|
|
141
|
+
padding: $pad;
|
|
142
|
+
font-size: $meta;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
border: $rule;
|
|
145
|
+
border-top: none;
|
|
146
|
+
|
|
147
|
+
.line {
|
|
148
|
+
width: 45mm;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.shortLine {
|
|
152
|
+
width: 25mm;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* On paper the striping is screen affordance that prints as grey noise */
|
|
157
|
+
|
|
158
|
+
@media print {
|
|
159
|
+
.tableStriped tbody tr:nth-of-type(odd) {
|
|
160
|
+
background-color: transparent;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -1,59 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React
|
|
3
|
-
import {
|
|
1
|
+
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useLocation, useSearchParams } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
-
import styles from '
|
|
5
|
+
import styles from '../../../common/report-register/register-table.scss';
|
|
6
6
|
import { getMoh511PatientList } from '../../../resources/moh-711.resource';
|
|
7
7
|
import { moh511Columns } from './type';
|
|
8
|
+
import { moh511ExportColumns } from './moh-511-710.columns';
|
|
9
|
+
import { RegisterLayout, usePatientList } from '../../../common/report-register';
|
|
8
10
|
|
|
9
11
|
const Moh511710Register: React.FC = () => {
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
const [patientlist, setPatientList] = useState<any[]>([]);
|
|
12
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
-
|
|
14
12
|
const [searchParams] = useSearchParams();
|
|
13
|
+
const location = useLocation();
|
|
14
|
+
|
|
15
|
+
/* The endpoint scopes its list by report. Defaulted rather than read only
|
|
16
|
+
from route state, which is lost on a reload or a pasted link. */
|
|
17
|
+
const reportName = location.state?.reportName || 'moh710Report';
|
|
15
18
|
|
|
16
19
|
const startDate = searchParams.get('startDate');
|
|
17
20
|
const endDate = searchParams.get('endDate');
|
|
18
21
|
const locationUuids = searchParams.get('locationUuids');
|
|
19
22
|
const indicator = searchParams.get('indicator');
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
fetchData();
|
|
46
|
-
}, [startDate, endDate, locationUuids, indicator]);
|
|
24
|
+
const {
|
|
25
|
+
rows: patientlist,
|
|
26
|
+
total,
|
|
27
|
+
isTotalExact,
|
|
28
|
+
isLoading,
|
|
29
|
+
page,
|
|
30
|
+
pageSize,
|
|
31
|
+
onPageChange,
|
|
32
|
+
fetchAll,
|
|
33
|
+
} = usePatientList(
|
|
34
|
+
({ startIndex, limit }) =>
|
|
35
|
+
getMoh511PatientList({
|
|
36
|
+
startDate,
|
|
37
|
+
endDate,
|
|
38
|
+
locationUuids,
|
|
39
|
+
indicator,
|
|
40
|
+
reportName,
|
|
41
|
+
startIndex,
|
|
42
|
+
limit,
|
|
43
|
+
}),
|
|
44
|
+
[startDate, endDate, locationUuids, indicator, reportName],
|
|
45
|
+
);
|
|
47
46
|
|
|
48
|
-
function navigateBack() {
|
|
49
|
-
navigate('/moh-710');
|
|
50
|
-
}
|
|
51
47
|
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
<RegisterLayout
|
|
49
|
+
parentLabel="MOH-710 Report"
|
|
50
|
+
parentPath="/moh-710"
|
|
51
|
+
title="MOH 511 Immunization Register"
|
|
52
|
+
isLoading={isLoading}
|
|
53
|
+
isEmpty={patientlist.length === 0}
|
|
54
|
+
page={page}
|
|
55
|
+
pageSize={pageSize}
|
|
56
|
+
total={total}
|
|
57
|
+
isTotalExact={isTotalExact}
|
|
58
|
+
onPageChange={onPageChange}
|
|
59
|
+
fetchAll={fetchAll}
|
|
60
|
+
columns={moh511ExportColumns}
|
|
61
|
+
>
|
|
57
62
|
<Table>
|
|
58
63
|
<TableHead>
|
|
59
64
|
<TableRow>
|
|
@@ -256,7 +261,7 @@ const Moh511710Register: React.FC = () => {
|
|
|
256
261
|
)}
|
|
257
262
|
</TableBody>
|
|
258
263
|
</Table>
|
|
259
|
-
|
|
264
|
+
</RegisterLayout>
|
|
260
265
|
);
|
|
261
266
|
};
|
|
262
267
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type RegisterColumn } from '../../../common/report-register';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MOH 511 as the register prints it: one column per cell, in the order they appear.
|
|
5
|
+
*/
|
|
6
|
+
export const moh511ExportColumns: RegisterColumn[] = [
|
|
7
|
+
{ header: 'Serial No. - A', value: (row) => row.serial_no ?? '' },
|
|
8
|
+
{ header: 'Date. (DD:MM:YYYY) - B', value: (row) => row.visit_date ?? '' },
|
|
9
|
+
{ header: 'CWC No. (New Visit) - C', value: (row) => row.cwc_number_new ?? '' },
|
|
10
|
+
{ header: 'CWC No. (Revisit) - D', value: (row) => row.cwc_number_revisit ?? '' },
|
|
11
|
+
{ header: 'BIRTH NOTIFICATION (NUMBER) - E', value: (row) => row.birth_notification_number ?? '' },
|
|
12
|
+
{ header: 'Full Names (Three names) - F', value: (row) => row.full_name ?? '' },
|
|
13
|
+
{ header: 'Age - G', value: (row) => row.age ?? '' },
|
|
14
|
+
{ header: 'Sex - H', value: (row) => row.sex ?? '' },
|
|
15
|
+
{ header: 'County/Sub- county - I', value: (row) => row.county_sub_county ?? '' },
|
|
16
|
+
{ header: 'Village /Estate / Landmark - J', value: (row) => row.village_estate_landmark ?? '' },
|
|
17
|
+
{ header: 'Telephone number - K', value: (row) => row.phone_number ?? '' },
|
|
18
|
+
{ header: 'Weight - L', value: (row) => row.height ?? '' },
|
|
19
|
+
{ header: 'Height - M', value: (row) => row.weight_kg ?? '' },
|
|
20
|
+
{ header: 'Weight in Kgs - N', value: (row) => row.weight_category ?? '' },
|
|
21
|
+
{ header: 'Weight categories: (1=Normal 2=UW 3=SUW 4=OW 5=Obese) - O', value: (row) => row.height_category ?? '' },
|
|
22
|
+
{ header: 'Height / Length in cm - P', value: (row) => row.muac ?? '' },
|
|
23
|
+
{
|
|
24
|
+
header: 'Height/Length categories: (1=Normal 2=Stunted 3=Sev. Stunted) - Q',
|
|
25
|
+
value: (row) => row.exclusive_breastfeeding_less_6_months ?? '',
|
|
26
|
+
},
|
|
27
|
+
{ header: 'MUAC 1.Green 2.Yellow 3.Red - R', value: (row) => row.vitamin_A_supplementation ?? '' },
|
|
28
|
+
{ header: 'Exclusive Breast feeding (less than 6 months)(Y/N) - S', value: (row) => row.dewormed ?? '' },
|
|
29
|
+
{
|
|
30
|
+
header: 'Vitamin A supplimentation: (6-59 months) (1=6- 11 months, 2=12-59 months, 3=Not supplimented) - T',
|
|
31
|
+
value: (row) => row.mnps_supplimentation ?? '',
|
|
32
|
+
},
|
|
33
|
+
{ header: 'Dewormed (Y/N) - U', value: (row) => row.developmental_milestones ?? '' },
|
|
34
|
+
{ header: 'MNPs supplimentation:(6-23 children) - V', value: (row) => row.danger_signs ?? '' },
|
|
35
|
+
{
|
|
36
|
+
header: 'Childs assessed for Developmental milestones including 1st Haed control ,2= sitting, 3=talking - W',
|
|
37
|
+
value: (row) => row.disability ?? '',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
header:
|
|
41
|
+
'Any Danger Signs 1.Unable to breastfeed 2.Unable to drink 3.Vomits everything 4.Bloody diarrhoea 5.Has oedema 6.Has convulsions - X',
|
|
42
|
+
value: (row) => row.immunization_status_up_to_date ?? '',
|
|
43
|
+
},
|
|
44
|
+
{ header: 'Any Disability - Y', value: (row) => row.llin_supplimentation_given ?? '' },
|
|
45
|
+
{ header: 'Immunization status up to date(Y/N) - Z', value: (row) => row.follow_up ?? '' },
|
|
46
|
+
{ header: 'LLIN gievn to under 1 years(Y/N) - AA', value: (row) => row.referred_from ?? '' },
|
|
47
|
+
{ header: 'Follow up for: 1=Nutrition service 2=Rehabilitation service - AB', value: (row) => row.referred_to ?? '' },
|
|
48
|
+
{
|
|
49
|
+
header: '1=referred from CU; 2= referred from another H/F; 3=Not applicable - AC',
|
|
50
|
+
value: (row) => row.remarks ?? '',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import ReportFiltersComponent from '../../common/report-filters
|
|
2
|
+
import { ReportFiltersComponent, type ReportPeriod } from '../../common/report-filters';
|
|
3
|
+
import { showReportError } from '../../common/report-error';
|
|
4
|
+
import { hasReportData, ReportPlaceholder } from '../../common/report-placeholder';
|
|
3
5
|
|
|
4
6
|
import styles from './moh711.scss';
|
|
5
7
|
import classNames from 'classnames';
|
|
6
8
|
import { useSession } from '@openmrs/esm-framework';
|
|
9
|
+
import dayjs from 'dayjs';
|
|
7
10
|
import { getMoh711 } from '../../resources/moh-711.resource';
|
|
8
|
-
import { Loading } from '@carbon/react';
|
|
9
11
|
import TBScreeningComponent from './sections/tb-screening.component';
|
|
10
12
|
import ANCComponent from './sections/anc.component';
|
|
11
13
|
import MaternityComponent from './sections/maternity.component';
|
|
@@ -20,14 +22,15 @@ import MedicalSocialWorkComponent from './sections/medical-social-work.component
|
|
|
20
22
|
import PhysiotherapyComponent from './sections/physiotherapy.component';
|
|
21
23
|
import OtherComponent from './sections/other.component';
|
|
22
24
|
import ReportCompiledByComponent from './sections/report-compiled-by.component';
|
|
23
|
-
import {
|
|
25
|
+
import { ReportSkeleton } from '../../common/report-skeleton';
|
|
26
|
+
import { ReportPage } from '../../common/report-page';
|
|
24
27
|
|
|
25
28
|
const Moh711Report: React.FC = () => {
|
|
26
|
-
let errorMessage: string = '';
|
|
27
29
|
const [moh711Data, setMoh711Data] = useState<any>(() => {
|
|
28
30
|
const saved = sessionStorage.getItem('moh711Data');
|
|
29
31
|
return saved ? JSON.parse(saved) : [];
|
|
30
32
|
});
|
|
33
|
+
const isReportGenerated = hasReportData(moh711Data);
|
|
31
34
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
32
35
|
const [startDate, setStartDate] = useState<string>(() => {
|
|
33
36
|
return sessionStorage.getItem('moh711StartDate') || '';
|
|
@@ -51,36 +54,19 @@ const Moh711Report: React.FC = () => {
|
|
|
51
54
|
const session = useSession();
|
|
52
55
|
const locationUuid = session?.sessionLocation?.uuid;
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
/* The masthead names the location the report was generated from; county and
|
|
58
|
+
sub-county come from the response where the ETL supplies them. Month and
|
|
59
|
+
year follow the period generated, not today. */
|
|
60
|
+
const facility = session?.sessionLocation?.display ?? moh711Data?.facility ?? '';
|
|
61
|
+
const county = moh711Data?.county ?? '';
|
|
62
|
+
const subCounty = moh711Data?.sub_county ?? '';
|
|
63
|
+
const reportMonth = startDate ? dayjs(startDate).format('MMMM') : '';
|
|
64
|
+
const reportYear = startDate ? dayjs(startDate).format('YYYY') : '';
|
|
56
65
|
|
|
57
|
-
|
|
58
|
-
const [year, monthIndex] = filters.month.split('-').map(Number);
|
|
59
|
-
|
|
60
|
-
const start = new Date(year, monthIndex - 1, 1);
|
|
61
|
-
const end = new Date(year, monthIndex, 0);
|
|
62
|
-
|
|
63
|
-
const formatLocalDate = (d: Date) => {
|
|
64
|
-
const y = d.getFullYear();
|
|
65
|
-
const m = String(d.getMonth() + 1).padStart(2, '0');
|
|
66
|
-
const day = String(d.getDate()).padStart(2, '0');
|
|
67
|
-
return `${y}-${m}-${day}`;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
sDate = formatLocalDate(start);
|
|
71
|
-
eDate = formatLocalDate(end);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
setStartDate(sDate || '');
|
|
75
|
-
setEndDate(eDate || '');
|
|
76
|
-
|
|
77
|
-
return { startDate: sDate, endDate: eDate };
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const fetchMoh711ReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
|
|
66
|
+
const fetchMoh711ReportData = async ({ startDate, endDate }: ReportPeriod) => {
|
|
81
67
|
setIsLoading(true);
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
setStartDate(startDate);
|
|
69
|
+
setEndDate(endDate);
|
|
84
70
|
|
|
85
71
|
const params = {
|
|
86
72
|
locationUuids: locationUuid || '',
|
|
@@ -94,89 +80,91 @@ const Moh711Report: React.FC = () => {
|
|
|
94
80
|
setIsLoading(false);
|
|
95
81
|
} catch (error) {
|
|
96
82
|
setIsLoading(false);
|
|
97
|
-
|
|
98
|
-
|
|
83
|
+
setIsLoading(false);
|
|
84
|
+
showReportError('the MOH-711 report', error);
|
|
99
85
|
}
|
|
100
86
|
};
|
|
101
87
|
return (
|
|
102
88
|
<>
|
|
103
89
|
<ReportFiltersComponent
|
|
104
90
|
reportName="MOH-711 Report"
|
|
105
|
-
mode="
|
|
91
|
+
mode="both"
|
|
106
92
|
onGenerate={fetchMoh711ReportData}
|
|
107
|
-
|
|
93
|
+
isLoading={isLoading}
|
|
94
|
+
isReportGenerated={isReportGenerated}
|
|
95
|
+
generatedPeriod={{ startDate, endDate }}
|
|
108
96
|
/>
|
|
109
|
-
{isLoading && <
|
|
110
|
-
{!isLoading &&
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
97
|
+
{isLoading && <ReportSkeleton />}
|
|
98
|
+
{!isLoading && !isReportGenerated && <ReportPlaceholder reportName="MOH-711" />}
|
|
99
|
+
{!isLoading && isReportGenerated && (
|
|
100
|
+
<ReportPage>
|
|
101
|
+
<div className={styles.headerContainer}>
|
|
102
|
+
<div className={styles.mainTitleBox}>
|
|
103
|
+
<h5>
|
|
104
|
+
INTEGRATED PROGRAM SUMMARY REPORT FORM: REPRODUCTIVE AND CHILD HEALTH, MEDICAL AND REHABILITATION
|
|
105
|
+
SERVICES
|
|
106
|
+
</h5>
|
|
107
|
+
<div className={styles.locationContainer}>
|
|
108
|
+
<span>
|
|
109
|
+
Facility Name: <span className={styles.line}>{facility}</span>
|
|
110
|
+
</span>
|
|
111
|
+
<span>
|
|
112
|
+
County: <span className={styles.line}>{county}</span>
|
|
113
|
+
</span>
|
|
114
|
+
<span>
|
|
115
|
+
Sub County: <span className={styles.line}>{subCounty}</span>
|
|
116
|
+
</span>
|
|
117
|
+
<span>
|
|
118
|
+
Month: <span className={styles.shortLine}>{reportMonth}</span>
|
|
119
|
+
</span>
|
|
120
|
+
<span>
|
|
121
|
+
Year: <span className={styles.shortLine}>{reportYear}</span>
|
|
122
|
+
</span>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<div className={styles.container}>
|
|
127
|
+
<div className={styles.left}>
|
|
128
|
+
<ANCComponent
|
|
129
|
+
moh711Data={moh711Data}
|
|
130
|
+
startDate={startDate}
|
|
131
|
+
endDate={endDate}
|
|
132
|
+
locationUuids={locationUuid!}
|
|
133
|
+
/>
|
|
134
|
+
<GBVComponent moh711Data={moh711Data} />
|
|
135
|
+
<FamilyPlanningComponent moh711Data={moh711Data} />
|
|
136
|
+
<CervicalCancerComponent
|
|
137
|
+
moh711Data={moh711Data}
|
|
138
|
+
startDate={startDate}
|
|
139
|
+
endDate={endDate}
|
|
140
|
+
locationUuids={locationUuid!}
|
|
141
|
+
/>
|
|
142
|
+
<PNCComponent
|
|
143
|
+
moh711Data={moh711Data}
|
|
144
|
+
startDate={startDate}
|
|
145
|
+
endDate={endDate}
|
|
146
|
+
locationUuids={locationUuid!}
|
|
147
|
+
/>
|
|
148
|
+
<RehabilitationComponent moh711Data={moh711Data} />
|
|
149
|
+
<MedicalSocialWorkComponent moh711Data={moh711Data} />
|
|
150
|
+
<ReportCompiledByComponent />
|
|
151
|
+
</div>
|
|
152
|
+
<div className={styles.right}>
|
|
153
|
+
<MaternityComponent
|
|
154
|
+
moh711Data={moh711Data}
|
|
155
|
+
startDate={startDate}
|
|
156
|
+
endDate={endDate}
|
|
157
|
+
locationUuids={locationUuid!}
|
|
158
|
+
/>
|
|
159
|
+
<PostAbortion moh711Data={moh711Data} />
|
|
160
|
+
<ChanisComponent moh711Data={moh711Data} />
|
|
161
|
+
<PhysiotherapyComponent moh711Data={moh711Data} />
|
|
162
|
+
<OtherComponent moh711Data={MaternityComponent} />
|
|
163
|
+
<TBScreeningComponent moh711Data={moh711Data} />
|
|
164
|
+
</div>
|
|
147
165
|
</div>
|
|
148
|
-
</
|
|
149
|
-
|
|
150
|
-
<div className={styles.container}>
|
|
151
|
-
<div className={styles.left}>
|
|
152
|
-
<ANCComponent moh711Data={moh711Data} startDate={startDate} endDate={endDate} locationUuids={locationUuid!} />
|
|
153
|
-
<GBVComponent moh711Data={moh711Data} />
|
|
154
|
-
<FamilyPlanningComponent moh711Data={moh711Data} />
|
|
155
|
-
<CervicalCancerComponent
|
|
156
|
-
moh711Data={moh711Data}
|
|
157
|
-
startDate={startDate}
|
|
158
|
-
endDate={endDate}
|
|
159
|
-
locationUuids={locationUuid!}
|
|
160
|
-
/>
|
|
161
|
-
<PNCComponent moh711Data={moh711Data} startDate={startDate} endDate={endDate} locationUuids={locationUuid!} />
|
|
162
|
-
<RehabilitationComponent moh711Data={moh711Data} />
|
|
163
|
-
<MedicalSocialWorkComponent moh711Data={moh711Data} />
|
|
164
|
-
<ReportCompiledByComponent />
|
|
165
|
-
</div>
|
|
166
|
-
<div className={styles.right}>
|
|
167
|
-
<MaternityComponent
|
|
168
|
-
moh711Data={moh711Data}
|
|
169
|
-
startDate={startDate}
|
|
170
|
-
endDate={endDate}
|
|
171
|
-
locationUuids={locationUuid!}
|
|
172
|
-
/>
|
|
173
|
-
<PostAbortion moh711Data={moh711Data} />
|
|
174
|
-
<ChanisComponent moh711Data={moh711Data} />
|
|
175
|
-
<PhysiotherapyComponent moh711Data={moh711Data} />
|
|
176
|
-
<OtherComponent moh711Data={MaternityComponent} />
|
|
177
|
-
<TBScreeningComponent moh711Data={moh711Data} />
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
166
|
+
</ReportPage>
|
|
167
|
+
)}
|
|
180
168
|
</>
|
|
181
169
|
);
|
|
182
170
|
};
|