@ampath/esm-reports-app 1.0.0-next.2 → 1.0.0-next.21
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/138.js +2 -0
- package/dist/138.js.LICENSE.txt +20 -0
- package/dist/138.js.map +1 -0
- package/dist/184.js +1 -1
- package/dist/184.js.map +1 -1
- package/dist/205.js +1 -0
- package/dist/205.js.map +1 -0
- package/dist/282.js +1 -1
- package/dist/282.js.LICENSE.txt +3 -3
- package/dist/282.js.map +1 -1
- package/dist/311.js +1 -0
- package/dist/311.js.map +1 -0
- package/dist/353.js +1 -1
- package/dist/353.js.map +1 -1
- package/dist/478.js +2 -0
- package/dist/478.js.LICENSE.txt +9 -0
- package/dist/478.js.map +1 -0
- package/dist/51.js +1 -0
- package/dist/51.js.map +1 -0
- package/dist/540.js +1 -1
- package/dist/540.js.map +1 -1
- package/dist/812.js +1 -0
- package/dist/812.js.map +1 -0
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/ampath-esm-reports-app.js.buildmanifest.json +128 -151
- package/dist/ampath-esm-reports-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -1
- package/src/common/report-filters/report-filters.component.tsx +127 -0
- package/src/common/report-filters/report-filters.scss +49 -0
- package/src/config-schema.ts +6 -37
- package/src/createDashboardLink.tsx +9 -0
- package/src/dashboard/reports-dasboard.tsx +44 -0
- package/src/dashboard/reports-dashboard.module.scss +14 -0
- package/src/dashboard-meta/reports-dashboard.meta.ts +6 -0
- package/src/index.ts +6 -35
- package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +54 -0
- package/src/reports/moh-240/moh-240-header.component.tsx +61 -0
- package/src/reports/moh-240/moh-240.component.tsx +68 -0
- package/src/reports/moh-240/moh-240.scss +3 -0
- package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +72 -0
- package/src/reports/moh-240/sub-reports/page-summary.component.tsx +95 -0
- package/src/reports/moh-505/moh-505-header.component.tsx +62 -0
- package/src/reports/moh-505/moh-505.component.tsx +240 -0
- package/src/reports/moh-505/moh-505.scss +3 -0
- package/src/reports/moh-705B/moh-705b.component.tsx +466 -0
- package/src/reports/moh-705B/moh-705b.scss +41 -0
- package/src/reports/moh-705a/moh-705a.component.tsx +473 -0
- package/src/reports/moh-705a/moh-705a.scss +41 -0
- package/src/reports/moh-706/moh-706-header.component.tsx +61 -0
- package/src/reports/moh-706/moh-706.component.tsx +104 -0
- package/src/reports/moh-706/moh-706.scss +30 -0
- package/src/reports/moh-706/sub-reports/bacteriology/bacteriology.component.tsx +124 -0
- package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +318 -0
- package/src/reports/moh-706/sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component.tsx +137 -0
- package/src/reports/moh-706/sub-reports/haematology/haematology.component.tsx +179 -0
- package/src/reports/moh-706/sub-reports/histology-and-cytology/histology-and-cytology.component.tsx +88 -0
- package/src/reports/moh-706/sub-reports/parasitology/parasitology.component.tsx +121 -0
- package/src/reports/moh-706/sub-reports/serology/serology.component.tsx +47 -0
- package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +39 -0
- package/src/reports/moh-706/sub-reports/urine-analysis/urine-analysis.component.tsx +108 -0
- package/src/reports/moh-710/moh-710.component.tsx +663 -0
- package/src/reports/moh-710/moh-710.scss +41 -0
- package/src/reports/moh-711/moh-711.component.tsx +121 -0
- package/src/reports/moh-711/moh711.scss +71 -0
- package/src/reports/moh-711/sections/anc.component.tsx +134 -0
- package/src/reports/moh-711/sections/cervical-cancer.component.tsx +104 -0
- package/src/reports/moh-711/sections/chanis.component.tsx +367 -0
- package/src/reports/moh-711/sections/family-planning.component.tsx +221 -0
- package/src/reports/moh-711/sections/gbv.component.tsx +115 -0
- package/src/reports/moh-711/sections/maternity.component.tsx +280 -0
- package/src/reports/moh-711/sections/medical-social-work.component.tsx +83 -0
- package/src/reports/moh-711/sections/other.component.tsx +47 -0
- package/src/reports/moh-711/sections/physiotherapy.component.tsx +61 -0
- package/src/reports/moh-711/sections/pnc.component.tsx +92 -0
- package/src/reports/moh-711/sections/post-abortion.component.tsx +42 -0
- package/src/reports/moh-711/sections/rehabilitation.component.tsx +57 -0
- package/src/reports/moh-711/sections/report-compiled-by.component.tsx +42 -0
- package/src/reports/moh-711/sections/tb-screening.component.tsx +57 -0
- package/src/reports/moh-717/moh-717.component.tsx +152 -0
- package/src/reports/moh-717/moh717.scss +150 -0
- package/src/reports/moh-717/sections/finance.component.tsx +42 -0
- package/src/reports/moh-717/sections/inpatient.component.tsx +374 -0
- package/src/reports/moh-717/sections/maternity.component.tsx +94 -0
- package/src/reports/moh-717/sections/medical-records.component.tsx +35 -0
- package/src/reports/moh-717/sections/mortuary.component.tsx +43 -0
- package/src/reports/moh-717/sections/operations.component.tsx +53 -0
- package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +98 -0
- package/src/reports/moh-717/sections/outpatient.component.tsx +489 -0
- package/src/reports/moh-717/sections/pharmacy.component.tsx +43 -0
- package/src/reports/moh-717/sections/preparedby.component.tsx +47 -0
- package/src/reports/moh-717/sections/special-services.component.tsx +114 -0
- package/src/reports/moh-740/moh-740.component.scss +120 -0
- package/src/reports/moh-740/moh-740.component.tsx +907 -0
- package/src/reports/moh-740/moh-740.resource.ts +42 -0
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +6 -0
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +58 -0
- package/src/reports/moh-740/registers/moh-740-patient-list.scss +0 -0
- package/src/reports/moh-740/registers/moh-740-patient-list.tsx +43 -0
- package/src/reports/moh-740/shared/data-cell/data-cell.scss +6 -0
- package/src/reports/moh-740/shared/data-cell/data-cell.tsx +23 -0
- package/src/reports/moh-740/types/index.ts +115 -0
- package/src/reports/moh-745/moh-745.component.tsx +629 -0
- package/src/reports/moh-745/moh-745.scss +69 -0
- package/src/reports/table-wrapper/table-row-mapper.component.tsx +51 -0
- package/src/reports/table-wrapper/table-wrapper.component.tsx +21 -0
- package/src/reports/table-wrapper/table-wrapper.scss +31 -0
- package/src/resources/moh-705.resource.ts +60 -0
- package/src/resources/moh-706.resource.ts +86 -0
- package/src/resources/moh-710.resource.ts +34 -0
- package/src/resources/moh-711.resource.ts +34 -0
- package/src/resources/moh-717.resource.ts +35 -0
- package/src/resources/moh-745.resource.ts +34 -0
- package/src/root.component.tsx +30 -32
- package/src/routes.json +14 -17
- package/src/utils/get-base-url.ts +12 -0
- package/src/utils/utils.ts +36 -0
- package/dist/19.js +0 -2
- package/dist/19.js.LICENSE.txt +0 -39
- package/dist/19.js.map +0 -1
- package/dist/255.js +0 -1
- package/dist/255.js.map +0 -1
- package/dist/389.js +0 -1
- package/dist/389.js.map +0 -1
- package/dist/451.js +0 -1
- package/dist/451.js.map +0 -1
- package/dist/488.js +0 -1
- package/dist/488.js.map +0 -1
- package/dist/557.js +0 -1
- package/dist/557.js.map +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/970.js +0 -1
- package/dist/970.js.map +0 -1
- package/src/boxes/extensions/blue-box.component.tsx +0 -15
- package/src/boxes/extensions/box.scss +0 -23
- package/src/boxes/extensions/brand-box.component.tsx +0 -15
- package/src/boxes/extensions/red-box.component.tsx +0 -15
- package/src/boxes/slot/boxes.component.tsx +0 -25
- package/src/boxes/slot/boxes.scss +0 -29
- package/src/greeter/greeter.component.tsx +0 -42
- package/src/greeter/greeter.scss +0 -20
- package/src/greeter/greeter.test.tsx +0 -28
- package/src/patient-getter/patient-getter.component.tsx +0 -40
- package/src/patient-getter/patient-getter.resource.ts +0 -39
- package/src/patient-getter/patient-getter.scss +0 -16
- package/src/patient-getter/patient-getter.test.tsx +0 -40
- package/src/resources/resources.component.tsx +0 -56
- package/src/resources/resources.scss +0 -68
- package/src/root.test.tsx +0 -51
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { getMoh705a } from '../../resources/moh-705.resource';
|
|
4
|
+
|
|
5
|
+
import styles from './moh-705a.scss';
|
|
6
|
+
import ReportFiltersComponent from '../../common/report-filters/report-filters.component';
|
|
7
|
+
import { Loading } from '@carbon/react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
|
|
10
|
+
const Moh705AComponent: React.FC = () => {
|
|
11
|
+
let errorMessage: string = '';
|
|
12
|
+
const [moh705aData, setMoh705aData] = useState<any>([]);
|
|
13
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
14
|
+
|
|
15
|
+
const session = useSession();
|
|
16
|
+
const locationUuids = session?.sessionLocation?.uuid;
|
|
17
|
+
const fetchMoh705bReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
|
|
18
|
+
setIsLoading(true);
|
|
19
|
+
let startDate = filters.startDate;
|
|
20
|
+
let endDate = filters.endDate;
|
|
21
|
+
|
|
22
|
+
if (filters.month) {
|
|
23
|
+
const [year, monthIndex] = filters.month.split('-').map(Number);
|
|
24
|
+
|
|
25
|
+
const start = new Date(year, monthIndex - 1, 1);
|
|
26
|
+
const end = new Date(year, monthIndex, 0);
|
|
27
|
+
|
|
28
|
+
const formatLocalDate = (d: Date) => {
|
|
29
|
+
const year = d.getFullYear();
|
|
30
|
+
const month = String(d.getMonth() + 1).padStart(2, '0');
|
|
31
|
+
const day = String(d.getDate()).padStart(2, '0');
|
|
32
|
+
return `${year}-${month}-${day}`;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
startDate = formatLocalDate(start);
|
|
36
|
+
endDate = formatLocalDate(end);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const params = {
|
|
40
|
+
locationUuids: locationUuids || '',
|
|
41
|
+
startDate,
|
|
42
|
+
endDate,
|
|
43
|
+
};
|
|
44
|
+
try {
|
|
45
|
+
const data = await getMoh705a(params);
|
|
46
|
+
const flatData = Object.assign({}, ...data.result);
|
|
47
|
+
setMoh705aData(flatData);
|
|
48
|
+
setIsLoading(false);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
errorMessage = error instanceof Error ? error.message : String(error);
|
|
51
|
+
setIsLoading(false);
|
|
52
|
+
throw new Error(`Failed to fetch MOH-710 report data: ${error instanceof Error ? error.message : String(error)}`);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<ReportFiltersComponent
|
|
59
|
+
reportName="MOH-705A Report"
|
|
60
|
+
mode="monthly"
|
|
61
|
+
onGenerate={fetchMoh705bReportData}
|
|
62
|
+
isLoding={isLoading}
|
|
63
|
+
/>
|
|
64
|
+
{isLoading && <Loading description="Fetching data...." />}
|
|
65
|
+
{!isLoading && errorMessage && (
|
|
66
|
+
<div>
|
|
67
|
+
<a href="#" className="close" data-dismiss="alert">
|
|
68
|
+
×
|
|
69
|
+
</a>
|
|
70
|
+
<h4>
|
|
71
|
+
<strong>
|
|
72
|
+
<span className="glyphicon glyphicon-warning-sign"></span>{' '}
|
|
73
|
+
</strong>{' '}
|
|
74
|
+
An error occurred while trying to load the report. Please try again.
|
|
75
|
+
</h4>
|
|
76
|
+
<p>
|
|
77
|
+
<small>{errorMessage}</small>
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
<h3>KHIS Aggregate</h3>
|
|
82
|
+
<div className={styles.container}>
|
|
83
|
+
<table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
|
|
84
|
+
<thead>
|
|
85
|
+
<tr>
|
|
86
|
+
<th colSpan={2}>DISEASES (New Cases Only)</th>
|
|
87
|
+
<th>Number of Cases</th>
|
|
88
|
+
</tr>
|
|
89
|
+
</thead>
|
|
90
|
+
<tbody>
|
|
91
|
+
<tr>
|
|
92
|
+
<td>1</td>
|
|
93
|
+
<td>Diarrhoea with no dehydration</td>
|
|
94
|
+
<td>{moh705aData.diarrhoea_with_no_dehydration}</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td>2</td>
|
|
98
|
+
<td>Diarrhoea with some dehydration</td>
|
|
99
|
+
<td>{moh705aData.diarrhoea_with_some_dehydration}</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td>3</td>
|
|
103
|
+
<td>Diarrhoea with severe dehydration</td>
|
|
104
|
+
<td>{moh705aData.diarrhoea_with_severe_dehydration}</td>
|
|
105
|
+
</tr>
|
|
106
|
+
<tr>
|
|
107
|
+
<td>4</td>
|
|
108
|
+
<td>Cholera</td>
|
|
109
|
+
<td>{moh705aData.cholera}</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td>5</td>
|
|
113
|
+
<td>Dysentary (Blood diarrhoea)</td>
|
|
114
|
+
<td>{moh705aData.dysentry}</td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr>
|
|
117
|
+
<td>6</td>
|
|
118
|
+
<td>Gastroenterities</td>
|
|
119
|
+
<td>{moh705aData.gastroenterities}</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td>7</td>
|
|
123
|
+
<td>Pneomonia</td>
|
|
124
|
+
<td>{moh705aData.pneumonia}</td>
|
|
125
|
+
</tr>
|
|
126
|
+
<tr>
|
|
127
|
+
<td>8</td>
|
|
128
|
+
<td>Severe pneumonia</td>
|
|
129
|
+
<td>{moh705aData.severe_pneumonia}</td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td>9</td>
|
|
133
|
+
<td>Upper Respiratory Tract Infections</td>
|
|
134
|
+
<td>{moh705aData.upper_respiratory_tract_infections}</td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<td>10</td>
|
|
138
|
+
<td>Lower Respiratory Tract Infections</td>
|
|
139
|
+
<td>{moh705aData.lower_respiratory_tract_infections}</td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td>11</td>
|
|
143
|
+
<td>Asthma</td>
|
|
144
|
+
<td>{moh705aData.asthma}</td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr>
|
|
147
|
+
<td>12</td>
|
|
148
|
+
<td>Presumed Tuberculosis</td>
|
|
149
|
+
<td>{moh705aData.presumed_tuberculosis}</td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td>13</td>
|
|
153
|
+
<td>Suspected Malaria</td>
|
|
154
|
+
<td>{moh705aData.suspected_malaria}</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td>14</td>
|
|
158
|
+
<td>Tested for Malaria</td>
|
|
159
|
+
<td>{moh705aData.tested_for_malaria}</td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td>15</td>
|
|
163
|
+
<td>Confirmed malaria</td>
|
|
164
|
+
<td>{moh705aData.confirmed_malaria}</td>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr>
|
|
167
|
+
<td>16</td>
|
|
168
|
+
<td>Ear infection</td>
|
|
169
|
+
<td>{moh705aData.ear_infection}</td>
|
|
170
|
+
</tr>
|
|
171
|
+
<tr>
|
|
172
|
+
<td>17</td>
|
|
173
|
+
<td>Malnutrition</td>
|
|
174
|
+
<td>{moh705aData.malnutrition}</td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr>
|
|
177
|
+
<td>18</td>
|
|
178
|
+
<td>Anaemia</td>
|
|
179
|
+
<td>{moh705aData.anaemia}</td>
|
|
180
|
+
</tr>
|
|
181
|
+
<tr>
|
|
182
|
+
<td>19</td>
|
|
183
|
+
<td>Meningococcal Menengitis</td>
|
|
184
|
+
<td>{moh705aData.meningococcal_meningitis}</td>
|
|
185
|
+
</tr>
|
|
186
|
+
<tr>
|
|
187
|
+
<td>20</td>
|
|
188
|
+
<td>Other Meningitis</td>
|
|
189
|
+
<td>{moh705aData.other_meningitis}</td>
|
|
190
|
+
</tr>
|
|
191
|
+
<tr>
|
|
192
|
+
<td>21</td>
|
|
193
|
+
<td>Neonatal Sepsis</td>
|
|
194
|
+
<td>{moh705aData.neonatal_sepsis}</td>
|
|
195
|
+
</tr>
|
|
196
|
+
<tr>
|
|
197
|
+
<td>22</td>
|
|
198
|
+
<td>Neonatal Tetanus</td>
|
|
199
|
+
<td>{moh705aData.neonatal_tetanus}</td>
|
|
200
|
+
</tr>
|
|
201
|
+
<tr>
|
|
202
|
+
<td>23</td>
|
|
203
|
+
<td>Poliomyelitis (AFP)</td>
|
|
204
|
+
<td>{moh705aData.poliomyelitis}</td>
|
|
205
|
+
</tr>
|
|
206
|
+
<tr>
|
|
207
|
+
<td>24</td>
|
|
208
|
+
<td>Chicken Pox</td>
|
|
209
|
+
<td>{moh705aData.chicken_pox}</td>
|
|
210
|
+
</tr>
|
|
211
|
+
<tr>
|
|
212
|
+
<td>25</td>
|
|
213
|
+
<td>Measles</td>
|
|
214
|
+
<td>{moh705aData.measles}</td>
|
|
215
|
+
</tr>
|
|
216
|
+
<tr>
|
|
217
|
+
<td>26</td>
|
|
218
|
+
<td>Hepatitis</td>
|
|
219
|
+
<td>{moh705aData.hepatitis}</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td>27</td>
|
|
223
|
+
<td>Amoebiasis</td>
|
|
224
|
+
<td>{moh705aData.amoebiasis}</td>
|
|
225
|
+
</tr>
|
|
226
|
+
<tr>
|
|
227
|
+
<td>28</td>
|
|
228
|
+
<td>Mumps</td>
|
|
229
|
+
<td>{moh705aData.mumps}</td>
|
|
230
|
+
</tr>
|
|
231
|
+
<tr>
|
|
232
|
+
<td>29</td>
|
|
233
|
+
<td>Typhoid fever</td>
|
|
234
|
+
<td>{moh705aData.typhoid_fever}</td>
|
|
235
|
+
</tr>
|
|
236
|
+
<tr>
|
|
237
|
+
<td>30</td>
|
|
238
|
+
<td>Bilharzia (Schistosomiasis)</td>
|
|
239
|
+
<td>{moh705aData.bilharzia}</td>
|
|
240
|
+
</tr>
|
|
241
|
+
<tr>
|
|
242
|
+
<td>31</td>
|
|
243
|
+
<td>Intestinal worms</td>
|
|
244
|
+
<td>{moh705aData.intestinal_worms}</td>
|
|
245
|
+
</tr>
|
|
246
|
+
<tr>
|
|
247
|
+
<td>32</td>
|
|
248
|
+
<td>Eye Infections</td>
|
|
249
|
+
<td>{moh705aData.eye_infections}</td>
|
|
250
|
+
</tr>
|
|
251
|
+
<tr>
|
|
252
|
+
<td>33</td>
|
|
253
|
+
<td>Tonsilitis</td>
|
|
254
|
+
<td>{moh705aData.tonsilities}</td>
|
|
255
|
+
</tr>
|
|
256
|
+
<tr>
|
|
257
|
+
<td>34</td>
|
|
258
|
+
<td>Urinary Tract Infection</td>
|
|
259
|
+
<td>{moh705aData.urinary_tract_infections}</td>
|
|
260
|
+
</tr>
|
|
261
|
+
<tr>
|
|
262
|
+
<td>35</td>
|
|
263
|
+
<td>Mental Disorders</td>
|
|
264
|
+
<td>{moh705aData.mental_disorders}</td>
|
|
265
|
+
</tr>
|
|
266
|
+
<tr>
|
|
267
|
+
<td>36</td>
|
|
268
|
+
<td>Dental Disorders</td>
|
|
269
|
+
<td>{moh705aData.dental_disorders}</td>
|
|
270
|
+
</tr>
|
|
271
|
+
<tr>
|
|
272
|
+
<td>37</td>
|
|
273
|
+
<td>Jiggers Infestation</td>
|
|
274
|
+
<td>{moh705aData.jiggers_infestation}</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td>38</td>
|
|
278
|
+
<td>Diseases fo the skin</td>
|
|
279
|
+
<td>{moh705aData.diseases_of_the_skin}</td>
|
|
280
|
+
</tr>
|
|
281
|
+
<tr>
|
|
282
|
+
<td>39</td>
|
|
283
|
+
<td>Down's syndrome</td>
|
|
284
|
+
<td>{moh705aData.downs_syndrome}</td>
|
|
285
|
+
</tr>
|
|
286
|
+
<tr>
|
|
287
|
+
<td>40</td>
|
|
288
|
+
<td>Poisoning</td>
|
|
289
|
+
<td>{moh705aData.poisoning}</td>
|
|
290
|
+
</tr>
|
|
291
|
+
<tr>
|
|
292
|
+
<td>41</td>
|
|
293
|
+
<td>Road Traffic Injuries</td>
|
|
294
|
+
<td>{moh705aData.road_traffic_injuries}</td>
|
|
295
|
+
</tr>
|
|
296
|
+
<tr>
|
|
297
|
+
<td>42</td>
|
|
298
|
+
<td>Deaths due to Road Traffic Injuries</td>
|
|
299
|
+
<td>{moh705aData.deaths_due_to_road_traffic_injuries}</td>
|
|
300
|
+
</tr>
|
|
301
|
+
<tr>
|
|
302
|
+
<td>43</td>
|
|
303
|
+
<td>Violence related injuries</td>
|
|
304
|
+
<td>{moh705aData.violence_related_injuries}</td>
|
|
305
|
+
</tr>
|
|
306
|
+
<tr>
|
|
307
|
+
<td>44</td>
|
|
308
|
+
<td>Other injuries</td>
|
|
309
|
+
<td>{moh705aData.other_injuries}</td>
|
|
310
|
+
</tr>
|
|
311
|
+
<tr>
|
|
312
|
+
<td>45</td>
|
|
313
|
+
<td>Sexual Violence</td>
|
|
314
|
+
<td>{moh705aData.sexual_violence}</td>
|
|
315
|
+
</tr>
|
|
316
|
+
<tr>
|
|
317
|
+
<td>46</td>
|
|
318
|
+
<td>Burns</td>
|
|
319
|
+
<td>{moh705aData.burns}</td>
|
|
320
|
+
</tr>
|
|
321
|
+
<tr>
|
|
322
|
+
<td>47</td>
|
|
323
|
+
<td>Snake Bites</td>
|
|
324
|
+
<td>{moh705aData.snake_bites}</td>
|
|
325
|
+
</tr>
|
|
326
|
+
<tr>
|
|
327
|
+
<td>48</td>
|
|
328
|
+
<td>Dog bites</td>
|
|
329
|
+
<td>{moh705aData.dog_bites}</td>
|
|
330
|
+
</tr>
|
|
331
|
+
<tr>
|
|
332
|
+
<td>49</td>
|
|
333
|
+
<td>Other Bites</td>
|
|
334
|
+
<td>{moh705aData.other_bites}</td>
|
|
335
|
+
</tr>
|
|
336
|
+
<tr>
|
|
337
|
+
<td>50</td>
|
|
338
|
+
<td>Diabetes</td>
|
|
339
|
+
<td>{moh705aData.diabetes}</td>
|
|
340
|
+
</tr>
|
|
341
|
+
<tr>
|
|
342
|
+
<td>51</td>
|
|
343
|
+
<td>Epilepsy</td>
|
|
344
|
+
<td>{moh705aData.epilepsy}</td>
|
|
345
|
+
</tr>
|
|
346
|
+
<tr>
|
|
347
|
+
<td>52</td>
|
|
348
|
+
<td>Other Convulsive Disorders</td>
|
|
349
|
+
<td>{moh705aData.other_convulsive_disorders}</td>
|
|
350
|
+
</tr>
|
|
351
|
+
<tr>
|
|
352
|
+
<td>53</td>
|
|
353
|
+
<td>Rheumatic Fever</td>
|
|
354
|
+
<td>{moh705aData.rheumatic_fever}</td>
|
|
355
|
+
</tr>
|
|
356
|
+
<tr>
|
|
357
|
+
<td>54</td>
|
|
358
|
+
<td>Brucellosis</td>
|
|
359
|
+
<td>{moh705aData.brucellosis}</td>
|
|
360
|
+
</tr>
|
|
361
|
+
<tr>
|
|
362
|
+
<td>55</td>
|
|
363
|
+
<td>Rickets</td>
|
|
364
|
+
<td>{moh705aData.rickets}</td>
|
|
365
|
+
</tr>
|
|
366
|
+
<tr>
|
|
367
|
+
<td>56</td>
|
|
368
|
+
<td>Cerebral Palsy</td>
|
|
369
|
+
<td>{moh705aData.cerebral_palsy}</td>
|
|
370
|
+
</tr>
|
|
371
|
+
<tr>
|
|
372
|
+
<td>57</td>
|
|
373
|
+
<td>Autism</td>
|
|
374
|
+
<td>{moh705aData.autism}</td>
|
|
375
|
+
</tr>
|
|
376
|
+
<tr>
|
|
377
|
+
<td>58</td>
|
|
378
|
+
<td>Tryponosomiasis</td>
|
|
379
|
+
<td>{moh705aData.tryponosomiasis}</td>
|
|
380
|
+
</tr>
|
|
381
|
+
<tr>
|
|
382
|
+
<td>59</td>
|
|
383
|
+
<td>Yellow Fever</td>
|
|
384
|
+
<td>{moh705aData.yellow_fever}</td>
|
|
385
|
+
</tr>
|
|
386
|
+
<tr>
|
|
387
|
+
<td>60</td>
|
|
388
|
+
<td>Viral Haemorrhagic Fever</td>
|
|
389
|
+
<td>{moh705aData.viral_haemorrhagic_fever}</td>
|
|
390
|
+
</tr>
|
|
391
|
+
<tr>
|
|
392
|
+
<td>61</td>
|
|
393
|
+
<td>Rift valley fever</td>
|
|
394
|
+
<td>{moh705aData.rift_valley_fever}</td>
|
|
395
|
+
</tr>
|
|
396
|
+
<tr>
|
|
397
|
+
<td>62</td>
|
|
398
|
+
<td>Chikungunya</td>
|
|
399
|
+
<td>{moh705aData.chikungunya}</td>
|
|
400
|
+
</tr>
|
|
401
|
+
<tr>
|
|
402
|
+
<td>63</td>
|
|
403
|
+
<td>Dengue fever</td>
|
|
404
|
+
<td>{moh705aData.dengue_fever}</td>
|
|
405
|
+
</tr>
|
|
406
|
+
<tr>
|
|
407
|
+
<td>64</td>
|
|
408
|
+
<td>Leishmaniasis(Kalaazar)</td>
|
|
409
|
+
<td>{moh705aData.leishmaniasis}</td>
|
|
410
|
+
</tr>
|
|
411
|
+
<tr>
|
|
412
|
+
<td>65</td>
|
|
413
|
+
<td>Cutaneous leishmaniasis</td>
|
|
414
|
+
<td>{moh705aData.cutaneous_leishmaniasis}</td>
|
|
415
|
+
</tr>
|
|
416
|
+
<tr>
|
|
417
|
+
<td>66</td>
|
|
418
|
+
<td>Suspected anthrax</td>
|
|
419
|
+
<td>{moh705aData.suspected_anthrax}</td>
|
|
420
|
+
</tr>
|
|
421
|
+
<tr>
|
|
422
|
+
<td>67</td>
|
|
423
|
+
<td>Suspected Childhood Cancers</td>
|
|
424
|
+
<td>{moh705aData.suspected_childhood_cancers}</td>
|
|
425
|
+
</tr>
|
|
426
|
+
<tr>
|
|
427
|
+
<td>68</td>
|
|
428
|
+
<td>Hypoxaemia (Spo2<90%)</td>
|
|
429
|
+
<td>{moh705aData.hypoxaemia}</td>
|
|
430
|
+
</tr>
|
|
431
|
+
<tr>
|
|
432
|
+
<td>69</td>
|
|
433
|
+
<td>All Other Diseases</td>
|
|
434
|
+
<td>{moh705aData.all_other_diseases}</td>
|
|
435
|
+
</tr>
|
|
436
|
+
<tr>
|
|
437
|
+
<td>70</td>
|
|
438
|
+
<td>No. of New Attendances</td>
|
|
439
|
+
<td>{moh705aData.new_attendances}</td>
|
|
440
|
+
</tr>
|
|
441
|
+
<tr>
|
|
442
|
+
<td>71</td>
|
|
443
|
+
<td>No of Re-Attendances</td>
|
|
444
|
+
<td>{moh705aData.re_attendances}</td>
|
|
445
|
+
</tr>
|
|
446
|
+
<tr>
|
|
447
|
+
<td>72</td>
|
|
448
|
+
<td>Referrals From Other Health Facility</td>
|
|
449
|
+
<td>{moh705aData.referrals_from_other_health_facility}</td>
|
|
450
|
+
</tr>
|
|
451
|
+
<tr>
|
|
452
|
+
<td>73</td>
|
|
453
|
+
<td>Referrals To Other Health Facility</td>
|
|
454
|
+
<td>{moh705aData.referrals_to_other_health_facility}</td>
|
|
455
|
+
</tr>
|
|
456
|
+
<tr>
|
|
457
|
+
<td>74</td>
|
|
458
|
+
<td>Referrals From Community Unit</td>
|
|
459
|
+
<td>{moh705aData.referrals_from_community_unit}</td>
|
|
460
|
+
</tr>
|
|
461
|
+
<tr>
|
|
462
|
+
<td>74</td>
|
|
463
|
+
<td>Referrals To Community Unit</td>
|
|
464
|
+
<td>{moh705aData.referrals_to_community_unit}</td>
|
|
465
|
+
</tr>
|
|
466
|
+
</tbody>
|
|
467
|
+
</table>
|
|
468
|
+
</div>
|
|
469
|
+
</>
|
|
470
|
+
);
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
export default Moh705AComponent;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
h3 {
|
|
3
|
+
text-align: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
margin: 0 2rem;
|
|
8
|
+
margin-top: 0.5px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.tableContainer {
|
|
12
|
+
margin-left: 1rem;
|
|
13
|
+
margin-bottom: 1rem;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sectionTitle {
|
|
18
|
+
margin-left: 1rem ;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.title {
|
|
22
|
+
text-align: center;
|
|
23
|
+
font-size: 1rem;
|
|
24
|
+
margin: 1rem;
|
|
25
|
+
}
|
|
26
|
+
.table {
|
|
27
|
+
width: auto;
|
|
28
|
+
border-collapse: collapse;
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tableBordered td,
|
|
33
|
+
.tableBordered th {
|
|
34
|
+
border: 1px solid #dee2e6;
|
|
35
|
+
padding: 1rem;
|
|
36
|
+
font-size: small;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tableStriped tbody tr:nth-of-type(odd) {
|
|
40
|
+
background-color: #f9f9f9;
|
|
41
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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-706.scss';
|
|
6
|
+
|
|
7
|
+
const MOH706Header: React.FC = () => {
|
|
8
|
+
const tableRows = useMemo(() => {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
tableCells: [
|
|
12
|
+
getCell("", "County:", 1, 1, true),
|
|
13
|
+
getCell("", "", 3),
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
tableCells: [
|
|
18
|
+
getCell("", "Sub-County:", 1, 1, true),
|
|
19
|
+
getCell("", "", 3),
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
tableCells: [
|
|
24
|
+
getCell("", "Health Facility:", 1, 1, true),
|
|
25
|
+
getCell("", "", 3),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
tableCells: [
|
|
30
|
+
getCell("", "KMHFL Code:", 1, 1, true),
|
|
31
|
+
getCell("", "", 3),
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
tableCells: [
|
|
36
|
+
getCell("", "Facility Type:", 1, 1, true),
|
|
37
|
+
getCell("", ""),
|
|
38
|
+
getCell("", "Man. Agency:", 1, 1, true),
|
|
39
|
+
getCell("", ""),
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
tableCells: [
|
|
44
|
+
getCell("", "Start Date:", 1, 1, true),
|
|
45
|
+
getCell("", ""),
|
|
46
|
+
getCell("", "End Date:", 1, 1, true),
|
|
47
|
+
getCell("", ""),
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
return <div className={styles.headerSection}>
|
|
54
|
+
<h3>MOH 706 _Laboratory (LAB) Services Summary</h3>
|
|
55
|
+
<TableWrapper>
|
|
56
|
+
<TableRowMapper tableRows={tableRows} />
|
|
57
|
+
</TableWrapper>
|
|
58
|
+
</div>
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default MOH706Header;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
3
|
+
import { Column, Grid, Loading } from '@carbon/react';
|
|
4
|
+
import UrineAnalysis from './sub-reports/urine-analysis/urine-analysis.component';
|
|
5
|
+
import BloodChemistry from './sub-reports/blood-chemistry/blood-chemistry.component';
|
|
6
|
+
import Parasitology from './sub-reports/parasitology/parasitology.component';
|
|
7
|
+
import Haematology from './sub-reports/haematology/haematology.component';
|
|
8
|
+
import Bacteriology from './sub-reports/bacteriology/bacteriology.component';
|
|
9
|
+
import HistologyAndCytology from './sub-reports/histology-and-cytology/histology-and-cytology.component';
|
|
10
|
+
import Serology from './sub-reports/serology/serology.component';
|
|
11
|
+
import SpecimenReferralToHigherLevels from './sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component';
|
|
12
|
+
import DrugSusceptibilityTesting from './sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component';
|
|
13
|
+
import ReportFiltersComponent from '../../common/report-filters/report-filters.component';
|
|
14
|
+
import { getMoh706 } from '../../resources/moh-706.resource';
|
|
15
|
+
import styles from './moh-706.scss';
|
|
16
|
+
import MOH706Header from './moh-706-header.component';
|
|
17
|
+
|
|
18
|
+
const MoH706Report: React.FC = () => {
|
|
19
|
+
const [moh706Data, setMoh706Data] = useState<any>({});
|
|
20
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
21
|
+
const [errorMessage, setErrorMessage] = useState<string>('');
|
|
22
|
+
const [filters, setFilters] = useState<{ locationUuids?: string; startDate?: string; endDate?: string }>({});
|
|
23
|
+
|
|
24
|
+
const session = useSession();
|
|
25
|
+
const locationUuids = session?.sessionLocation?.uuid;
|
|
26
|
+
|
|
27
|
+
const fetchMoh706Data = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
|
|
28
|
+
setErrorMessage('');
|
|
29
|
+
setIsLoading(true);
|
|
30
|
+
|
|
31
|
+
let startDate = filters.startDate;
|
|
32
|
+
let endDate = filters.endDate;
|
|
33
|
+
|
|
34
|
+
if (filters.month) {
|
|
35
|
+
const [year, monthIndex] = filters.month.split('-').map(Number);
|
|
36
|
+
const start = new Date(year, monthIndex - 1, 1);
|
|
37
|
+
const end = new Date(year, monthIndex, 0);
|
|
38
|
+
|
|
39
|
+
const formatLocalDate = (d: Date) => {
|
|
40
|
+
const y = d.getFullYear();
|
|
41
|
+
const m = String(d.getMonth() + 1).padStart(2, '0');
|
|
42
|
+
const day = String(d.getDate()).padStart(2, '0');
|
|
43
|
+
return `${y}-${m}-${day}`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
startDate = formatLocalDate(start);
|
|
47
|
+
endDate = formatLocalDate(end);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const params = {
|
|
51
|
+
locationUuids: locationUuids || '',
|
|
52
|
+
startDate,
|
|
53
|
+
endDate,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const result = await getMoh706(params);
|
|
58
|
+
const flatData = Object.assign({}, ...result);
|
|
59
|
+
setMoh706Data(flatData);
|
|
60
|
+
setFilters({ locationUuids: params.locationUuids, startDate, endDate });
|
|
61
|
+
} catch (error: any) {
|
|
62
|
+
setErrorMessage(error instanceof Error ? error.message : String(error));
|
|
63
|
+
} finally {
|
|
64
|
+
setIsLoading(false);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<ReportFiltersComponent reportName="MOH-706 Report" mode="monthly" onGenerate={fetchMoh706Data} isLoding={isLoading} />
|
|
71
|
+
{isLoading && <Loading description="Fetching data...." />}
|
|
72
|
+
{!isLoading && errorMessage && (
|
|
73
|
+
<div>
|
|
74
|
+
<a href="#" className="close" data-dismiss="alert">
|
|
75
|
+
×
|
|
76
|
+
</a>
|
|
77
|
+
<h4>
|
|
78
|
+
<strong>
|
|
79
|
+
<span className="glyphicon glyphicon-warning-sign"></span>{' '}
|
|
80
|
+
</strong>{' '}
|
|
81
|
+
An error occurred while trying to load the report. Please try again.
|
|
82
|
+
</h4>
|
|
83
|
+
<p>
|
|
84
|
+
<small>{errorMessage}</small>
|
|
85
|
+
</p>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
<MOH706Header />
|
|
89
|
+
<div className={styles.reportSections}>
|
|
90
|
+
<UrineAnalysis data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
|
|
91
|
+
<BloodChemistry data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
|
|
92
|
+
<Parasitology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
|
|
93
|
+
<Haematology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
|
|
94
|
+
<Bacteriology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
|
|
95
|
+
<HistologyAndCytology />
|
|
96
|
+
<Serology data={moh706Data} locationUuids={filters.locationUuids} startDate={filters.startDate} endDate={filters.endDate} />
|
|
97
|
+
<SpecimenReferralToHigherLevels />
|
|
98
|
+
<DrugSusceptibilityTesting />
|
|
99
|
+
</div>
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export default MoH706Report;
|