@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
|
@@ -15,12 +15,17 @@ export async function fetchMoh740Report(params: Moh740Dto): Promise<Moh740Data |
|
|
|
15
15
|
const etlBaseUrl = await getEtlBaseUrl();
|
|
16
16
|
const moh740Url = `${etlBaseUrl}/${baseMoh740Url}?endDate=${params.endDate}&locationUuids=${params.locationUuid}`;
|
|
17
17
|
const resp = await openmrsFetch(moh740Url);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
|
|
19
|
+
/* Without this a 404 or a 500 falls through to `null`, which the report then
|
|
20
|
+
renders as "no report generated yet" -- indistinguishable from never
|
|
21
|
+
having pressed Generate. Throwing lets the failure reach the snackbar. */
|
|
22
|
+
if (!resp.ok) {
|
|
23
|
+
throw new Error(`Failed to fetch the MOH-740 report: ${resp.status} ${resp.statusText}`);
|
|
23
24
|
}
|
|
25
|
+
|
|
26
|
+
const data: Moh740Resp = await resp.json();
|
|
27
|
+
|
|
28
|
+
return data?.result?.[0] ?? null;
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export async function fetchMoh740Register(params: Moh740RegisterDto): Promise<Moh270Patient[]> {
|
|
@@ -33,10 +38,12 @@ export async function fetchMoh740Register(params: Moh740RegisterDto): Promise<Mo
|
|
|
33
38
|
const queryString = new URLSearchParams(p).toString();
|
|
34
39
|
const moh740RegisterUrl = `${etlBaseUrl}/${baseMoh740Url}/patient-list`;
|
|
35
40
|
const resp = await openmrsFetch(`${moh740RegisterUrl}?${queryString}`);
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
} else {
|
|
40
|
-
return [];
|
|
41
|
+
|
|
42
|
+
if (!resp.ok) {
|
|
43
|
+
throw new Error(`Failed to fetch the MOH-740 register: ${resp.status} ${resp.statusText}`);
|
|
41
44
|
}
|
|
45
|
+
|
|
46
|
+
const data: Moh740RegisterResp = await resp.json();
|
|
47
|
+
|
|
48
|
+
return data?.result ?? [];
|
|
42
49
|
}
|
|
@@ -1,104 +1,85 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import styles from './moh-222-daily-register.scss';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { type Moh222Patient } from '../../types';
|
|
4
|
-
import
|
|
3
|
+
import styles from '../../../../common/report-register/register-table.scss';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
5
|
import { Link, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
6
6
|
interface Moh222DailyRegisterProps {
|
|
7
7
|
moh222PatientList: Moh222Patient[];
|
|
8
|
-
indicator: string;
|
|
9
8
|
}
|
|
10
|
-
const Moh222DailyRegister: React.FC<Moh222DailyRegisterProps> = ({ moh222PatientList
|
|
11
|
-
const pageTitle = useMemo(() => formatIndicatorName(indicator ?? ''), [indicator]);
|
|
12
|
-
const reportTitle = 'Daily Activity Register - MOH 222';
|
|
13
|
-
if (!moh222PatientList) {
|
|
14
|
-
return <>No Data to display</>;
|
|
15
|
-
}
|
|
9
|
+
const Moh222DailyRegister: React.FC<Moh222DailyRegisterProps> = ({ moh222PatientList }) => {
|
|
16
10
|
return (
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<TableCell>{p.screened_for_tb}</TableCell>
|
|
91
|
-
<TableCell>{p.tbs_status}</TableCell>
|
|
92
|
-
<TableCell>{p.covered_by_shif ? 'Y' : 'N'}</TableCell>
|
|
93
|
-
</TableRow>
|
|
94
|
-
))}
|
|
95
|
-
</TableBody>
|
|
96
|
-
</Table>
|
|
97
|
-
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
</>)
|
|
11
|
+
<div className={styles.tableContainer}>
|
|
12
|
+
<Table className={classNames(styles.table, styles.tableBordered, styles.tableStriped)}>
|
|
13
|
+
<TableHead>
|
|
14
|
+
<TableRow>
|
|
15
|
+
<TableHeader>No</TableHeader>
|
|
16
|
+
<TableHeader>Date</TableHeader>
|
|
17
|
+
<TableHeader>Patient No</TableHeader>
|
|
18
|
+
<TableHeader>Patient Name</TableHeader>
|
|
19
|
+
<TableHeader>Age</TableHeader>
|
|
20
|
+
<TableHeader>D.O.B</TableHeader>
|
|
21
|
+
<TableHeader>Sex(M/F)</TableHeader>
|
|
22
|
+
<TableHeader>Visit for the month</TableHeader>
|
|
23
|
+
<TableHeader>Weight(Kg)</TableHeader>
|
|
24
|
+
<TableHeader>Height(cm)</TableHeader>
|
|
25
|
+
<TableHeader>BMI</TableHeader>
|
|
26
|
+
<TableHeader>Waist Circumference</TableHeader>
|
|
27
|
+
<TableHeader>BP(mmHg)</TableHeader>
|
|
28
|
+
<TableHeader>HTN</TableHeader>
|
|
29
|
+
<TableHeader>Diabetes</TableHeader>
|
|
30
|
+
<TableHeader>Both Diabetes and Hypetention(HTN)</TableHeader>
|
|
31
|
+
<TableHeader>RBS(mmol/L)</TableHeader>
|
|
32
|
+
<TableHeader>FBS(mmol/L)</TableHeader>
|
|
33
|
+
<TableHeader>HbA1C(%) within 3 months</TableHeader>
|
|
34
|
+
<TableHeader>Complications/Co-morbidities at enrollment(2)</TableHeader>
|
|
35
|
+
<TableHeader>Treatment</TableHeader>
|
|
36
|
+
<TableHeader>Diabetic Foot Screening</TableHeader>
|
|
37
|
+
<TableHeader>Diabetic Foot(New,Known,Nill)</TableHeader>
|
|
38
|
+
<TableHeader>Foot Risk Assessment</TableHeader>
|
|
39
|
+
<TableHeader>Footcare Outcome</TableHeader>
|
|
40
|
+
<TableHeader>Screened for TB</TableHeader>
|
|
41
|
+
<TableHeader>TB Status after Screening</TableHeader>
|
|
42
|
+
<TableHeader>Active NHIF(Y/N)</TableHeader>
|
|
43
|
+
</TableRow>
|
|
44
|
+
</TableHead>
|
|
45
|
+
<TableBody>
|
|
46
|
+
{moh222PatientList.map((p, index) => (
|
|
47
|
+
<TableRow key={p.patient_uuid}>
|
|
48
|
+
<TableCell>{index + 1}</TableCell>
|
|
49
|
+
<TableCell>{p.encounter_date}</TableCell>
|
|
50
|
+
<TableCell>{p.amrs_universal_id}</TableCell>
|
|
51
|
+
<TableCell>
|
|
52
|
+
<Link href={`${window.spaBase}/patient/${p.patient_uuid}/chart/`}>{p.person_name}</Link>
|
|
53
|
+
</TableCell>
|
|
54
|
+
<TableCell>{p.age}</TableCell>
|
|
55
|
+
<TableCell>{p.birthdate}</TableCell>
|
|
56
|
+
<TableCell>{p.gender}</TableCell>
|
|
57
|
+
<TableCell>{p.visit_for_the_month}</TableCell>
|
|
58
|
+
<TableCell>{p.weight}</TableCell>
|
|
59
|
+
<TableCell>{p.height}</TableCell>
|
|
60
|
+
<TableCell>{p.bmi}</TableCell>
|
|
61
|
+
<TableCell>{p.waist_circumference}</TableCell>
|
|
62
|
+
<TableCell>{p.bp}</TableCell>
|
|
63
|
+
<TableCell>{p.htn}</TableCell>
|
|
64
|
+
<TableCell>{p.diabetes}</TableCell>
|
|
65
|
+
<TableCell>{p.both_htn_and_diabetic}</TableCell>
|
|
66
|
+
<TableCell>{p.rbs}</TableCell>
|
|
67
|
+
<TableCell>{p.fbs}</TableCell>
|
|
68
|
+
<TableCell>{p.hba1c}</TableCell>
|
|
69
|
+
<TableCell>{p.complications_at_enrollment}</TableCell>
|
|
70
|
+
<TableCell>{p.treatment}</TableCell>
|
|
71
|
+
<TableCell>{p.diabetic_foot_screening}</TableCell>
|
|
72
|
+
<TableCell>{p.diabetic_foot}</TableCell>
|
|
73
|
+
<TableCell>{p.foot_risk_assessment}</TableCell>
|
|
74
|
+
<TableCell>{p.footcare_outcome}</TableCell>
|
|
75
|
+
<TableCell>{p.screened_for_tb}</TableCell>
|
|
76
|
+
<TableCell>{p.tbs_status}</TableCell>
|
|
77
|
+
<TableCell>{p.covered_by_shif ? 'Y' : 'N'}</TableCell>
|
|
78
|
+
</TableRow>
|
|
79
|
+
))}
|
|
80
|
+
</TableBody>
|
|
81
|
+
</Table>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
103
84
|
};
|
|
104
85
|
export default Moh222DailyRegister;
|
package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx
CHANGED
|
@@ -1,79 +1,59 @@
|
|
|
1
1
|
import { Link, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { type Moh270Patient } from '../../types';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import styles from '../../../../common/report-register/register-table.scss';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
6
|
interface Moh270DailyRegisterProps {
|
|
7
7
|
moh270PatientList: Moh270Patient[];
|
|
8
|
-
indicator: string;
|
|
9
8
|
}
|
|
10
|
-
const Moh270DailyRegister: React.FC<Moh270DailyRegisterProps> = ({ moh270PatientList
|
|
11
|
-
const pageTitle = useMemo(() => formatIndicatorName(indicator ?? ''), [indicator]);
|
|
12
|
-
const reportTitle = 'Permanent Register - MOH 270';
|
|
13
|
-
if (!moh270PatientList) {
|
|
14
|
-
return <>No Data to display</>;
|
|
15
|
-
}
|
|
9
|
+
const Moh270DailyRegister: React.FC<Moh270DailyRegisterProps> = ({ moh270PatientList }) => {
|
|
16
10
|
return (
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<TableCell>{p.diagnosis_at_enrolment ?? ''}</TableCell>
|
|
64
|
-
<TableCell>{p.diagnosis_year ?? ''}</TableCell>
|
|
65
|
-
<TableCell>{p.complications_at_enrollment ?? ''}</TableCell>
|
|
66
|
-
<TableCell>{p.covered_by_shif ? 'Y' : 'N'}</TableCell>
|
|
67
|
-
</TableRow>
|
|
68
|
-
))}
|
|
69
|
-
</TableBody>
|
|
70
|
-
</Table>
|
|
71
|
-
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
</>
|
|
11
|
+
<div className={styles.tableContainer}>
|
|
12
|
+
<Table className={classNames(styles.table, styles.tableBordered, styles.tableStriped)}>
|
|
13
|
+
<TableHead>
|
|
14
|
+
<TableRow>
|
|
15
|
+
<TableHeader>No</TableHeader>
|
|
16
|
+
<TableHeader>Date</TableHeader>
|
|
17
|
+
<TableHeader>Patient No</TableHeader>
|
|
18
|
+
<TableHeader>Name</TableHeader>
|
|
19
|
+
<TableHeader>D.O.B</TableHeader>
|
|
20
|
+
<TableHeader>Sex(M/F)</TableHeader>
|
|
21
|
+
<TableHeader>Telephone No</TableHeader>
|
|
22
|
+
<TableHeader>Sub County</TableHeader>
|
|
23
|
+
<TableHeader>Village/Estate</TableHeader>
|
|
24
|
+
<TableHeader>Landmark</TableHeader>
|
|
25
|
+
<TableHeader>Treatment supporter</TableHeader>
|
|
26
|
+
<TableHeader>Diagnosis at enrolment</TableHeader>
|
|
27
|
+
<TableHeader>Year of diagnosis</TableHeader>
|
|
28
|
+
<TableHeader>Complications/Co-morbidities at enrollment(2)</TableHeader>
|
|
29
|
+
<TableHeader>NHIF(Y/N)</TableHeader>
|
|
30
|
+
</TableRow>
|
|
31
|
+
</TableHead>
|
|
32
|
+
<TableBody>
|
|
33
|
+
{moh270PatientList.map((p, index) => (
|
|
34
|
+
<TableRow key={p.patient_uuid}>
|
|
35
|
+
<TableCell>{index + 1}</TableCell>
|
|
36
|
+
<TableCell>{p.encounter_date}</TableCell>
|
|
37
|
+
<TableCell>{p.amrs_universal_id}</TableCell>
|
|
38
|
+
<TableCell>
|
|
39
|
+
<Link href={`${window.spaBase}/patient/${p.patient_uuid}/chart/`}>{p.person_name}</Link>
|
|
40
|
+
</TableCell>
|
|
41
|
+
<TableCell>{p.birthdate}</TableCell>
|
|
42
|
+
<TableCell>{p.gender}</TableCell>
|
|
43
|
+
<TableCell>{p.phone_number}</TableCell>
|
|
44
|
+
<TableCell>{p.sub_county}</TableCell>
|
|
45
|
+
<TableCell>{p.ward}</TableCell>
|
|
46
|
+
<TableCell>{p.landmark}</TableCell>
|
|
47
|
+
<TableCell>{p.contact_of_the_treatment_supporter_and_relationship ?? ''}</TableCell>
|
|
48
|
+
<TableCell>{p.diagnosis_at_enrolment ?? ''}</TableCell>
|
|
49
|
+
<TableCell>{p.diagnosis_year ?? ''}</TableCell>
|
|
50
|
+
<TableCell>{p.complications_at_enrollment ?? ''}</TableCell>
|
|
51
|
+
<TableCell>{p.covered_by_shif ? 'Y' : 'N'}</TableCell>
|
|
52
|
+
</TableRow>
|
|
53
|
+
))}
|
|
54
|
+
</TableBody>
|
|
55
|
+
</Table>
|
|
56
|
+
</div>
|
|
77
57
|
);
|
|
78
58
|
};
|
|
79
59
|
export default Moh270DailyRegister;
|
|
@@ -2,65 +2,94 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { type Moh222Patient, type Moh270Patient } from '../types';
|
|
3
3
|
import { fetchMoh740Register } from '../moh-740.resource';
|
|
4
4
|
import Moh270DailyRegister from './moh-270-permanent-register/moh-270-permanent-register';
|
|
5
|
-
import { InlineLoading } from '@carbon/react';
|
|
6
5
|
import { Moh740Rgisters } from '../shared/utils/indicator-register-map';
|
|
7
6
|
import Moh222DailyRegister from './moh-222-daily-register/moh-222-daily-register';
|
|
7
|
+
import { MOH_222_COLUMNS, MOH_270_COLUMNS } from './moh-740.columns';
|
|
8
|
+
import { RegisterLayout } from '../../../common/report-register';
|
|
9
|
+
import { showReportError } from '../../../common/report-error';
|
|
10
|
+
|
|
8
11
|
interface Moh740PatientListProps {
|
|
9
12
|
locationUuid: string;
|
|
10
13
|
reportingMonth: string;
|
|
11
14
|
indicators: string;
|
|
12
15
|
register: string;
|
|
16
|
+
/** Puts the report back; these registers are a view on its own route */
|
|
17
|
+
onBack: () => void;
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
|
|
20
|
+
const Moh740PatientList: React.FC<Moh740PatientListProps> = ({
|
|
21
|
+
locationUuid,
|
|
22
|
+
reportingMonth,
|
|
23
|
+
indicators,
|
|
24
|
+
register,
|
|
25
|
+
onBack,
|
|
26
|
+
}) => {
|
|
15
27
|
const [moh270patientList, setMoh270PatientList] = useState<Moh270Patient[]>([]);
|
|
16
28
|
const [loading, setIsLoading] = useState<boolean>(false);
|
|
17
29
|
const [moh222PatientList, setMoh222PatientList] = useState<Moh222Patient[]>([]);
|
|
18
30
|
|
|
31
|
+
const isDaily = register === Moh740Rgisters.DailyRegister;
|
|
32
|
+
|
|
19
33
|
useEffect(() => {
|
|
20
34
|
if (locationUuid && reportingMonth && indicators) {
|
|
21
35
|
fethPatientList();
|
|
22
36
|
}
|
|
23
|
-
}, [locationUuid, reportingMonth, indicators,register]);
|
|
37
|
+
}, [locationUuid, reportingMonth, indicators, register]);
|
|
38
|
+
|
|
24
39
|
async function fethPatientList() {
|
|
25
40
|
setIsLoading(true);
|
|
26
|
-
const resp = await fetchMoh740Register({
|
|
27
|
-
locationUuid: locationUuid,
|
|
28
|
-
endDate: reportingMonth,
|
|
29
|
-
indicators: indicators,
|
|
30
|
-
});
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
try {
|
|
43
|
+
const resp = await fetchMoh740Register({
|
|
44
|
+
locationUuid: locationUuid,
|
|
45
|
+
endDate: reportingMonth,
|
|
46
|
+
indicators: indicators,
|
|
47
|
+
});
|
|
33
48
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
if (resp) {
|
|
50
|
+
if (register === Moh740Rgisters.DailyRegister) {
|
|
51
|
+
setMoh222PatientList(resp as any);
|
|
52
|
+
setMoh270PatientList([]);
|
|
53
|
+
}
|
|
54
|
+
if (register === Moh740Rgisters.PermanentRegister) {
|
|
55
|
+
setMoh270PatientList(resp);
|
|
56
|
+
setMoh222PatientList([]);
|
|
57
|
+
}
|
|
42
58
|
}
|
|
43
|
-
|
|
59
|
+
} catch (error) {
|
|
60
|
+
/* Without this a failed fetch left an empty list, which reads on screen
|
|
61
|
+
as "no clients matched" rather than as a request that did not land. */
|
|
62
|
+
setMoh222PatientList([]);
|
|
63
|
+
setMoh270PatientList([]);
|
|
64
|
+
showReportError('the register', error);
|
|
65
|
+
} finally {
|
|
66
|
+
setIsLoading(false);
|
|
44
67
|
}
|
|
45
68
|
}
|
|
69
|
+
|
|
46
70
|
if (!locationUuid || !reportingMonth || !indicators) {
|
|
47
71
|
return <></>;
|
|
48
72
|
}
|
|
49
|
-
if (loading) {
|
|
50
|
-
return <InlineLoading description="Fetching patient list..." />;
|
|
51
|
-
}
|
|
52
|
-
return <>
|
|
53
73
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
const rows: Array<Record<string, any>> = isDaily ? moh222PatientList : moh270patientList;
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<RegisterLayout
|
|
78
|
+
parentLabel="MOH-740 Report"
|
|
79
|
+
onBack={onBack}
|
|
80
|
+
title={isDaily ? 'Daily Activity Register - MOH 222' : 'Permanent Register - MOH 270'}
|
|
81
|
+
isLoading={loading}
|
|
82
|
+
isEmpty={rows.length === 0}
|
|
83
|
+
columns={isDaily ? MOH_222_COLUMNS : MOH_270_COLUMNS}
|
|
84
|
+
fetchAll={async () => rows}
|
|
85
|
+
>
|
|
86
|
+
{isDaily ? (
|
|
87
|
+
<Moh222DailyRegister moh222PatientList={moh222PatientList} />
|
|
88
|
+
) : (
|
|
89
|
+
<Moh270DailyRegister moh270PatientList={moh270patientList} />
|
|
90
|
+
)}
|
|
91
|
+
</RegisterLayout>
|
|
92
|
+
);
|
|
64
93
|
};
|
|
65
94
|
|
|
66
95
|
export default Moh740PatientList;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type RegisterColumn } from '../../../common/report-register';
|
|
2
|
+
|
|
3
|
+
/** MOH 222, in the order the register prints its columns */
|
|
4
|
+
export const MOH_222_COLUMNS: RegisterColumn[] = [
|
|
5
|
+
{ header: 'No', value: (_row, index) => index + 1 },
|
|
6
|
+
{ header: 'Date', value: (r) => r.encounter_date ?? '' },
|
|
7
|
+
{ header: 'Patient No', value: (r) => r.amrs_universal_id ?? '' },
|
|
8
|
+
{ header: 'Patient Name', value: (r) => r.person_name ?? '' },
|
|
9
|
+
{ header: 'Age', value: (r) => r.age ?? '' },
|
|
10
|
+
{ header: 'D.O.B', value: (r) => r.birthdate ?? '' },
|
|
11
|
+
{ header: 'Sex(M/F)', value: (r) => r.gender ?? '' },
|
|
12
|
+
{ header: 'Visit for the month', value: (r) => r.visit_for_the_month ?? '' },
|
|
13
|
+
{ header: 'Weight(Kg)', value: (r) => r.weight ?? '' },
|
|
14
|
+
{ header: 'Height(cm)', value: (r) => r.height ?? '' },
|
|
15
|
+
{ header: 'BMI', value: (r) => r.bmi ?? '' },
|
|
16
|
+
{ header: 'Waist Circumference', value: (r) => r.waist_circumference ?? '' },
|
|
17
|
+
{ header: 'BP(mmHg)', value: (r) => r.bp ?? '' },
|
|
18
|
+
{ header: 'HTN', value: (r) => r.htn ?? '' },
|
|
19
|
+
{ header: 'Diabetes', value: (r) => r.diabetes ?? '' },
|
|
20
|
+
{ header: 'Both Diabetes and Hypetention(HTN)', value: (r) => r.both_htn_and_diabetic ?? '' },
|
|
21
|
+
{ header: 'RBS(mmol/L)', value: (r) => r.rbs ?? '' },
|
|
22
|
+
{ header: 'FBS(mmol/L)', value: (r) => r.fbs ?? '' },
|
|
23
|
+
{ header: 'HbA1C(%) within 3 months', value: (r) => r.hba1c ?? '' },
|
|
24
|
+
{ header: 'Complications/Co-morbidities at enrollment(2)', value: (r) => r.complications_at_enrollment ?? '' },
|
|
25
|
+
{ header: 'Treatment', value: (r) => r.treatment ?? '' },
|
|
26
|
+
{ header: 'Diabetic Foot Screening', value: (r) => r.diabetic_foot_screening ?? '' },
|
|
27
|
+
{ header: 'Diabetic Foot(New,Known,Nill)', value: (r) => r.diabetic_foot ?? '' },
|
|
28
|
+
{ header: 'Foot Risk Assessment', value: (r) => r.foot_risk_assessment ?? '' },
|
|
29
|
+
{ header: 'Footcare Outcome', value: (r) => r.footcare_outcome ?? '' },
|
|
30
|
+
{ header: 'Screened for TB', value: (r) => r.screened_for_tb ?? '' },
|
|
31
|
+
{ header: 'TB Status after Screening', value: (r) => r.tbs_status ?? '' },
|
|
32
|
+
{ header: 'Active NHIF(Y/N)', value: (r) => (r.covered_by_shif ? 'Y' : 'N') },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/** MOH 270, in the order the register prints its columns */
|
|
36
|
+
export const MOH_270_COLUMNS: RegisterColumn[] = [
|
|
37
|
+
{ header: 'No', value: (_row, index) => index + 1 },
|
|
38
|
+
{ header: 'Date', value: (r) => r.encounter_date ?? '' },
|
|
39
|
+
{ header: 'Patient No', value: (r) => r.amrs_universal_id ?? '' },
|
|
40
|
+
{ header: 'Name', value: (r) => r.person_name ?? '' },
|
|
41
|
+
{ header: 'D.O.B', value: (r) => r.birthdate ?? '' },
|
|
42
|
+
{ header: 'Sex(M/F)', value: (r) => r.gender ?? '' },
|
|
43
|
+
{ header: 'Telephone No', value: (r) => r.phone_number ?? '' },
|
|
44
|
+
{ header: 'Sub County', value: (r) => r.sub_county ?? '' },
|
|
45
|
+
{ header: 'Village/Estate', value: (r) => r.ward ?? '' },
|
|
46
|
+
{ header: 'Landmark', value: (r) => r.landmark ?? '' },
|
|
47
|
+
{ header: 'Treatment supporter', value: (r) => r.contact_of_the_treatment_supporter_and_relationship ?? '' },
|
|
48
|
+
{ header: 'Diagnosis at enrolment', value: (r) => r.diagnosis_at_enrolment ?? '' },
|
|
49
|
+
{ header: 'Year of diagnosis', value: (r) => r.diagnosis_year ?? '' },
|
|
50
|
+
{ header: 'Complications/Co-morbidities at enrollment(2)', value: (r) => r.complications_at_enrollment ?? '' },
|
|
51
|
+
{ header: 'NHIF(Y/N)', value: (r) => (r.covered_by_shif ? 'Y' : 'N') },
|
|
52
|
+
];
|
|
@@ -14,7 +14,7 @@ const Moh740DIncatorRegisterMap: Record <RegisterKeys, string> = {
|
|
|
14
14
|
sub_county: '',
|
|
15
15
|
reportingMonth: '',
|
|
16
16
|
cumulative_diabetes_patients_in_care: Moh740Rgisters.PermanentRegister,
|
|
17
|
-
|
|
17
|
+
newly_diagnosed_diabetes_this_month: Moh740Rgisters.DailyRegister,
|
|
18
18
|
total_type_1_diabetes: Moh740Rgisters.DailyRegister,
|
|
19
19
|
total_type_2_diabetes: Moh740Rgisters.DailyRegister,
|
|
20
20
|
cumulative_htn_patient: Moh740Rgisters.PermanentRegister,
|
|
@@ -50,8 +50,8 @@ const Moh740DIncatorRegisterMap: Record <RegisterKeys, string> = {
|
|
|
50
50
|
dc__age_range__61_and_above__type_2_diabetes_mellitus:Moh740Rgisters.DailyRegister,
|
|
51
51
|
dc__gender__M__cumulative_diabetes_patients_in_care: Moh740Rgisters.PermanentRegister,
|
|
52
52
|
dc__gender__F__cumulative_diabetes_patients_in_care: Moh740Rgisters.PermanentRegister,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
dc__gender__M__newly_diagnosed_diabetes_this_month: Moh740Rgisters.DailyRegister,
|
|
54
|
+
dc__gender__F__newly_diagnosed_diabetes_this_month: Moh740Rgisters.DailyRegister,
|
|
55
55
|
dc__gender__M__revisit_to_clinic_known_dm: Moh740Rgisters.DailyRegister,
|
|
56
56
|
dc__gender__F__revisit_to_clinic_known_dm: Moh740Rgisters.DailyRegister,
|
|
57
57
|
dc__gender__M__total_type_1_diabetes: Moh740Rgisters.DailyRegister,
|
|
@@ -13,7 +13,7 @@ export type Moh740Data = {
|
|
|
13
13
|
sub_county: string;
|
|
14
14
|
reportingMonth: string;
|
|
15
15
|
cumulative_diabetes_patients_in_care: number;
|
|
16
|
-
|
|
16
|
+
newly_diagnosed_diabetes_this_month: number;
|
|
17
17
|
total_type_1_diabetes: number;
|
|
18
18
|
total_type_2_diabetes: number;
|
|
19
19
|
cumulative_htn_patient: number;
|
|
@@ -49,8 +49,8 @@ export type Moh740Data = {
|
|
|
49
49
|
dc__age_range__61_and_above__type_2_diabetes_mellitus:number;
|
|
50
50
|
dc__gender__M__cumulative_diabetes_patients_in_care: number;
|
|
51
51
|
dc__gender__F__cumulative_diabetes_patients_in_care: number;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
dc__gender__M__newly_diagnosed_diabetes_this_month: number;
|
|
53
|
+
dc__gender__F__newly_diagnosed_diabetes_this_month: number;
|
|
54
54
|
dc__gender__M__revisit_to_clinic_known_dm: number;
|
|
55
55
|
dc__gender__F__revisit_to_clinic_known_dm: number;
|
|
56
56
|
dc__gender__M__total_type_1_diabetes: number;
|