@ampath/esm-reports-app 1.0.0-next.57 → 1.0.0-next.59
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/{998.css.map → 255.css.map} +1 -1
- package/dist/255.js +1 -0
- package/dist/255.js.map +1 -0
- package/dist/410.js +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +2 -0
- package/src/reports/moh-745/moh-745.component.tsx +153 -123
- package/src/reports/moh-745/registers/moh-412-register.component.tsx +63 -54
- package/src/resources/moh-745.resource.ts +18 -0
- package/dist/998.js +0 -1
- package/dist/998.js.map +0 -1
- /package/dist/{998.css → 255.css} +0 -0
|
@@ -1,61 +1,52 @@
|
|
|
1
|
-
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from '../../../common/report-register/register-table.scss';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useSearchParams } from 'react-router-dom';
|
|
7
7
|
import { moh412Columns } from './type';
|
|
8
|
-
import { getMoh412PatientList } from '../../../resources/moh-745.resource';
|
|
8
|
+
import { fetchMoh745PatientList, getMoh412PatientList } from '../../../resources/moh-745.resource';
|
|
9
9
|
import { moh412ExportColumns } from './moh-412.columns';
|
|
10
10
|
import { RegisterLayout, usePatientList } from '../../../common/report-register';
|
|
11
11
|
|
|
12
12
|
const Moh412Register: React.FC = () => {
|
|
13
13
|
const [searchParams] = useSearchParams();
|
|
14
|
+
const startDate = searchParams.get('startDate') ?? '';
|
|
15
|
+
const endDate = searchParams.get('endDate') ?? '';
|
|
16
|
+
const locationUuids = searchParams.get('locationUuids') ?? '';
|
|
17
|
+
const indicators = searchParams.get('indicators') ?? '';
|
|
18
|
+
const [patientList,setPatientList] = useState<any>([]);
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
useEffect(()=>{
|
|
21
|
+
if(startDate && endDate && locationUuids && indicators){
|
|
22
|
+
fetchPatientList();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
},[startDate, endDate, locationUuids, indicators]);
|
|
19
26
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
total,
|
|
23
|
-
isTotalExact,
|
|
24
|
-
isLoading,
|
|
25
|
-
page,
|
|
26
|
-
pageSize,
|
|
27
|
-
onPageChange,
|
|
28
|
-
fetchAll,
|
|
29
|
-
} = usePatientList(
|
|
30
|
-
({ startIndex, limit }) =>
|
|
31
|
-
getMoh412PatientList({
|
|
27
|
+
async function fetchPatientList(){
|
|
28
|
+
const resp = await fetchMoh745PatientList({
|
|
32
29
|
startDate,
|
|
33
30
|
endDate,
|
|
34
31
|
locationUuids,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
indicators,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if(resp){
|
|
36
|
+
setPatientList(resp);
|
|
37
|
+
}else{
|
|
38
|
+
setPatientList([]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
|
|
44
|
-
parentLabel="MOH-745 Report"
|
|
45
|
-
parentPath="/moh-745"
|
|
46
|
-
title="MOH 412 Cancer Screening Register"
|
|
47
|
-
isLoading={isLoading}
|
|
48
|
-
isEmpty={patientlist.length === 0}
|
|
49
|
-
page={page}
|
|
50
|
-
pageSize={pageSize}
|
|
51
|
-
total={total}
|
|
52
|
-
isTotalExact={isTotalExact}
|
|
53
|
-
onPageChange={onPageChange}
|
|
54
|
-
fetchAll={fetchAll}
|
|
55
|
-
columns={moh412ExportColumns}
|
|
56
|
-
>
|
|
43
|
+
|
|
57
44
|
<div className={styles.tableContainer}>
|
|
58
|
-
<
|
|
45
|
+
<div>
|
|
46
|
+
<h4>MOH-412 Register</h4>
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<Table className={classNames(`${styles.table}`, `${styles.tableBordered}`, `${styles.tableStriped}`)}>
|
|
59
50
|
<TableHead>
|
|
60
51
|
<TableRow>
|
|
61
52
|
<TableHeader colSpan={3}>Month:</TableHeader>
|
|
@@ -168,23 +159,41 @@ const Moh412Register: React.FC = () => {
|
|
|
168
159
|
</TableRow>
|
|
169
160
|
</TableHead>
|
|
170
161
|
<TableBody>
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
162
|
+
{
|
|
163
|
+
patientList.map((p: any,index: number)=>{
|
|
164
|
+
return <><TableRow>
|
|
165
|
+
<TableCell>{index + 1}</TableCell>
|
|
166
|
+
<TableCell>{p.screening_date ?? ''}</TableCell>
|
|
167
|
+
<TableCell>{p?.screening_visit_type ?? ''}</TableCell>
|
|
168
|
+
<TableCell>{p?.ccc_number ?? ''}</TableCell>
|
|
169
|
+
<TableCell>{p.person_name}</TableCell>
|
|
170
|
+
<TableCell></TableCell>
|
|
171
|
+
<TableCell>{p?.age ?? ''}</TableCell>
|
|
172
|
+
<TableCell></TableCell>
|
|
173
|
+
<TableCell></TableCell>
|
|
174
|
+
<TableCell>{p?.via_or_via_vili_test_result ?? ''}</TableCell>
|
|
175
|
+
<TableCell>{p?.pap_smear_test_result ?? ''}</TableCell>
|
|
176
|
+
<TableCell>{p?.hpv_test_result ?? ''}</TableCell>
|
|
177
|
+
<TableCell></TableCell>
|
|
178
|
+
<TableCell></TableCell>
|
|
179
|
+
<TableCell></TableCell>
|
|
180
|
+
<TableCell></TableCell>
|
|
181
|
+
<TableCell></TableCell>
|
|
182
|
+
<TableCell></TableCell>
|
|
183
|
+
<TableCell></TableCell>
|
|
184
|
+
<TableCell></TableCell>
|
|
185
|
+
<TableCell>{p?.hiv_status ?? ''}</TableCell>
|
|
186
|
+
<TableCell></TableCell>
|
|
187
|
+
<TableCell></TableCell>
|
|
188
|
+
<TableCell></TableCell>
|
|
189
|
+
</TableRow></>
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
|
|
184
193
|
</TableBody>
|
|
185
194
|
</Table>
|
|
195
|
+
</div>
|
|
186
196
|
</div>
|
|
187
|
-
</RegisterLayout>
|
|
188
197
|
);
|
|
189
198
|
};
|
|
190
199
|
export default Moh412Register;
|
|
@@ -56,3 +56,21 @@ export async function getMoh412PatientList(params: PatientListParams): Promise<P
|
|
|
56
56
|
throw new Error(`An error occurred while fetching the MOH-705 patient list: ${error.message}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
export async function fetchMoh745PatientList(params: PatientListParams): Promise<any[]> {
|
|
61
|
+
const url = await buildEtlUrl('moh-412-patient-list', {
|
|
62
|
+
locationUuids: params.locationUuids || '',
|
|
63
|
+
startDate: params.startDate || '',
|
|
64
|
+
endDate: params.endDate || '',
|
|
65
|
+
indicators: Array.isArray(params.indicators) ? params.indicators.join(',') : params.indicators || '',
|
|
66
|
+
limit:1000
|
|
67
|
+
});
|
|
68
|
+
try {
|
|
69
|
+
const response = await openmrsFetch(url);
|
|
70
|
+
const data = await response.json();
|
|
71
|
+
return data?.result ?? [];
|
|
72
|
+
} catch (error: any) {
|
|
73
|
+
console.error('Failed to fetch MOH 412 PATIENT LIST data', error);
|
|
74
|
+
throw new Error(`An error occurred while fetching the MOH-705 patient list: ${error.message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|