@kenyaemr/esm-morgue-app 5.3.10-pre.1696 → 5.3.10-pre.1703
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/.turbo/turbo-build.log +9 -9
- package/dist/300.js +1 -1
- package/dist/553.js +1 -1
- package/dist/553.js.map +1 -1
- package/dist/632.js +1 -1
- package/dist/632.js.map +1 -1
- package/dist/926.js +1 -1
- package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +13 -13
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/card/avail-compartment.compartment.tsx +4 -7
- package/src/config-schema.ts +3 -3
- package/src/hook/useMorgue.resource.ts +9 -4
- package/src/tables/discharge-queue.component.tsx +25 -17
- package/src/tables/waiting-queue.component.tsx +28 -15
- package/src/types/index.ts +4 -0
- package/translations/en.json +3 -3
|
@@ -16,13 +16,10 @@ interface AvailableCompartmentProps {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const AvailableCompartment: React.FC<AvailableCompartmentProps> = ({ patientInfo, index }) => {
|
|
19
|
+
const patientUuid = patientInfo?.patient?.uuid;
|
|
19
20
|
const { t } = useTranslation();
|
|
20
|
-
const { isLoading, error, person } = usePerson(patientInfo
|
|
21
|
-
const {
|
|
22
|
-
data: activeDeceased,
|
|
23
|
-
error: isActiveError,
|
|
24
|
-
isLoading: isActiveLoading,
|
|
25
|
-
} = useActiveMorgueVisit(patientInfo?.uuid);
|
|
21
|
+
const { isLoading, error, person } = usePerson(patientInfo?.person?.uuid);
|
|
22
|
+
const { data: activeDeceased, error: isActiveError, isLoading: isActiveLoading } = useActiveMorgueVisit(patientUuid);
|
|
26
23
|
|
|
27
24
|
const startVisitDate = activeDeceased?.[0]?.startDatetime;
|
|
28
25
|
|
|
@@ -72,7 +69,7 @@ const AvailableCompartment: React.FC<AvailableCompartmentProps> = ({ patientInfo
|
|
|
72
69
|
<span className={styles.viewDetails}>
|
|
73
70
|
<ConfigurableLink
|
|
74
71
|
className={styles.viewDetailsLink}
|
|
75
|
-
to={`\${openmrsSpaBase}/patient/${
|
|
72
|
+
to={`\${openmrsSpaBase}/patient/${patientUuid}/chart/deceased-panel`}>
|
|
76
73
|
<View size={20} />
|
|
77
74
|
</ConfigurableLink>
|
|
78
75
|
</span>
|
package/src/config-schema.ts
CHANGED
|
@@ -21,7 +21,7 @@ export const configSchema = {
|
|
|
21
21
|
morgueDepartmentServiceTypeUuid: {
|
|
22
22
|
_type: Type.String,
|
|
23
23
|
_description: ' UUID for morgue department service type',
|
|
24
|
-
_default: '
|
|
24
|
+
_default: '030bb7ab-9aea-454a-aa17-96abf17727c7',
|
|
25
25
|
},
|
|
26
26
|
insurancepaymentModeUuid: {
|
|
27
27
|
_type: Type.String,
|
|
@@ -71,7 +71,7 @@ export const configSchema = {
|
|
|
71
71
|
policeIDNumber: {
|
|
72
72
|
_type: Type.String,
|
|
73
73
|
_description: 'UUID for police id number concept',
|
|
74
|
-
_default: '
|
|
74
|
+
_default: '163084AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
75
75
|
},
|
|
76
76
|
encounterProviderRoleUuid: {
|
|
77
77
|
_type: Type.UUID,
|
|
@@ -81,7 +81,7 @@ export const configSchema = {
|
|
|
81
81
|
dischargeAreaUuid: {
|
|
82
82
|
_type: Type.String,
|
|
83
83
|
_description: 'UUID for discharge area concept',
|
|
84
|
-
_default: '
|
|
84
|
+
_default: '734f9526-84db-4002-9d98-58da580e501f',
|
|
85
85
|
},
|
|
86
86
|
adminUuid: {
|
|
87
87
|
_type: Type.String,
|
|
@@ -84,12 +84,17 @@ export const useDeceasedPatient = (searchTerm?: string) => {
|
|
|
84
84
|
try {
|
|
85
85
|
setIsLoadingStatus(true);
|
|
86
86
|
const status = await Promise.all(
|
|
87
|
-
paginatedData
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
paginatedData.map((data) =>
|
|
88
|
+
getMorguePatientStatus(data.person?.uuid, morgueVisitTypeUuid, morgueDischargeEncounterTypeUuid),
|
|
89
|
+
),
|
|
90
90
|
);
|
|
91
91
|
|
|
92
|
-
setDeceasedPatient(
|
|
92
|
+
setDeceasedPatient(
|
|
93
|
+
paginatedData.map((patient, index) => ({
|
|
94
|
+
...patient,
|
|
95
|
+
status: status[index],
|
|
96
|
+
})),
|
|
97
|
+
);
|
|
93
98
|
} catch (error) {
|
|
94
99
|
setStatusError(error);
|
|
95
100
|
} finally {
|
|
@@ -51,23 +51,31 @@ export const DischargedBodies: React.FC<DischargedProps> = ({ isLoading, decease
|
|
|
51
51
|
|
|
52
52
|
const dischargedDeceased = deceasedPatients?.filter((patient) => patient?.status === 'discharged') || [];
|
|
53
53
|
|
|
54
|
-
const rows = dischargedDeceased.map((patient) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
const rows = dischargedDeceased.map((patient, index) => {
|
|
55
|
+
const openMrsId =
|
|
56
|
+
patient?.patient?.identifiers
|
|
57
|
+
?.find((id) => id.display.startsWith('OpenMRS ID'))
|
|
58
|
+
?.display.split('=')[1]
|
|
59
|
+
?.trim() || '--';
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
id: `${patient?.patient?.uuid}`,
|
|
63
|
+
name: (
|
|
64
|
+
<ConfigurableLink
|
|
65
|
+
style={{ textDecoration: 'none', maxWidth: '50%' }}
|
|
66
|
+
to={patientChartUrl}
|
|
67
|
+
templateParams={{ patientUuid: patient?.person?.uuid }}>
|
|
68
|
+
{patient?.person?.person?.display?.toUpperCase()}
|
|
69
|
+
</ConfigurableLink>
|
|
70
|
+
),
|
|
71
|
+
gender: patient?.person?.person?.gender || '--',
|
|
72
|
+
age: patient?.person?.person?.age || '--',
|
|
73
|
+
identifier: openMrsId,
|
|
74
|
+
deathDate: formatDateTime(patient?.person?.person?.deathDate) || '--',
|
|
75
|
+
causeOfDeath: patient?.person?.person?.causeOfDeath?.display || '--',
|
|
76
|
+
status: <Tag type="magenta">{patient?.status || '--'}</Tag>,
|
|
77
|
+
};
|
|
78
|
+
});
|
|
71
79
|
|
|
72
80
|
return <GenericTable rows={rows} headers={genericTableHeader} title={dischargedInLine} />;
|
|
73
81
|
};
|
|
@@ -50,16 +50,24 @@ export const WaitingQueue: React.FC<WaitingQueueProps> = ({ isLoading, deceasedP
|
|
|
50
50
|
|
|
51
51
|
const awaitingPatients = deceasedPatients?.filter((patient) => patient?.status === 'awaiting') || [];
|
|
52
52
|
|
|
53
|
-
const rows = awaitingPatients.map((patient) =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
const rows = awaitingPatients.map((patient, index) => {
|
|
54
|
+
const openMrsId =
|
|
55
|
+
patient?.patient?.identifiers
|
|
56
|
+
?.find((id) => id.display.startsWith('OpenMRS ID'))
|
|
57
|
+
?.display.split('=')[1]
|
|
58
|
+
?.trim() || t('missingIdentifier', '--');
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
id: `${patient?.patient?.uuid}`,
|
|
62
|
+
name: toUpperCase(patient?.person?.person?.display || '--'),
|
|
63
|
+
gender: patient?.person?.person?.gender || '--',
|
|
64
|
+
age: patient?.person?.person?.age || '--',
|
|
65
|
+
identifier: openMrsId,
|
|
66
|
+
deathDate: formatDateTime(patient?.person?.person?.deathDate) || '--',
|
|
67
|
+
causeOfDeath: patient?.person?.person?.causeOfDeath?.display || '--',
|
|
68
|
+
status: <Tag type="magenta">{patient?.status || '--'}</Tag>,
|
|
69
|
+
};
|
|
70
|
+
});
|
|
63
71
|
|
|
64
72
|
const handleAdmissionForm = (patientUuid: string) => {
|
|
65
73
|
launchWorkspace('patient-additional-info-form', {
|
|
@@ -68,11 +76,16 @@ export const WaitingQueue: React.FC<WaitingQueueProps> = ({ isLoading, deceasedP
|
|
|
68
76
|
});
|
|
69
77
|
};
|
|
70
78
|
|
|
71
|
-
const actionColumn = (row) =>
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
const actionColumn = (row) => {
|
|
80
|
+
return (
|
|
81
|
+
<OverflowMenu size="sm" flipped>
|
|
82
|
+
<OverflowMenuItem
|
|
83
|
+
itemText={t('admitToMorgue', 'Admit to morgue')}
|
|
84
|
+
onClick={() => handleAdmissionForm(row.id)}
|
|
85
|
+
/>
|
|
86
|
+
</OverflowMenu>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
76
89
|
|
|
77
90
|
return <GenericTable rows={rows} headers={genericTableHeader} actionColumn={actionColumn} title={waitingInLine} />;
|
|
78
91
|
};
|
package/src/types/index.ts
CHANGED
package/translations/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"admissionForm": "Admission form",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"admitted": "Admitted",
|
|
4
|
+
"admitToMorgue": "Admit to morgue",
|
|
5
5
|
"allocation": "Allocation",
|
|
6
6
|
"allocations": "Allocation",
|
|
7
7
|
"causeOfDeath": "Cause of death: ",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"discharged": "Discharged",
|
|
10
10
|
"empty": "Empty",
|
|
11
11
|
"errorMessage": "Error",
|
|
12
|
+
"missingIdentifier": "--",
|
|
12
13
|
"mortuary": "Mortuary",
|
|
13
14
|
"mortuaryManagement": "Mortuary management",
|
|
14
15
|
"noAdmittedBodies": "There are no admitted bodies",
|
|
15
16
|
"noDeceasedPersons": "There are no deceased persons on the waiting list",
|
|
16
17
|
"noResultFound": "Sorry, no results found",
|
|
17
18
|
"noWaitingList": "Waiting List",
|
|
18
|
-
"nullDate": "--",
|
|
19
19
|
"pullingCompartment": "Pulling compartments data.....",
|
|
20
20
|
"searchForADeceased": "Try to search again using the deceased patient's unique ID number",
|
|
21
21
|
"waitingInLine": "Waiting In Line",
|