@kenyaemr/esm-morgue-app 5.4.4-pre.98 → 5.4.5-pre.16
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/package.json +3 -3
- package/src/bed/components/deceased-patient-status-footer.component.tsx +1 -1
- package/src/bed-linelist-view/awaiting/awaiting-bed-linelist-view.component.tsx +1 -0
- package/src/config-schema.ts +8 -2
- package/src/dashboard.meta.ts +1 -1
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.scss +19 -0
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.workspace.tsx +21 -28
- package/src/forms/discharge-deceased-person-workspace/discharge-body.scss +20 -0
- package/src/forms/discharge-deceased-person-workspace/discharge-body.workspace.tsx +22 -27
- package/src/forms/swap-compartment-workspace/swap-unit.scss +20 -0
- package/src/forms/swap-compartment-workspace/swap-unit.workspace.tsx +10 -15
- package/src/index.ts +2 -2
- package/src/left-panel/morgue-left-panel-link.component.tsx +3 -1
- package/src/mark-patient-deceased-extension/overflow-menu-item/mark-patient-deceased-overflow.extension.tsx +10 -2
- package/src/modals/mortuary-gate-pass/print-preview-confirmation.modal.tsx +10 -22
- package/src/routes.json +5 -1
- package/translations/am.json +163 -0
- package/translations/en.json +163 -0
- package/translations/fr.json +211 -31
- package/translations/sw.json +163 -0
- package/.turbo/turbo-build.log +0 -6
- package/dist/1074.js +0 -1
- package/dist/1074.js.map +0 -1
- package/dist/1190.js +0 -1
- package/dist/1190.js.map +0 -1
- package/dist/12.js +0 -17
- package/dist/12.js.map +0 -1
- package/dist/1272.js +0 -1
- package/dist/1272.js.map +0 -1
- package/dist/1285.js +0 -1
- package/dist/1285.js.map +0 -1
- package/dist/1288.js +0 -1
- package/dist/1288.js.map +0 -1
- package/dist/1311.js +0 -1
- package/dist/1311.js.map +0 -1
- package/dist/1374.js +0 -1
- package/dist/1374.js.map +0 -1
- package/dist/1402.js +0 -1
- package/dist/1402.js.map +0 -1
- package/dist/1462.js +0 -1
- package/dist/1462.js.map +0 -1
- package/dist/1469.js +0 -1
- package/dist/1469.js.map +0 -1
- package/dist/1506.js +0 -13
- package/dist/1506.js.map +0 -1
- package/dist/1772.js +0 -1
- package/dist/1772.js.map +0 -1
- package/dist/1889.js +0 -1
- package/dist/1889.js.map +0 -1
- package/dist/1972.js +0 -1
- package/dist/1972.js.map +0 -1
- package/dist/1981.js +0 -1
- package/dist/1981.js.map +0 -1
- package/dist/1990.js +0 -1
- package/dist/1990.js.map +0 -1
- package/dist/2016.js +0 -1
- package/dist/2016.js.map +0 -1
- package/dist/2153.js +0 -1
- package/dist/2153.js.map +0 -1
- package/dist/216.js +0 -1
- package/dist/216.js.map +0 -1
- package/dist/2252.js +0 -1
- package/dist/2252.js.map +0 -1
- package/dist/2270.js +0 -1
- package/dist/2270.js.map +0 -1
- package/dist/2294.js +0 -1
- package/dist/2294.js.map +0 -1
- package/dist/2345.js +0 -1
- package/dist/2345.js.map +0 -1
- package/dist/235.js +0 -1
- package/dist/235.js.map +0 -1
- package/dist/2441.js +0 -1
- package/dist/2441.js.map +0 -1
- package/dist/2500.js +0 -1
- package/dist/2500.js.map +0 -1
- package/dist/251.js +0 -1
- package/dist/251.js.map +0 -1
- package/dist/2567.js +0 -1
- package/dist/2567.js.map +0 -1
- package/dist/257.js +0 -1
- package/dist/257.js.map +0 -1
- package/dist/2584.js +0 -1
- package/dist/2584.js.map +0 -1
- package/dist/2586.js +0 -1
- package/dist/2586.js.map +0 -1
- package/dist/2625.js +0 -1
- package/dist/2625.js.map +0 -1
- package/dist/2652.js +0 -1
- package/dist/2652.js.map +0 -1
- package/dist/2685.js +0 -1
- package/dist/2685.js.map +0 -1
- package/dist/2724.js +0 -1
- package/dist/2724.js.map +0 -1
- package/dist/2731.js +0 -1
- package/dist/2731.js.map +0 -1
- package/dist/2948.js +0 -1
- package/dist/2948.js.map +0 -1
- package/dist/2970.js +0 -1
- package/dist/2970.js.map +0 -1
- package/dist/3089.js +0 -1
- package/dist/3089.js.map +0 -1
- package/dist/3190.js +0 -1
- package/dist/3190.js.map +0 -1
- package/dist/3293.js +0 -1
- package/dist/3293.js.map +0 -1
- package/dist/3548.js +0 -1
- package/dist/3548.js.map +0 -1
- package/dist/3571.js +0 -1
- package/dist/3571.js.map +0 -1
- package/dist/3691.js +0 -1
- package/dist/3691.js.map +0 -1
- package/dist/3735.js +0 -1
- package/dist/3735.js.map +0 -1
- package/dist/3798.js +0 -1
- package/dist/3798.js.map +0 -1
- package/dist/3816.js +0 -1
- package/dist/3816.js.map +0 -1
- package/dist/3906.js +0 -1
- package/dist/3906.js.map +0 -1
- package/dist/3963.js +0 -1
- package/dist/3963.js.map +0 -1
- package/dist/405.js +0 -1
- package/dist/405.js.map +0 -1
- package/dist/4282.js +0 -1
- package/dist/4282.js.map +0 -1
- package/dist/4296.js +0 -1
- package/dist/4296.js.map +0 -1
- package/dist/4337.js +0 -1
- package/dist/4337.js.map +0 -1
- package/dist/4716.js +0 -1
- package/dist/4716.js.map +0 -1
- package/dist/4735.js +0 -1
- package/dist/4735.js.map +0 -1
- package/dist/4744.js +0 -1
- package/dist/4744.js.map +0 -1
- package/dist/4813.js +0 -2
- package/dist/4813.js.map +0 -1
- package/dist/4827.js +0 -1
- package/dist/4827.js.map +0 -1
- package/dist/4858.js +0 -1
- package/dist/4858.js.map +0 -1
- package/dist/487.js +0 -1
- package/dist/487.js.map +0 -1
- package/dist/4970.js +0 -1
- package/dist/4970.js.map +0 -1
- package/dist/5202.js +0 -1
- package/dist/5202.js.map +0 -1
- package/dist/5234.js +0 -1
- package/dist/5234.js.map +0 -1
- package/dist/5386.js +0 -1
- package/dist/5386.js.map +0 -1
- package/dist/5490.js +0 -1
- package/dist/5490.js.map +0 -1
- package/dist/552.js +0 -1
- package/dist/552.js.map +0 -1
- package/dist/5592.js +0 -1
- package/dist/5592.js.map +0 -1
- package/dist/5669.js +0 -1
- package/dist/5669.js.map +0 -1
- package/dist/606.js +0 -1
- package/dist/606.js.map +0 -1
- package/dist/6092.js +0 -1
- package/dist/6092.js.map +0 -1
- package/dist/6178.js +0 -1
- package/dist/6178.js.map +0 -1
- package/dist/6258.js +0 -1
- package/dist/6258.js.map +0 -1
- package/dist/6456.js +0 -1
- package/dist/6466.js +0 -3
- package/dist/6466.js.map +0 -1
- package/dist/6492.js +0 -1
- package/dist/6492.js.map +0 -1
- package/dist/6675.js +0 -1
- package/dist/6675.js.map +0 -1
- package/dist/6676.js +0 -1
- package/dist/6676.js.map +0 -1
- package/dist/7005.js +0 -1
- package/dist/7005.js.map +0 -1
- package/dist/7160.js +0 -1
- package/dist/7160.js.map +0 -1
- package/dist/7201.js +0 -1
- package/dist/7201.js.map +0 -1
- package/dist/7210.js +0 -1
- package/dist/7210.js.map +0 -1
- package/dist/7234.js +0 -1
- package/dist/7234.js.map +0 -1
- package/dist/7261.js +0 -1
- package/dist/7261.js.map +0 -1
- package/dist/7326.js +0 -1
- package/dist/7336.js +0 -1
- package/dist/7336.js.map +0 -1
- package/dist/7463.js +0 -1
- package/dist/7463.js.map +0 -1
- package/dist/7545.js +0 -1
- package/dist/7545.js.map +0 -1
- package/dist/7607.js +0 -1
- package/dist/7717.js +0 -1
- package/dist/7717.js.map +0 -1
- package/dist/7737.js +0 -1
- package/dist/7737.js.map +0 -1
- package/dist/7739.js +0 -1
- package/dist/7739.js.map +0 -1
- package/dist/7765.js +0 -1
- package/dist/7765.js.map +0 -1
- package/dist/7769.js +0 -1
- package/dist/7769.js.map +0 -1
- package/dist/7785.js +0 -1
- package/dist/7785.js.map +0 -1
- package/dist/7819.js +0 -1
- package/dist/7819.js.map +0 -1
- package/dist/7820.js +0 -1
- package/dist/7820.js.map +0 -1
- package/dist/7844.js +0 -1
- package/dist/7844.js.map +0 -1
- package/dist/7874.js +0 -1
- package/dist/7874.js.map +0 -1
- package/dist/7971.js +0 -1
- package/dist/7971.js.map +0 -1
- package/dist/8159.js +0 -7
- package/dist/8159.js.map +0 -1
- package/dist/8244.js +0 -1
- package/dist/8244.js.map +0 -1
- package/dist/845.js +0 -1
- package/dist/845.js.map +0 -1
- package/dist/8570.js +0 -1
- package/dist/8570.js.map +0 -1
- package/dist/8670.js +0 -1
- package/dist/8670.js.map +0 -1
- package/dist/87.js +0 -1
- package/dist/87.js.map +0 -1
- package/dist/8727.js +0 -1
- package/dist/8828.js +0 -1
- package/dist/8828.js.map +0 -1
- package/dist/8860.js +0 -1
- package/dist/8860.js.map +0 -1
- package/dist/9124.js +0 -1
- package/dist/9124.js.map +0 -1
- package/dist/913.js +0 -1
- package/dist/913.js.map +0 -1
- package/dist/9182.js +0 -1
- package/dist/921.js +0 -1
- package/dist/921.js.map +0 -1
- package/dist/9404.js +0 -1
- package/dist/9404.js.map +0 -1
- package/dist/9406.js +0 -1
- package/dist/9406.js.map +0 -1
- package/dist/9446.js +0 -1
- package/dist/9446.js.map +0 -1
- package/dist/9449.js +0 -1
- package/dist/9449.js.map +0 -1
- package/dist/9566.js +0 -5
- package/dist/9566.js.map +0 -1
- package/dist/9641.js +0 -1
- package/dist/9641.js.map +0 -1
- package/dist/9801.js +0 -1
- package/dist/9801.js.map +0 -1
- package/dist/9835.js +0 -11
- package/dist/9835.js.map +0 -1
- package/dist/9938.js +0 -1
- package/dist/9938.js.map +0 -1
- package/dist/kenyaemr-esm-morgue-app.js +0 -5
- package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +0 -3398
- package/dist/kenyaemr-esm-morgue-app.js.map +0 -1
- package/dist/main.js +0 -5
- package/dist/main.js.map +0 -1
- package/dist/routes.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-morgue-app",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.5-pre.16",
|
|
4
4
|
"description": "morgue app for KenyaEMR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openmrs"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "rspack --mode=production",
|
|
23
23
|
"coverage": "echo \"Jest has been removed; no unit test runner is configured\" && exit 0",
|
|
24
24
|
"debug": "npm run serve",
|
|
25
|
-
"extract-translations": "i18next 'src/**/*.
|
|
25
|
+
"extract-translations": "i18next 'src/**/*.{ts,tsx}' --config ../../tools/i18next-parser.config.js",
|
|
26
26
|
"lint": "eslint src --ext ts,tsx",
|
|
27
27
|
"serve": "rspack serve --mode=development",
|
|
28
28
|
"start": "openmrs develop",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"stableVersion": "5.4.
|
|
49
|
+
"stableVersion": "5.4.4"
|
|
50
50
|
}
|
|
@@ -3,7 +3,7 @@ import { Tag } from '@carbon/react';
|
|
|
3
3
|
import styles from '../bed.scss';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { type EnhancedPatient } from '../../types';
|
|
6
|
-
import { type Visit } from '@openmrs/esm-framework
|
|
6
|
+
import { type Visit } from '@openmrs/esm-framework';
|
|
7
7
|
interface PatientStatusFooterProps {
|
|
8
8
|
patient: EnhancedPatient;
|
|
9
9
|
isAdmitted: boolean;
|
package/src/config-schema.ts
CHANGED
|
@@ -100,12 +100,12 @@ export const configSchema = {
|
|
|
100
100
|
autopsyFormUuid: {
|
|
101
101
|
_type: Type.String,
|
|
102
102
|
_description: 'UUID for autopsy form',
|
|
103
|
-
_default: '
|
|
103
|
+
_default: '016beec1-edff-4293-b3ed-817c7dddaa93',
|
|
104
104
|
},
|
|
105
105
|
autopsyEncounterFormUuid: {
|
|
106
106
|
_type: Type.String,
|
|
107
107
|
_description: 'Encounter UUID for autopsy',
|
|
108
|
-
_default: '
|
|
108
|
+
_default: '32b61a73-4971-4fc0-b20b-9a30176317e2',
|
|
109
109
|
},
|
|
110
110
|
courtOrderCaseNumberUuid: {
|
|
111
111
|
_type: Type.String,
|
|
@@ -289,6 +289,11 @@ export const configSchema = {
|
|
|
289
289
|
_default: 'dfacd928-0370-4315-99d7-6ec1c9f7ae76',
|
|
290
290
|
_description: 'UUID for the patient Opennmrs identifier type to display',
|
|
291
291
|
},
|
|
292
|
+
paymentMethods: {
|
|
293
|
+
_type: Type.Array,
|
|
294
|
+
_description: 'List of payment methods used when printing gatepass',
|
|
295
|
+
_default: ['Cash', 'Cheque', 'SHA', 'Scheme', 'M.R.M'],
|
|
296
|
+
},
|
|
292
297
|
};
|
|
293
298
|
|
|
294
299
|
export interface BillingConfig {
|
|
@@ -362,4 +367,5 @@ export type ConfigObject = {
|
|
|
362
367
|
mortuaryNotUrgentPriorityUuid: string;
|
|
363
368
|
mortalityEncounterTypeUuid: string;
|
|
364
369
|
patientIdentifierTypeUuid: string;
|
|
370
|
+
paymentMethods: Array<string>;
|
|
365
371
|
};
|
package/src/dashboard.meta.ts
CHANGED
|
@@ -27,6 +27,25 @@
|
|
|
27
27
|
.buttonContainer {
|
|
28
28
|
max-width: 50%;
|
|
29
29
|
}
|
|
30
|
+
.buttonSet {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: 1fr 1fr;
|
|
33
|
+
width: 100%;
|
|
34
|
+
margin-top: auto;
|
|
35
|
+
|
|
36
|
+
:global(.cds--btn) {
|
|
37
|
+
max-width: none;
|
|
38
|
+
width: 100%;
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.tablet {
|
|
45
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
46
|
+
background-color: colors.$white;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
30
49
|
.inlineLoading {
|
|
31
50
|
display: flex;
|
|
32
51
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
ButtonSet,
|
|
@@ -71,7 +71,6 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
71
71
|
const { t } = useTranslation();
|
|
72
72
|
const isTablet = useLayoutType() === 'tablet';
|
|
73
73
|
const [searchTerm, setSearchTerm] = useState('');
|
|
74
|
-
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
|
75
74
|
const { time: defaultTime, period: defaultPeriod } = getCurrentTime();
|
|
76
75
|
const config = useConfig<ConfigObject>();
|
|
77
76
|
|
|
@@ -141,6 +140,10 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
141
140
|
},
|
|
142
141
|
});
|
|
143
142
|
|
|
143
|
+
const closeWorkspaceWithSavedChanges = () => {
|
|
144
|
+
closeWorkspace({ discardUnsavedChanges: true });
|
|
145
|
+
};
|
|
146
|
+
|
|
144
147
|
const placeOfDeath = watch('placeOfDeath');
|
|
145
148
|
const deadBodyPreservation = watch('deadBodyPreservation');
|
|
146
149
|
const paymentMethodObservable = watch('paymentMethod');
|
|
@@ -189,6 +192,7 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
189
192
|
if (isSubmitting) {
|
|
190
193
|
return;
|
|
191
194
|
}
|
|
195
|
+
|
|
192
196
|
const { admissionEncounter, compartment } = await admitBody(patientUuid, data);
|
|
193
197
|
|
|
194
198
|
if (admissionEncounter && compartment) {
|
|
@@ -215,7 +219,7 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
215
219
|
kind: 'success',
|
|
216
220
|
});
|
|
217
221
|
mutated();
|
|
218
|
-
|
|
222
|
+
closeWorkspaceWithSavedChanges();
|
|
219
223
|
} catch (error) {
|
|
220
224
|
showSnackbar({
|
|
221
225
|
title: t('error', 'Error'),
|
|
@@ -225,12 +229,8 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
225
229
|
}
|
|
226
230
|
};
|
|
227
231
|
|
|
228
|
-
useEffect(() => {
|
|
229
|
-
setHasUnsavedChanges(isDirty);
|
|
230
|
-
}, [isDirty, setHasUnsavedChanges]);
|
|
231
|
-
|
|
232
232
|
return (
|
|
233
|
-
<Workspace2 title={t('admitDeceasedPerson', 'Admit deceased person')} hasUnsavedChanges={
|
|
233
|
+
<Workspace2 title={t('admitDeceasedPerson', 'Admit deceased person')} hasUnsavedChanges={isDirty}>
|
|
234
234
|
<Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
|
|
235
235
|
<div className={styles.formContainer}>
|
|
236
236
|
<Stack gap={3}>
|
|
@@ -394,9 +394,7 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
394
394
|
titleText={t('searchServices', 'Search services *')}
|
|
395
395
|
items={availableServices.map((service) => service.uuid)}
|
|
396
396
|
itemToString={(item) => availableServices.find((i) => i.uuid === item)?.name ?? ''}
|
|
397
|
-
onChange={({ selectedItems }) =>
|
|
398
|
-
field.onChange(selectedItems);
|
|
399
|
-
}}
|
|
397
|
+
onChange={({ selectedItems }) => field.onChange(selectedItems)}
|
|
400
398
|
placeholder={t('Service', 'Service')}
|
|
401
399
|
initialSelectedItems={field.value}
|
|
402
400
|
invalid={!!errors.services}
|
|
@@ -418,6 +416,7 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
418
416
|
/>
|
|
419
417
|
</Column>
|
|
420
418
|
)}
|
|
419
|
+
|
|
421
420
|
<ResponsiveWrapper>
|
|
422
421
|
<Controller
|
|
423
422
|
name="placeOfDeath"
|
|
@@ -498,18 +497,16 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
498
497
|
<Controller
|
|
499
498
|
name="timeOfDeath"
|
|
500
499
|
control={control}
|
|
501
|
-
render={({ field }) =>
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
);
|
|
512
|
-
}}
|
|
500
|
+
render={({ field }) => (
|
|
501
|
+
<TimePicker
|
|
502
|
+
{...field}
|
|
503
|
+
id="time-of-death-picker"
|
|
504
|
+
labelText={t('timeAdmission', 'Time of admission *')}
|
|
505
|
+
className={styles.formAdmissionTimepicker}
|
|
506
|
+
invalid={!!errors.timeOfDeath}
|
|
507
|
+
invalidText={errors.timeOfDeath?.message}
|
|
508
|
+
/>
|
|
509
|
+
)}
|
|
513
510
|
/>
|
|
514
511
|
<Controller
|
|
515
512
|
name="period"
|
|
@@ -540,7 +537,6 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
540
537
|
render={({ field }) => {
|
|
541
538
|
const yesOption = deathConfirmationTypes.find((type) => type.label === 'Yes');
|
|
542
539
|
const noOption = deathConfirmationTypes.find((type) => type.label === 'No');
|
|
543
|
-
|
|
544
540
|
return (
|
|
545
541
|
<RadioButtonGroup
|
|
546
542
|
name="deathConfirmed"
|
|
@@ -603,7 +599,6 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
603
599
|
</Column>
|
|
604
600
|
</FormGroup>
|
|
605
601
|
</ResponsiveWrapper>
|
|
606
|
-
|
|
607
602
|
<ResponsiveWrapper>
|
|
608
603
|
<FormGroup legendText="">
|
|
609
604
|
<Column>
|
|
@@ -654,7 +649,6 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
654
649
|
render={({ field }) => {
|
|
655
650
|
const yesOption = deathConfirmationTypes.find((type) => type.label === 'Yes');
|
|
656
651
|
const noOption = deathConfirmationTypes.find((type) => type.label === 'No');
|
|
657
|
-
|
|
658
652
|
return (
|
|
659
653
|
<RadioButtonGroup
|
|
660
654
|
name="autopsyPermission"
|
|
@@ -757,7 +751,6 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
757
751
|
</Column>
|
|
758
752
|
</FormGroup>
|
|
759
753
|
</ResponsiveWrapper>
|
|
760
|
-
|
|
761
754
|
<ResponsiveWrapper>
|
|
762
755
|
<FormGroup legendText="">
|
|
763
756
|
<Column>
|
|
@@ -777,7 +770,6 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
777
770
|
</Column>
|
|
778
771
|
</FormGroup>
|
|
779
772
|
</ResponsiveWrapper>
|
|
780
|
-
|
|
781
773
|
<ResponsiveWrapper>
|
|
782
774
|
<FormGroup legendText="">
|
|
783
775
|
<Column>
|
|
@@ -800,6 +792,7 @@ const AdmitDeceasedPerson: React.FC<Workspace2DefinitionProps<AdmitDeceasedPerso
|
|
|
800
792
|
</ResponsiveWrapper>
|
|
801
793
|
</>
|
|
802
794
|
)}
|
|
795
|
+
|
|
803
796
|
<FormGroup
|
|
804
797
|
className={styles.supportingDocuments}
|
|
805
798
|
legendText={t('supportingDocuments', 'Supporting Documents')}>
|
|
@@ -21,6 +21,26 @@
|
|
|
21
21
|
background-color: colors.$white;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
.buttonSet {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: 1fr 1fr;
|
|
27
|
+
width: 100%;
|
|
28
|
+
margin-top: auto;
|
|
29
|
+
|
|
30
|
+
:global(.cds--btn) {
|
|
31
|
+
max-width: none;
|
|
32
|
+
width: 100%;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.tablet {
|
|
39
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
40
|
+
background-color: colors.$white;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
24
44
|
.desktop {
|
|
25
45
|
padding: 0;
|
|
26
46
|
padding: layout.$spacing-01 layout.$spacing-04;
|
|
@@ -61,7 +61,7 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
61
61
|
const { t } = useTranslation();
|
|
62
62
|
const isTablet = useLayoutType() === 'tablet';
|
|
63
63
|
const [submissionError, setSubmissionError] = useState<string | null>(null);
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
const { activeVisit, currentVisitIsRetrospective } = useVisit(patientUuid);
|
|
66
66
|
const { queueEntry } = useVisitQueueEntry(patientUuid, activeVisit?.uuid);
|
|
67
67
|
const { dischargeBody } = useMortuaryOperation();
|
|
@@ -108,8 +108,24 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
108
108
|
},
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
+
const closeWorkspaceWithSavedChanges = () => {
|
|
112
|
+
closeWorkspace({ discardUnsavedChanges: true });
|
|
113
|
+
};
|
|
114
|
+
|
|
111
115
|
const selectedDischargeType = watch('dischargeType');
|
|
112
116
|
|
|
117
|
+
const getAttributeValue = useCallback(
|
|
118
|
+
(attributeTypeUuid: string) =>
|
|
119
|
+
personAttributes?.find((attr) => attr.attributeType.uuid === attributeTypeUuid)?.value || '',
|
|
120
|
+
[personAttributes],
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const getExistingAttributeUuid = useCallback(
|
|
124
|
+
(attributeTypeUuid: string) =>
|
|
125
|
+
personAttributes?.find((attr) => attr.attributeType.uuid === attributeTypeUuid)?.uuid || null,
|
|
126
|
+
[personAttributes],
|
|
127
|
+
);
|
|
128
|
+
|
|
113
129
|
useEffect(() => {
|
|
114
130
|
if (personAttributes?.length) {
|
|
115
131
|
setValue('nextOfKinNames', getAttributeValue(nextOfKinNameUuid));
|
|
@@ -120,30 +136,19 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
120
136
|
}, [
|
|
121
137
|
personAttributes,
|
|
122
138
|
setValue,
|
|
139
|
+
getAttributeValue,
|
|
123
140
|
nextOfKinNameUuid,
|
|
124
141
|
nextOfKinRelationshipUuid,
|
|
125
142
|
nextOfKinPhoneUuid,
|
|
126
143
|
nextOfKinNationalIdUuid,
|
|
127
144
|
]);
|
|
128
145
|
|
|
129
|
-
const getAttributeValue = useCallback(
|
|
130
|
-
(attributeTypeUuid: string) =>
|
|
131
|
-
personAttributes?.find((attr) => attr.attributeType.uuid === attributeTypeUuid)?.value || '',
|
|
132
|
-
[personAttributes],
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
const getExistingAttributeUuid = useCallback(
|
|
136
|
-
(attributeTypeUuid: string) =>
|
|
137
|
-
personAttributes?.find((attr) => attr.attributeType.uuid === attributeTypeUuid)?.uuid || null,
|
|
138
|
-
[personAttributes],
|
|
139
|
-
);
|
|
140
|
-
|
|
141
146
|
const onSubmit = async (data) => {
|
|
142
147
|
setSubmissionError(null);
|
|
143
148
|
|
|
144
149
|
if (currentVisitIsRetrospective) {
|
|
145
150
|
setCurrentVisit(null, null);
|
|
146
|
-
|
|
151
|
+
closeWorkspaceWithSavedChanges();
|
|
147
152
|
return;
|
|
148
153
|
}
|
|
149
154
|
|
|
@@ -180,15 +185,10 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
180
185
|
|
|
181
186
|
for (const attr of attributeUpdates) {
|
|
182
187
|
try {
|
|
183
|
-
const attributeData: any = {
|
|
184
|
-
attributeType: attr.uuid,
|
|
185
|
-
value: attr.value,
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
+
const attributeData: any = { attributeType: attr.uuid, value: attr.value };
|
|
188
189
|
if (attr.existingUuid) {
|
|
189
190
|
attributeData.uuid = attr.existingUuid;
|
|
190
191
|
}
|
|
191
|
-
|
|
192
192
|
await createOrUpdatePersonAttribute(patientUuid, attributeData, patientInfo);
|
|
193
193
|
} catch (error) {
|
|
194
194
|
showSnackbar({
|
|
@@ -214,7 +214,7 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
mutate();
|
|
217
|
-
|
|
217
|
+
closeWorkspaceWithSavedChanges();
|
|
218
218
|
} catch (error) {
|
|
219
219
|
let errorMessage = t('dischargeUnknownError', 'An unknown error occurred');
|
|
220
220
|
if (error?.message) {
|
|
@@ -224,7 +224,6 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
224
224
|
} else if (error?.responseBody?.error?.globalErrors) {
|
|
225
225
|
errorMessage = error.responseBody.error.globalErrors[0]?.message || errorMessage;
|
|
226
226
|
}
|
|
227
|
-
|
|
228
227
|
setSubmissionError(errorMessage);
|
|
229
228
|
showSnackbar({
|
|
230
229
|
title: t('dischargeError', 'Discharge Error'),
|
|
@@ -235,12 +234,8 @@ const DischargeForm: React.FC<Workspace2DefinitionProps<DischargeFormProps, obje
|
|
|
235
234
|
}
|
|
236
235
|
};
|
|
237
236
|
|
|
238
|
-
useEffect(() => {
|
|
239
|
-
setHasUnsavedChanges(isDirty);
|
|
240
|
-
}, [isDirty, setHasUnsavedChanges]);
|
|
241
|
-
|
|
242
237
|
return (
|
|
243
|
-
<Workspace2 title={t('dischargeForm', 'Discharge form')} hasUnsavedChanges={
|
|
238
|
+
<Workspace2 title={t('dischargeForm', 'Discharge form')} hasUnsavedChanges={isDirty}>
|
|
244
239
|
<Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
|
|
245
240
|
<div className={styles.formContainer}>
|
|
246
241
|
{isLoadingBills && <InlineLoading description={t('loadingBills', 'Loading bills...')} />}
|
|
@@ -142,3 +142,23 @@
|
|
|
142
142
|
.sectionField {
|
|
143
143
|
padding-top: layout.$spacing-03;
|
|
144
144
|
}
|
|
145
|
+
|
|
146
|
+
.buttonSet {
|
|
147
|
+
display: grid;
|
|
148
|
+
grid-template-columns: 1fr 1fr;
|
|
149
|
+
width: 100%;
|
|
150
|
+
margin-top: auto;
|
|
151
|
+
|
|
152
|
+
:global(.cds--btn) {
|
|
153
|
+
max-width: none;
|
|
154
|
+
width: 100%;
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
align-items: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&.tablet {
|
|
161
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
162
|
+
background-color: colors.$white;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Tile,
|
|
14
14
|
FormGroup,
|
|
15
15
|
} from '@carbon/react';
|
|
16
|
-
import React, { useState, useMemo
|
|
16
|
+
import React, { useState, useMemo } from 'react';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
18
|
import DeceasedInfo from '../../deceased-patient-header/deceasedInfo/deceased-info.component';
|
|
19
19
|
import styles from './swap-unit.scss';
|
|
@@ -62,7 +62,6 @@ const SwapForm: React.FC<Workspace2DefinitionProps<SwapFormProps, object, object
|
|
|
62
62
|
const { currentVisit } = useVisit(patientUuid);
|
|
63
63
|
const { assignDeceasedToCompartment, removeDeceasedFromCompartment, createEncounterForCompartmentSwap } =
|
|
64
64
|
useMortuaryOperation();
|
|
65
|
-
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
|
66
65
|
const [searchTerm, setSearchTerm] = useState('');
|
|
67
66
|
|
|
68
67
|
const {
|
|
@@ -76,6 +75,10 @@ const SwapForm: React.FC<Workspace2DefinitionProps<SwapFormProps, object, object
|
|
|
76
75
|
},
|
|
77
76
|
});
|
|
78
77
|
|
|
78
|
+
const closeWorkspaceWithSavedChanges = () => {
|
|
79
|
+
closeWorkspace({ discardUnsavedChanges: true });
|
|
80
|
+
};
|
|
81
|
+
|
|
79
82
|
const currentBed = mortuaryLocation?.bedLayouts?.find((bed) =>
|
|
80
83
|
bed.patients?.some((patient) => patient.uuid === patientUuid),
|
|
81
84
|
);
|
|
@@ -150,7 +153,7 @@ const SwapForm: React.FC<Workspace2DefinitionProps<SwapFormProps, object, object
|
|
|
150
153
|
|
|
151
154
|
mutate();
|
|
152
155
|
navigate({ to: window.getOpenmrsSpaBase() + `home/mortuary` });
|
|
153
|
-
|
|
156
|
+
closeWorkspaceWithSavedChanges();
|
|
154
157
|
} else {
|
|
155
158
|
showSnackbar({
|
|
156
159
|
kind: 'error',
|
|
@@ -167,12 +170,8 @@ const SwapForm: React.FC<Workspace2DefinitionProps<SwapFormProps, object, object
|
|
|
167
170
|
}
|
|
168
171
|
};
|
|
169
172
|
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
setHasUnsavedChanges(isDirty);
|
|
172
|
-
}, [isDirty, setHasUnsavedChanges]);
|
|
173
|
-
|
|
174
173
|
return (
|
|
175
|
-
<Workspace2 title={t('swapCompartment', 'Swap compartment')} hasUnsavedChanges={
|
|
174
|
+
<Workspace2 title={t('swapCompartment', 'Swap compartment')} hasUnsavedChanges={isDirty}>
|
|
176
175
|
<Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
|
|
177
176
|
<div className={styles.formContainer}>
|
|
178
177
|
<Stack gap={3}>
|
|
@@ -262,15 +261,11 @@ const SwapForm: React.FC<Workspace2DefinitionProps<SwapFormProps, object, object
|
|
|
262
261
|
</ResponsiveWrapper>
|
|
263
262
|
</Stack>
|
|
264
263
|
</div>
|
|
265
|
-
<ButtonSet
|
|
266
|
-
|
|
267
|
-
[styles.tablet]: isTablet,
|
|
268
|
-
[styles.desktop]: !isTablet,
|
|
269
|
-
})}>
|
|
270
|
-
<Button className={styles.buttonContainer} kind="secondary" onClick={() => closeWorkspace()}>
|
|
264
|
+
<ButtonSet className={classNames(styles.buttonSet, { [styles.tablet]: isTablet })}>
|
|
265
|
+
<Button kind="secondary" onClick={() => closeWorkspace()}>
|
|
271
266
|
{t('cancel', 'Cancel')}
|
|
272
267
|
</Button>
|
|
273
|
-
<Button
|
|
268
|
+
<Button disabled={isSubmitting || !isDirty} kind="primary" type="submit">
|
|
274
269
|
{isSubmitting ? (
|
|
275
270
|
<span className={styles.inlineLoading}>
|
|
276
271
|
{t('submitting', 'Submitting' + '...')}
|
package/src/index.ts
CHANGED
|
@@ -32,13 +32,13 @@ export function startupApp() {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export const root = getAsyncLifecycle(() => import('./root.component'), options);
|
|
35
|
-
|
|
35
|
+
// t("mortuary", "Morgue")
|
|
36
36
|
export const morgueDashboardLink = getAsyncLifecycle(
|
|
37
37
|
() =>
|
|
38
38
|
import('./left-panel/morgue-left-panel-link.component').then((m) => ({
|
|
39
39
|
default: m.createLeftPanelLink({
|
|
40
40
|
name: 'morgue',
|
|
41
|
-
title: '
|
|
41
|
+
title: 'mortuary',
|
|
42
42
|
}),
|
|
43
43
|
})),
|
|
44
44
|
options,
|
|
@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import last from 'lodash-es/last';
|
|
3
3
|
import { BrowserRouter, useLocation } from 'react-router-dom';
|
|
4
4
|
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
5
6
|
|
|
6
7
|
export interface LinkConfig {
|
|
7
8
|
name: string;
|
|
@@ -9,6 +10,7 @@ export interface LinkConfig {
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export function LinkExtension({ config }: { config: LinkConfig }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
12
14
|
const { name, title } = config;
|
|
13
15
|
const location = useLocation();
|
|
14
16
|
const spaBasePath = window.getOpenmrsSpaBase() + 'home';
|
|
@@ -28,7 +30,7 @@ export function LinkExtension({ config }: { config: LinkConfig }) {
|
|
|
28
30
|
<ConfigurableLink
|
|
29
31
|
to={spaBasePath + '/' + name}
|
|
30
32
|
className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}>
|
|
31
|
-
{title}
|
|
33
|
+
{t(title)}
|
|
32
34
|
</ConfigurableLink>
|
|
33
35
|
);
|
|
34
36
|
}
|
|
@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import { OverflowMenuItem } from '@carbon/react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { launchWorkspace2 } from '@openmrs/esm-framework';
|
|
5
|
+
import { usePatientChartStore } from '@openmrs/esm-patient-common-lib';
|
|
5
6
|
|
|
6
7
|
import styles from './mark-patient-deceased-overflow.scss';
|
|
7
8
|
|
|
@@ -15,11 +16,18 @@ const MarkPatientDeceasedOverflowMenuItem: React.FC<MarkPatientDeceasedOverflowM
|
|
|
15
16
|
patientUuid,
|
|
16
17
|
}) => {
|
|
17
18
|
const { t } = useTranslation();
|
|
19
|
+
const { visitContext, mutateVisitContext } = usePatientChartStore(patientUuid);
|
|
18
20
|
const isDead = patient.deceasedBoolean ?? Boolean(patient.deceasedDateTime);
|
|
19
21
|
|
|
20
22
|
const handleLaunchModal = useCallback(
|
|
21
|
-
() =>
|
|
22
|
-
|
|
23
|
+
() =>
|
|
24
|
+
launchWorkspace2(
|
|
25
|
+
'mortuary-mark-patient-deceased-workspace-form',
|
|
26
|
+
{ patientUuid },
|
|
27
|
+
{},
|
|
28
|
+
{ patient, patientUuid, visitContext, mutateVisitContext },
|
|
29
|
+
),
|
|
30
|
+
[patient, patientUuid, visitContext, mutateVisitContext],
|
|
23
31
|
);
|
|
24
32
|
|
|
25
33
|
return (
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useRef, useState, useMemo } from 'react';
|
|
2
2
|
import { Button, ButtonSet, ModalBody, ModalFooter, InlineNotification } from '@carbon/react';
|
|
3
3
|
import { useReactToPrint } from 'react-to-print';
|
|
4
|
-
import { formatDate, formatDatetime, parseDate, useSession } from '@openmrs/esm-framework';
|
|
4
|
+
import { formatDate, formatDatetime, parseDate, useConfig, useSession } from '@openmrs/esm-framework';
|
|
5
5
|
import styles from './print-preview-confirmation.scss';
|
|
6
6
|
import { type Patient } from '../../types';
|
|
7
7
|
import { formatDateTime, documentId, getAbsoluteDateTime } from '../../utils/utils';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { ConfigObject } from '../../config-schema';
|
|
9
10
|
|
|
10
11
|
type PrintPreviewModalProps = {
|
|
11
12
|
onClose: () => void;
|
|
@@ -15,6 +16,7 @@ type PrintPreviewModalProps = {
|
|
|
15
16
|
|
|
16
17
|
const PrintPreviewModal: React.FC<PrintPreviewModalProps> = ({ onClose, patient, encounterDate }) => {
|
|
17
18
|
const { t } = useTranslation();
|
|
19
|
+
const { paymentMethods } = useConfig<ConfigObject>();
|
|
18
20
|
const [printError, setPrintError] = useState<string | null>(null);
|
|
19
21
|
const printRef = useRef<HTMLDivElement>(null);
|
|
20
22
|
const { sessionLocation, user } = useSession();
|
|
@@ -28,7 +30,7 @@ const PrintPreviewModal: React.FC<PrintPreviewModalProps> = ({ onClose, patient,
|
|
|
28
30
|
setPrintError(null);
|
|
29
31
|
},
|
|
30
32
|
onPrintError: (_, error) => {
|
|
31
|
-
setPrintError(error?.message || 'An error occurred while printing');
|
|
33
|
+
setPrintError(error?.message || t('errorOccurredWhilePrinting', 'An error occurred while printing'));
|
|
32
34
|
},
|
|
33
35
|
pageStyle: `
|
|
34
36
|
@page {
|
|
@@ -108,26 +110,12 @@ const PrintPreviewModal: React.FC<PrintPreviewModalProps> = ({ onClose, patient,
|
|
|
108
110
|
{t('methodOfPayment', 'Method of payment (tick as appropriate)')}
|
|
109
111
|
</div>
|
|
110
112
|
<div className={styles.paymentGrid}>
|
|
111
|
-
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<span className={styles.optionLabel}>{t('cheque', 'Cheque')}</span>
|
|
118
|
-
</div>
|
|
119
|
-
<div className={styles.paymentOption}>
|
|
120
|
-
<span className={styles.checkbox}></span>
|
|
121
|
-
<span className={styles.optionLabel}>{t('sha', 'SHA')}</span>
|
|
122
|
-
</div>
|
|
123
|
-
<div className={styles.paymentOption}>
|
|
124
|
-
<span className={styles.checkbox}></span>
|
|
125
|
-
<span className={styles.optionLabel}>{t('scheme', 'Scheme')}</span>
|
|
126
|
-
</div>
|
|
127
|
-
<div className={styles.paymentOption}>
|
|
128
|
-
<span className={styles.checkbox}></span>
|
|
129
|
-
<span className={styles.optionLabel}>{t('mrM', 'M.R.M')}</span>
|
|
130
|
-
</div>
|
|
113
|
+
{paymentMethods.map((method, i) => (
|
|
114
|
+
<div className={styles.paymentOption} key={i}>
|
|
115
|
+
<span className={styles.checkbox}></span>
|
|
116
|
+
<span className={styles.optionLabel}>{t(method)}</span>
|
|
117
|
+
</div>
|
|
118
|
+
))}
|
|
131
119
|
<div className={styles.paymentOption}>
|
|
132
120
|
<span className={styles.checkbox}></span>
|
|
133
121
|
<span className={styles.optionLabel}>
|
package/src/routes.json
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
{
|
|
76
76
|
"name": "mortuary-mark-patient-deceased-workspace-form",
|
|
77
77
|
"component": "markPatientDeceasedForm",
|
|
78
|
-
"window": "
|
|
78
|
+
"window": "patient-chart-workspace-window"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "discharge-body-form",
|
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
"canHide": true,
|
|
101
101
|
"group": "morgue-workspace-group",
|
|
102
102
|
"width": "wider"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "patient-chart-workspace-window",
|
|
106
|
+
"group": "patient-chart"
|
|
103
107
|
}
|
|
104
108
|
],
|
|
105
109
|
"workspaceGroups2": [
|