@kenyaemr/esm-morgue-app 5.4.2-pre.2344 → 5.4.2-pre.2349
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 +21 -26
- package/dist/162.js +2 -0
- package/dist/162.js.map +1 -0
- package/dist/197.js +1 -1
- package/dist/221.js +1 -1
- package/dist/221.js.map +1 -1
- package/dist/293.js +1 -1
- package/dist/294.js +1 -1
- package/dist/300.js +1 -1
- package/dist/351.js +1 -0
- package/dist/351.js.map +1 -0
- package/dist/38.js +1 -1
- package/dist/38.js.map +1 -1
- package/dist/404.js +1 -0
- package/dist/404.js.map +1 -0
- package/dist/441.js +1 -0
- package/dist/441.js.map +1 -0
- package/dist/467.js +1 -1
- package/dist/467.js.map +1 -1
- package/dist/500.js +1 -0
- package/dist/500.js.map +1 -0
- package/dist/570.js +1 -0
- package/dist/570.js.map +1 -0
- package/dist/608.js +2 -0
- package/dist/608.js.map +1 -0
- package/dist/611.js +2 -0
- package/dist/611.js.map +1 -0
- package/dist/632.js +2 -1
- package/dist/632.js.map +1 -1
- package/dist/653.js +1 -1
- package/dist/653.js.map +1 -1
- package/dist/657.js +1 -0
- package/dist/657.js.map +1 -0
- package/dist/805.js +1 -1
- package/dist/805.js.map +1 -1
- package/dist/814.js +2 -0
- package/dist/814.js.LICENSE.txt +5 -0
- package/dist/814.js.map +1 -0
- package/dist/824.js +1 -1
- package/dist/824.js.map +1 -1
- package/dist/845.js +1 -0
- package/dist/845.js.map +1 -0
- package/dist/888.js +1 -0
- package/dist/888.js.map +1 -0
- package/dist/899.js +1 -0
- package/dist/899.js.map +1 -0
- package/dist/918.js +1 -1
- package/dist/918.js.map +1 -1
- package/dist/990.js +1 -0
- package/dist/990.js.map +1 -0
- package/dist/kenyaemr-esm-morgue-app.js +1 -1
- package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +258 -184
- package/dist/kenyaemr-esm-morgue-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +0 -6
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/bed/bed.component.tsx +63 -134
- package/src/bed/components/deceased-patient-card-header.component.tsx +73 -0
- package/src/bed/components/deceased-patient-info.component.tsx +47 -0
- package/src/bed/components/deceased-patient-status-footer.component.tsx +43 -0
- package/src/bed-layout/admitted/admitted-bed-layout.component.tsx +175 -96
- package/src/bed-layout/awaiting/awaiting-bed-layout.component.tsx +103 -36
- package/src/bed-layout/bed-layout.scss +4 -0
- package/src/bed-layout/discharged/discharged-bed-layout.component.tsx +131 -73
- package/src/bed-linelist-view/admitted/admitted-bed-linelist-view.component.tsx +182 -134
- package/src/bed-linelist-view/awaiting/awaiting-bed-linelist-view.component.tsx +115 -71
- package/src/bed-linelist-view/discharged/discharged-bed-line-view.component.tsx +181 -109
- package/src/config-schema.ts +140 -4
- package/src/context/deceased-person-context.tsx +33 -0
- package/src/extension/actionButton.component.tsx +1 -1
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.resource.ts +84 -166
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.scss +14 -0
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.workspace.tsx +504 -334
- package/src/forms/discharge-deceased-person-workspace/discharge-body.resource.ts +0 -1
- package/src/forms/discharge-deceased-person-workspace/discharge-body.scss +15 -0
- package/src/forms/discharge-deceased-person-workspace/discharge-body.workspace.tsx +303 -244
- package/src/helpers/expression-helper.ts +122 -0
- package/src/home/home.component.tsx +23 -4
- package/src/index.ts +0 -2
- package/src/metrics/metrics-card.component.tsx +2 -2
- package/src/routes.json +0 -6
- package/src/schemas/index.ts +243 -51
- package/src/summary/summary.component.tsx +16 -9
- package/src/switcher/content-switcher.component.tsx +61 -35
- package/src/switcher/content-switcher.scss +13 -0
- package/src/types/index.ts +43 -1
- package/translations/am.json +16 -6
- package/translations/en.json +16 -6
- package/translations/sw.json +16 -6
- package/dist/347.js +0 -1
- package/dist/347.js.map +0 -1
- package/dist/373.js +0 -2
- package/dist/373.js.map +0 -1
- package/dist/398.js +0 -1
- package/dist/398.js.map +0 -1
- package/dist/410.js +0 -1
- package/dist/410.js.map +0 -1
- package/dist/429.js +0 -2
- package/dist/429.js.map +0 -1
- package/dist/579.js +0 -2
- package/dist/579.js.map +0 -1
- package/dist/619.js +0 -1
- package/dist/619.js.map +0 -1
- package/dist/633.js +0 -1
- package/dist/633.js.map +0 -1
- package/dist/712.js +0 -1
- package/dist/712.js.map +0 -1
- package/dist/713.js +0 -1
- package/dist/713.js.map +0 -1
- package/dist/723.js +0 -1
- package/dist/723.js.map +0 -1
- package/dist/989.js +0 -2
- package/dist/989.js.map +0 -1
- package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.resource.ts +0 -18
- package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.scss +0 -84
- package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.workspace.tsx +0 -505
- /package/dist/{989.js.LICENSE.txt → 162.js.LICENSE.txt} +0 -0
- /package/dist/{373.js.LICENSE.txt → 608.js.LICENSE.txt} +0 -0
- /package/dist/{429.js.LICENSE.txt → 611.js.LICENSE.txt} +0 -0
- /package/dist/{579.js.LICENSE.txt → 632.js.LICENSE.txt} +0 -0
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
type DefaultWorkspaceProps,
|
|
4
|
-
ResponsiveWrapper,
|
|
5
|
-
useLayoutType,
|
|
6
|
-
showSnackbar,
|
|
7
|
-
useConfig,
|
|
8
|
-
restBaseUrl,
|
|
9
|
-
ExtensionSlot,
|
|
10
|
-
} from '@openmrs/esm-framework';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
import { Controller, useForm } from 'react-hook-form';
|
|
13
|
-
import {
|
|
14
|
-
ButtonSet,
|
|
15
3
|
Button,
|
|
16
|
-
|
|
17
|
-
TextInput,
|
|
18
|
-
FormGroup,
|
|
19
|
-
Stack,
|
|
20
|
-
Form,
|
|
21
|
-
FilterableMultiSelect,
|
|
22
|
-
DatePicker,
|
|
4
|
+
ButtonSet,
|
|
23
5
|
Column,
|
|
6
|
+
ComboBox,
|
|
7
|
+
DatePicker,
|
|
24
8
|
DatePickerInput,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
Dropdown,
|
|
10
|
+
FilterableMultiSelect,
|
|
11
|
+
Form,
|
|
12
|
+
FormGroup,
|
|
13
|
+
InlineLoading,
|
|
14
|
+
InlineNotification,
|
|
15
|
+
Layer,
|
|
29
16
|
RadioButton,
|
|
30
17
|
RadioButtonGroup,
|
|
18
|
+
Search,
|
|
19
|
+
SelectItem,
|
|
20
|
+
Stack,
|
|
31
21
|
Tag,
|
|
32
|
-
|
|
22
|
+
TextInput,
|
|
23
|
+
TimePicker,
|
|
24
|
+
TimePickerSelect,
|
|
33
25
|
Tile,
|
|
34
|
-
|
|
35
|
-
ComboBox,
|
|
36
|
-
InlineNotification,
|
|
26
|
+
TextArea,
|
|
37
27
|
} from '@carbon/react';
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
40
|
-
|
|
28
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
29
|
+
import {
|
|
30
|
+
ExtensionSlot,
|
|
31
|
+
ResponsiveWrapper,
|
|
32
|
+
restBaseUrl,
|
|
33
|
+
showSnackbar,
|
|
34
|
+
useConfig,
|
|
35
|
+
useLayoutType,
|
|
36
|
+
useSession,
|
|
37
|
+
} from '@openmrs/esm-framework';
|
|
38
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
39
|
+
import { useTranslation } from 'react-i18next';
|
|
41
40
|
import styles from './admit-deceased-person.scss';
|
|
41
|
+
import { createDeceasedPatientAdmitSchema } from '../../schemas';
|
|
42
|
+
import { getCurrentTime } from '../../utils/utils';
|
|
43
|
+
import { ConfigObject } from '../../config-schema';
|
|
44
|
+
import { DeceasedPatientHeader } from '../../deceased-patient-header/deceased-patient-header.component';
|
|
42
45
|
import {
|
|
43
46
|
createPatientBill,
|
|
44
47
|
useBillableItems,
|
|
@@ -47,24 +50,16 @@ import {
|
|
|
47
50
|
usePaymentModes,
|
|
48
51
|
useVisitType,
|
|
49
52
|
} from './admit-deceased-person.resource';
|
|
50
|
-
import
|
|
51
|
-
import { deceasedPatientAdmitSchema } from '../../schemas';
|
|
52
|
-
import { ConfigObject } from '../../config-schema';
|
|
53
|
-
import { DeceasedPatientHeader } from '../../deceased-patient-header/deceased-patient-header.component';
|
|
53
|
+
import classNames from 'classnames';
|
|
54
54
|
import { type MortuaryLocationResponse, type MortuaryPatient } from '../../types';
|
|
55
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
56
|
-
import { EmptyDataIllustration } from '@openmrs/esm-patient-common-lib';
|
|
57
|
-
import { PENDING_PAYMENT_STATUS } from '../../constants';
|
|
58
|
-
import { mutate } from 'swr';
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
interface AdmitDeceasedPersonProps {
|
|
57
|
+
closeWorkspace: () => void;
|
|
61
58
|
patientData: MortuaryPatient;
|
|
62
59
|
mortuaryLocation: MortuaryLocationResponse;
|
|
63
|
-
mutated;
|
|
60
|
+
mutated: () => void;
|
|
64
61
|
deceasedPatientUuid?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const MAX_RESULTS = 5;
|
|
62
|
+
}
|
|
68
63
|
|
|
69
64
|
const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
70
65
|
closeWorkspace,
|
|
@@ -76,48 +71,62 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
76
71
|
const { t } = useTranslation();
|
|
77
72
|
const isTablet = useLayoutType() === 'tablet';
|
|
78
73
|
const [searchTerm, setSearchTerm] = useState('');
|
|
79
|
-
const
|
|
74
|
+
const { time: defaultTime, period: defaultPeriod } = getCurrentTime();
|
|
75
|
+
const config = useConfig<ConfigObject>();
|
|
80
76
|
|
|
81
77
|
const { data: visitTypes, isLoading: isLoadingVisitTypes } = useVisitType();
|
|
82
|
-
const { lineItems, isLoading: isLoadingLineItems
|
|
83
|
-
const {
|
|
84
|
-
const { admitBody, errorFetchingEmrConfiguration, isLoadingEmrConfiguration } = useMortuaryOperation(
|
|
85
|
-
mortuaryLocation?.ward?.uuid,
|
|
86
|
-
);
|
|
78
|
+
const { lineItems, isLoading: isLoadingLineItems } = useBillableItems();
|
|
79
|
+
const { admitBody } = useMortuaryOperation(mortuaryLocation?.ward?.uuid);
|
|
87
80
|
|
|
88
81
|
const { cashPoints } = useCashPoint();
|
|
89
82
|
const cashPointUuid = cashPoints?.[0]?.uuid ?? '';
|
|
90
|
-
|
|
91
83
|
const patientUuid = patientData?.patient?.uuid || deceasedPatientUuid;
|
|
92
|
-
|
|
93
84
|
const { insuranceSchemes } = useConfig({ externalModuleName: '@kenyaemr/esm-billing-app' });
|
|
94
|
-
|
|
95
85
|
const { paymentModes, isLoading: isLoadingPaymentModes } = usePaymentModes();
|
|
86
|
+
const { currentProvider } = useSession();
|
|
96
87
|
|
|
97
|
-
const {
|
|
98
|
-
|
|
99
|
-
|
|
88
|
+
const {
|
|
89
|
+
morgueVisitTypeUuid,
|
|
90
|
+
morgueDepartmentServiceTypeUuid,
|
|
91
|
+
insurancepaymentModeUuid,
|
|
92
|
+
locationOfDeathTypesList,
|
|
93
|
+
deathConfirmationTypes,
|
|
94
|
+
deadBodyPreservationTypeUuid,
|
|
95
|
+
bodyEmbalmmentTypesUuid,
|
|
96
|
+
} = config;
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
revalidate: true,
|
|
103
|
-
});
|
|
104
|
-
};
|
|
98
|
+
const deceasedPatientAdmitSchema = useMemo(() => createDeceasedPatientAdmitSchema(config), [config]);
|
|
105
99
|
|
|
106
|
-
const
|
|
107
|
-
|
|
100
|
+
const getPlaceOfDeathCategory = (placeOfDeathValue: string) => {
|
|
101
|
+
const placeOfDeathItem = locationOfDeathTypesList.find((item) => item.concept === placeOfDeathValue);
|
|
102
|
+
return placeOfDeathItem?.label || '';
|
|
108
103
|
};
|
|
109
104
|
|
|
105
|
+
const hospitalDeathLabels = ['InPatient', 'Outpatient', 'Dead on arrival'];
|
|
106
|
+
const homeDeathLabel = 'Home';
|
|
107
|
+
const policeCaseDeathLabel = 'Unknown (Police case)';
|
|
108
|
+
|
|
110
109
|
const {
|
|
111
110
|
control,
|
|
112
111
|
watch,
|
|
113
112
|
handleSubmit,
|
|
114
113
|
formState: { errors, isDirty, isSubmitting },
|
|
115
|
-
} = useForm
|
|
114
|
+
} = useForm({
|
|
116
115
|
resolver: zodResolver(deceasedPatientAdmitSchema),
|
|
117
116
|
defaultValues: {
|
|
118
117
|
dateOfAdmission: new Date(),
|
|
118
|
+
placeOfDeath: '',
|
|
119
|
+
dateOfDeath: new Date(),
|
|
119
120
|
timeOfDeath: defaultTime,
|
|
120
121
|
period: defaultPeriod,
|
|
122
|
+
deathConfirmed: deathConfirmationTypes.find((type) => type.label === 'No')?.concept || '',
|
|
123
|
+
deathNotificationNumber: '',
|
|
124
|
+
attendingClinician: '',
|
|
125
|
+
doctorsRemarks: '',
|
|
126
|
+
causeOfDeath: patientData?.person?.person?.causeOfDeath?.display || '',
|
|
127
|
+
autopsyPermission: deathConfirmationTypes.find((type) => type.label === 'No')?.concept || '',
|
|
128
|
+
deadBodyPreservation: '',
|
|
129
|
+
bodyEmbalmentType: '',
|
|
121
130
|
tagNumber: '',
|
|
122
131
|
obNumber: '',
|
|
123
132
|
policeName: '',
|
|
@@ -125,25 +134,35 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
125
134
|
visitType: morgueVisitTypeUuid,
|
|
126
135
|
paymentMethod: '',
|
|
127
136
|
insuranceScheme: '',
|
|
128
|
-
dischargeArea: '',
|
|
129
137
|
policyNumber: '',
|
|
130
138
|
services: [],
|
|
131
139
|
availableCompartment: 0,
|
|
132
140
|
},
|
|
133
141
|
});
|
|
134
142
|
|
|
135
|
-
const
|
|
143
|
+
const placeOfDeath = watch('placeOfDeath');
|
|
144
|
+
const deathConfirmed = watch('deathConfirmed');
|
|
145
|
+
const deadBodyPreservation = watch('deadBodyPreservation');
|
|
136
146
|
const paymentMethodObservable = watch('paymentMethod');
|
|
147
|
+
const currentVisitType = visitTypes?.find((vt) => vt.uuid === morgueVisitTypeUuid);
|
|
148
|
+
|
|
149
|
+
const currentPlaceOfDeathLabel = getPlaceOfDeathCategory(placeOfDeath);
|
|
150
|
+
const isHospitalDeath = hospitalDeathLabels.includes(currentPlaceOfDeathLabel);
|
|
151
|
+
const isHomeDeath = currentPlaceOfDeathLabel === homeDeathLabel;
|
|
152
|
+
const isPoliceCaseDeath = currentPlaceOfDeathLabel === policeCaseDeathLabel;
|
|
153
|
+
|
|
154
|
+
const shouldShowDateTimeDeath = !isHomeDeath && placeOfDeath !== '';
|
|
155
|
+
|
|
156
|
+
const bodyEmbalmmentOption = deadBodyPreservationTypeUuid.find((type) => type.label === 'Body embalment');
|
|
157
|
+
const isBodyEmbalmmentSelected = deadBodyPreservation === bodyEmbalmmentOption?.concept;
|
|
137
158
|
|
|
138
159
|
const filteredBeds = useMemo(() => {
|
|
139
160
|
if (!mortuaryLocation?.bedLayouts) {
|
|
140
161
|
return [];
|
|
141
162
|
}
|
|
142
|
-
|
|
143
163
|
if (!searchTerm) {
|
|
144
164
|
return mortuaryLocation.bedLayouts;
|
|
145
165
|
}
|
|
146
|
-
|
|
147
166
|
return mortuaryLocation.bedLayouts.filter(
|
|
148
167
|
(bed) =>
|
|
149
168
|
bed.bedNumber.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
@@ -152,149 +171,65 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
152
171
|
);
|
|
153
172
|
}, [mortuaryLocation?.bedLayouts, searchTerm]);
|
|
154
173
|
|
|
155
|
-
const onSubmit = async (data
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
priceName: 'Default',
|
|
169
|
-
priceUuid: priceForPaymentMode ? priceForPaymentMode.uuid : '',
|
|
170
|
-
lineItemOrder: index,
|
|
171
|
-
paymentStatus: PENDING_PAYMENT_STATUS,
|
|
172
|
-
};
|
|
173
|
-
});
|
|
174
|
+
const onSubmit = async (data) => {
|
|
175
|
+
const serviceUuids = data.services;
|
|
176
|
+
const billableItems = lineItems
|
|
177
|
+
.filter((item) => serviceUuids.includes(item.uuid))
|
|
178
|
+
.map((item, index) => ({
|
|
179
|
+
billableService: item.uuid,
|
|
180
|
+
quantity: 1,
|
|
181
|
+
price: item.servicePrices[0]?.price || '0.000',
|
|
182
|
+
priceName: 'Default',
|
|
183
|
+
priceUuid: item.servicePrices[0]?.uuid || '',
|
|
184
|
+
lineItemOrder: index,
|
|
185
|
+
paymentStatus: 'PENDING',
|
|
186
|
+
}));
|
|
174
187
|
|
|
175
|
-
|
|
188
|
+
try {
|
|
189
|
+
if (isSubmitting) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const { admissionEncounter, compartment } = await admitBody(patientUuid, data);
|
|
176
193
|
|
|
177
|
-
|
|
194
|
+
if (admissionEncounter && compartment) {
|
|
195
|
+
showSnackbar({
|
|
196
|
+
title: t('admissionSuccess', 'Deceased Admission'),
|
|
197
|
+
subtitle: t('admissionSuccessMessage', 'Patient has been admitted to the mortuary successfully'),
|
|
198
|
+
kind: 'success',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const billPayload = {
|
|
203
|
+
lineItems: billableItems,
|
|
204
|
+
cashPoint: cashPointUuid,
|
|
205
|
+
patient: patientUuid,
|
|
206
|
+
status: 'PENDING',
|
|
207
|
+
payments: [],
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
await createPatientBill(billPayload);
|
|
178
211
|
showSnackbar({
|
|
179
|
-
title: t('
|
|
180
|
-
subtitle: t('
|
|
212
|
+
title: t('admissionBillSuccess', 'Bill creation'),
|
|
213
|
+
subtitle: t('admissionBillSuccessMessage', "Patient's bill has been created successfully"),
|
|
181
214
|
kind: 'success',
|
|
182
215
|
});
|
|
183
|
-
|
|
216
|
+
mutated();
|
|
217
|
+
closeWorkspace();
|
|
218
|
+
} catch (error) {
|
|
184
219
|
showSnackbar({
|
|
185
|
-
title: t('
|
|
186
|
-
subtitle: t(
|
|
187
|
-
'admissionError',
|
|
188
|
-
'An error has occurred while admitting deceased patient to the mortuary, Contact system administrator',
|
|
189
|
-
),
|
|
220
|
+
title: t('error', 'Error'),
|
|
221
|
+
subtitle: error?.message || t('unknownError', 'An unknown error occurred'),
|
|
190
222
|
kind: 'error',
|
|
191
|
-
isLowContrast: true,
|
|
192
223
|
});
|
|
193
224
|
}
|
|
194
|
-
|
|
195
|
-
const billPayload = {
|
|
196
|
-
lineItems: linesItems,
|
|
197
|
-
cashPoint: cashPointUuid,
|
|
198
|
-
patient: patientUuid,
|
|
199
|
-
status: PENDING_PAYMENT_STATUS,
|
|
200
|
-
payments: [],
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
await createPatientBill(billPayload).then(
|
|
204
|
-
() => {
|
|
205
|
-
showSnackbar({
|
|
206
|
-
title: t('patientBill', 'Patient Bill'),
|
|
207
|
-
subtitle: t('patientBillSuccess', 'Patient has been billed successfully'),
|
|
208
|
-
kind: 'success',
|
|
209
|
-
});
|
|
210
|
-
},
|
|
211
|
-
(error) => {
|
|
212
|
-
const errorMessage = JSON.stringify(error?.responseBody?.error?.message?.replace(/\[/g, '').replace(/\]/g, ''));
|
|
213
|
-
showSnackbar({
|
|
214
|
-
title: 'Patient Bill Error',
|
|
215
|
-
subtitle: `An error has occurred while creating patient bill, Contact system administrator quoting this error ${errorMessage}`,
|
|
216
|
-
kind: 'error',
|
|
217
|
-
isLowContrast: true,
|
|
218
|
-
});
|
|
219
|
-
},
|
|
220
|
-
);
|
|
221
|
-
mutated();
|
|
222
|
-
handleMutation();
|
|
223
|
-
closeWorkspace();
|
|
224
225
|
};
|
|
226
|
+
|
|
225
227
|
return (
|
|
226
228
|
<Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
|
|
227
229
|
<div className={styles.formContainer}>
|
|
228
230
|
<Stack gap={3}>
|
|
229
231
|
<DeceasedPatientHeader patientData={patientData} />
|
|
230
|
-
|
|
231
|
-
<FormGroup legendText="">
|
|
232
|
-
<Column>
|
|
233
|
-
<Controller
|
|
234
|
-
name="dateOfAdmission"
|
|
235
|
-
control={control}
|
|
236
|
-
render={({ field }) => (
|
|
237
|
-
<DatePicker
|
|
238
|
-
datePickerType="single"
|
|
239
|
-
className={styles.formAdmissionDatepicker}
|
|
240
|
-
onChange={(event) => {
|
|
241
|
-
if (event.length) {
|
|
242
|
-
field.onChange(event[0]);
|
|
243
|
-
}
|
|
244
|
-
}}
|
|
245
|
-
value={field.value ? new Date(field.value) : null}>
|
|
246
|
-
<DatePickerInput
|
|
247
|
-
id="date-of-admission"
|
|
248
|
-
placeholder="mm/dd/yyyy"
|
|
249
|
-
labelText={t('dateOfAdmission', 'Date of admission')}
|
|
250
|
-
invalid={!!errors.dateOfAdmission}
|
|
251
|
-
invalidText={errors.dateOfAdmission?.message}
|
|
252
|
-
/>
|
|
253
|
-
</DatePicker>
|
|
254
|
-
)}
|
|
255
|
-
/>
|
|
256
|
-
</Column>
|
|
257
|
-
</FormGroup>
|
|
258
|
-
</ResponsiveWrapper>
|
|
259
|
-
<ResponsiveWrapper>
|
|
260
|
-
<FormGroup legendText="">
|
|
261
|
-
<Column>
|
|
262
|
-
<div className={styles.dateTimeSection}>
|
|
263
|
-
<ResponsiveWrapper>
|
|
264
|
-
<Controller
|
|
265
|
-
name="timeOfDeath"
|
|
266
|
-
control={control}
|
|
267
|
-
render={({ field }) => {
|
|
268
|
-
return (
|
|
269
|
-
<TimePicker
|
|
270
|
-
{...field}
|
|
271
|
-
id="time-of-death-picker"
|
|
272
|
-
labelText={t('timeAdmission', 'Time of admission*')}
|
|
273
|
-
className={styles.formAdmissionTimepicker}
|
|
274
|
-
invalid={!!errors.timeOfDeath}
|
|
275
|
-
invalidText={errors.timeOfDeath?.message}
|
|
276
|
-
/>
|
|
277
|
-
);
|
|
278
|
-
}}
|
|
279
|
-
/>
|
|
280
|
-
<Controller
|
|
281
|
-
name="period"
|
|
282
|
-
control={control}
|
|
283
|
-
render={({ field }) => (
|
|
284
|
-
<TimePickerSelect
|
|
285
|
-
{...field}
|
|
286
|
-
className={styles.formDeathTimepickerSelector}
|
|
287
|
-
id="time-picker-select">
|
|
288
|
-
<SelectItem value="AM" text="AM" />
|
|
289
|
-
<SelectItem value="PM" text="PM" />
|
|
290
|
-
</TimePickerSelect>
|
|
291
|
-
)}
|
|
292
|
-
/>
|
|
293
|
-
</ResponsiveWrapper>
|
|
294
|
-
</div>
|
|
295
|
-
</Column>
|
|
296
|
-
</FormGroup>
|
|
297
|
-
</ResponsiveWrapper>
|
|
232
|
+
|
|
298
233
|
<ResponsiveWrapper>
|
|
299
234
|
<FormGroup legendText="">
|
|
300
235
|
<Controller
|
|
@@ -303,85 +238,66 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
303
238
|
render={({ field }) => (
|
|
304
239
|
<TextInput
|
|
305
240
|
{...field}
|
|
306
|
-
className={styles.sectionField}
|
|
307
241
|
id="visit-type"
|
|
308
|
-
type
|
|
309
|
-
labelText={t('visitType', 'Visit type')}
|
|
242
|
+
labelText={t('visitType', 'Visit type *')}
|
|
310
243
|
value={currentVisitType?.display || ''}
|
|
244
|
+
readOnly
|
|
311
245
|
invalid={!!errors.visitType}
|
|
312
246
|
invalidText={errors.visitType?.message}
|
|
313
|
-
disabled={isLoadingVisitTypes}
|
|
314
|
-
readOnly
|
|
315
247
|
/>
|
|
316
248
|
)}
|
|
317
249
|
/>
|
|
318
250
|
</FormGroup>
|
|
319
251
|
</ResponsiveWrapper>
|
|
252
|
+
|
|
320
253
|
<ResponsiveWrapper>
|
|
321
|
-
<FormGroup legendText=
|
|
322
|
-
<
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
<
|
|
331
|
-
{
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
<
|
|
338
|
-
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/>
|
|
352
|
-
</div>
|
|
353
|
-
<div className={styles.compartmentTags}>
|
|
354
|
-
{bed.bedType && (
|
|
355
|
-
<Tag type={bed.bedType?.display === 'VIP' ? 'green' : 'blue'} size="sm">
|
|
356
|
-
{bed.bedType?.displayName || ''}
|
|
357
|
-
</Tag>
|
|
358
|
-
)}
|
|
359
|
-
<Tag type={bed.status === 'AVAILABLE' ? 'green' : 'red'} size="sm">
|
|
360
|
-
{bed?.status || ''}
|
|
361
|
-
</Tag>
|
|
362
|
-
</div>
|
|
363
|
-
</div>
|
|
364
|
-
))}
|
|
254
|
+
<FormGroup legendText={t('assignCompartment', 'Assign compartment *')}>
|
|
255
|
+
<Search
|
|
256
|
+
onChange={(e) => setSearchTerm(e.target.value)}
|
|
257
|
+
placeholder={t('searchForCompartments', 'Search for a compartment')}
|
|
258
|
+
value={searchTerm}
|
|
259
|
+
labelText=""
|
|
260
|
+
/>
|
|
261
|
+
<div className={styles.compartmentListContainer}>
|
|
262
|
+
{filteredBeds.length > 0 ? (
|
|
263
|
+
<Controller
|
|
264
|
+
control={control}
|
|
265
|
+
name="availableCompartment"
|
|
266
|
+
render={({ field }) => (
|
|
267
|
+
<div className={styles.radioButtonGroup}>
|
|
268
|
+
{filteredBeds.map((bed) => (
|
|
269
|
+
<div key={bed.bedId} className={styles.compartmentOption}>
|
|
270
|
+
<RadioButton
|
|
271
|
+
id={`compartment-${bed.bedId}`}
|
|
272
|
+
labelText={bed.bedNumber}
|
|
273
|
+
value={bed.bedId}
|
|
274
|
+
checked={field.value === bed.bedId}
|
|
275
|
+
onChange={() => field.onChange(bed.bedId)}
|
|
276
|
+
/>
|
|
277
|
+
<div className={styles.compartmentTags}>
|
|
278
|
+
<Tag type={bed.bedType?.display === 'VIP' ? 'green' : 'blue'} size="sm">
|
|
279
|
+
{bed.bedType?.displayName || ''}
|
|
280
|
+
</Tag>
|
|
281
|
+
<Tag type={bed.status === 'AVAILABLE' ? 'green' : 'red'} size="sm">
|
|
282
|
+
{bed?.status || ''}
|
|
283
|
+
</Tag>
|
|
365
284
|
</div>
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
) : (
|
|
370
|
-
<Layer>
|
|
371
|
-
<Tile className={styles.emptyStateTile}>
|
|
372
|
-
<EmptyDataIllustration />
|
|
373
|
-
<p className={styles.emptyStateContent}>
|
|
374
|
-
{t('noCompartmentsFound', 'No compartments found')}
|
|
375
|
-
</p>
|
|
376
|
-
</Tile>
|
|
377
|
-
</Layer>
|
|
285
|
+
</div>
|
|
286
|
+
))}
|
|
287
|
+
</div>
|
|
378
288
|
)}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
289
|
+
/>
|
|
290
|
+
) : (
|
|
291
|
+
<Layer>
|
|
292
|
+
<Tile className={styles.emptyStateTile}>
|
|
293
|
+
<p className={styles.emptyStateContent}>{t('noCompartmentsFound', 'No compartments found')}</p>
|
|
294
|
+
</Tile>
|
|
295
|
+
</Layer>
|
|
383
296
|
)}
|
|
384
297
|
</div>
|
|
298
|
+
{errors.availableCompartment && (
|
|
299
|
+
<p className={styles.invalidText}>{errors.availableCompartment.message}</p>
|
|
300
|
+
)}
|
|
385
301
|
</FormGroup>
|
|
386
302
|
</ResponsiveWrapper>
|
|
387
303
|
|
|
@@ -401,8 +317,10 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
401
317
|
id="paymentMethods"
|
|
402
318
|
items={paymentModes.map((mode) => mode.uuid)}
|
|
403
319
|
itemToString={(item) => paymentModes.find((mode) => mode.uuid === item)?.name ?? ''}
|
|
404
|
-
titleText={t('selectPaymentMethod', 'Select payment method')}
|
|
405
|
-
label={t('selectPaymentMethod', 'Select payment method')}
|
|
320
|
+
titleText={t('selectPaymentMethod', 'Select payment method *')}
|
|
321
|
+
label={t('selectPaymentMethod', 'Select payment method *')}
|
|
322
|
+
invalid={!!errors.paymentMethod}
|
|
323
|
+
invalidText={errors.paymentMethod?.message}
|
|
406
324
|
/>
|
|
407
325
|
)}
|
|
408
326
|
/>
|
|
@@ -410,6 +328,7 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
410
328
|
</Column>
|
|
411
329
|
</FormGroup>
|
|
412
330
|
</ResponsiveWrapper>
|
|
331
|
+
|
|
413
332
|
{paymentMethodObservable === insurancepaymentModeUuid && (
|
|
414
333
|
<>
|
|
415
334
|
<Column>
|
|
@@ -423,7 +342,7 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
423
342
|
id="insurance-scheme"
|
|
424
343
|
items={insuranceSchemes}
|
|
425
344
|
itemToString={(item) => (item ? item.toString() : '')}
|
|
426
|
-
titleText={t('insuranceScheme', 'Insurance scheme')}
|
|
345
|
+
titleText={t('insuranceScheme', 'Insurance scheme *')}
|
|
427
346
|
invalid={!!errors.insuranceScheme}
|
|
428
347
|
invalidText={errors.insuranceScheme?.message}
|
|
429
348
|
/>
|
|
@@ -436,11 +355,11 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
436
355
|
name="policyNumber"
|
|
437
356
|
render={({ field }) => (
|
|
438
357
|
<TextInput
|
|
358
|
+
{...field}
|
|
439
359
|
className={styles.sectionField}
|
|
440
|
-
onChange={(e) => field.onChange(e.target.value)}
|
|
441
360
|
id="policy-number"
|
|
442
361
|
type="text"
|
|
443
|
-
labelText={t('policyNumber', 'Policy number')}
|
|
362
|
+
labelText={t('policyNumber', 'Policy number *')}
|
|
444
363
|
placeholder={t('enterPolicyNumber', 'Enter policy number')}
|
|
445
364
|
invalid={!!errors.policyNumber}
|
|
446
365
|
invalidText={errors.policyNumber?.message}
|
|
@@ -450,6 +369,7 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
450
369
|
</Column>
|
|
451
370
|
</>
|
|
452
371
|
)}
|
|
372
|
+
|
|
453
373
|
{paymentMethodObservable && (
|
|
454
374
|
<Column>
|
|
455
375
|
<Controller
|
|
@@ -465,7 +385,7 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
465
385
|
<FilterableMultiSelect
|
|
466
386
|
id="billing-service"
|
|
467
387
|
className={styles.formAdmissionDatepicker}
|
|
468
|
-
titleText={t('searchServices', 'Search services')}
|
|
388
|
+
titleText={t('searchServices', 'Search services *')}
|
|
469
389
|
items={availableServices.map((service) => service.uuid)}
|
|
470
390
|
itemToString={(item) => availableServices.find((i) => i.uuid === item)?.name ?? ''}
|
|
471
391
|
onChange={({ selectedItems }) => {
|
|
@@ -492,6 +412,26 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
492
412
|
/>
|
|
493
413
|
</Column>
|
|
494
414
|
)}
|
|
415
|
+
<ResponsiveWrapper>
|
|
416
|
+
<Controller
|
|
417
|
+
name="placeOfDeath"
|
|
418
|
+
control={control}
|
|
419
|
+
render={({ field }) => (
|
|
420
|
+
<ComboBox
|
|
421
|
+
id="placeOfDeath"
|
|
422
|
+
items={locationOfDeathTypesList}
|
|
423
|
+
itemToString={(item) => item?.label || ''}
|
|
424
|
+
titleText={t('placeOfDeath', 'Place of Death *')}
|
|
425
|
+
placeholder={t('selectPlaceOfDeath', 'Select place of death')}
|
|
426
|
+
invalid={!!errors.placeOfDeath}
|
|
427
|
+
invalidText={errors.placeOfDeath?.message}
|
|
428
|
+
selectedItem={locationOfDeathTypesList.find((item) => item.concept === field.value) || null}
|
|
429
|
+
onChange={({ selectedItem }) => field.onChange(selectedItem?.concept || '')}
|
|
430
|
+
/>
|
|
431
|
+
)}
|
|
432
|
+
/>
|
|
433
|
+
</ResponsiveWrapper>
|
|
434
|
+
|
|
495
435
|
<ResponsiveWrapper>
|
|
496
436
|
<FormGroup legendText="">
|
|
497
437
|
<Column>
|
|
@@ -502,9 +442,8 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
502
442
|
<TextInput
|
|
503
443
|
{...field}
|
|
504
444
|
id="tagNumber"
|
|
505
|
-
|
|
506
|
-
placeholder={t('
|
|
507
|
-
labelText={t('tagNumber', 'Tag Number*')}
|
|
445
|
+
labelText={t('tagNumber', 'Tag Number *')}
|
|
446
|
+
placeholder={t('enterTagNumber', 'Enter tag number')}
|
|
508
447
|
invalid={!!errors.tagNumber}
|
|
509
448
|
invalidText={errors.tagNumber?.message}
|
|
510
449
|
/>
|
|
@@ -513,130 +452,361 @@ const AdmitDeceasedPerson: React.FC<AdmitDeceasedPersonProps> = ({
|
|
|
513
452
|
</Column>
|
|
514
453
|
</FormGroup>
|
|
515
454
|
</ResponsiveWrapper>
|
|
455
|
+
|
|
456
|
+
{shouldShowDateTimeDeath && (
|
|
457
|
+
<>
|
|
458
|
+
<ResponsiveWrapper>
|
|
459
|
+
<FormGroup legendText="">
|
|
460
|
+
<Column>
|
|
461
|
+
<Controller
|
|
462
|
+
name="dateOfAdmission"
|
|
463
|
+
control={control}
|
|
464
|
+
render={({ field }) => (
|
|
465
|
+
<DatePicker
|
|
466
|
+
datePickerType="single"
|
|
467
|
+
className={styles.formAdmissionDatepicker}
|
|
468
|
+
onChange={(event) => {
|
|
469
|
+
if (event.length) {
|
|
470
|
+
field.onChange(event[0]);
|
|
471
|
+
}
|
|
472
|
+
}}
|
|
473
|
+
value={field.value ? new Date(field.value) : null}>
|
|
474
|
+
<DatePickerInput
|
|
475
|
+
id="date-of-admission"
|
|
476
|
+
placeholder="mm/dd/yyyy"
|
|
477
|
+
labelText={t('dateOfAdmission', 'Date of admission *')}
|
|
478
|
+
invalid={!!errors.dateOfAdmission}
|
|
479
|
+
invalidText={errors.dateOfAdmission?.message}
|
|
480
|
+
/>
|
|
481
|
+
</DatePicker>
|
|
482
|
+
)}
|
|
483
|
+
/>
|
|
484
|
+
</Column>
|
|
485
|
+
</FormGroup>
|
|
486
|
+
</ResponsiveWrapper>
|
|
487
|
+
<ResponsiveWrapper>
|
|
488
|
+
<FormGroup legendText="">
|
|
489
|
+
<Column>
|
|
490
|
+
<div className={styles.dateTimeSection}>
|
|
491
|
+
<ResponsiveWrapper>
|
|
492
|
+
<Controller
|
|
493
|
+
name="timeOfDeath"
|
|
494
|
+
control={control}
|
|
495
|
+
render={({ field }) => {
|
|
496
|
+
return (
|
|
497
|
+
<TimePicker
|
|
498
|
+
{...field}
|
|
499
|
+
id="time-of-death-picker"
|
|
500
|
+
labelText={t('timeAdmission', 'Time of admission *')}
|
|
501
|
+
className={styles.formAdmissionTimepicker}
|
|
502
|
+
invalid={!!errors.timeOfDeath}
|
|
503
|
+
invalidText={errors.timeOfDeath?.message}
|
|
504
|
+
/>
|
|
505
|
+
);
|
|
506
|
+
}}
|
|
507
|
+
/>
|
|
508
|
+
<Controller
|
|
509
|
+
name="period"
|
|
510
|
+
control={control}
|
|
511
|
+
render={({ field }) => (
|
|
512
|
+
<TimePickerSelect
|
|
513
|
+
{...field}
|
|
514
|
+
className={styles.formDeathTimepickerSelector}
|
|
515
|
+
id="time-picker-select">
|
|
516
|
+
<SelectItem value="AM" text="AM" />
|
|
517
|
+
<SelectItem value="PM" text="PM" />
|
|
518
|
+
</TimePickerSelect>
|
|
519
|
+
)}
|
|
520
|
+
/>
|
|
521
|
+
</ResponsiveWrapper>
|
|
522
|
+
</div>
|
|
523
|
+
</Column>
|
|
524
|
+
</FormGroup>
|
|
525
|
+
</ResponsiveWrapper>
|
|
526
|
+
</>
|
|
527
|
+
)}
|
|
528
|
+
|
|
529
|
+
<ResponsiveWrapper>
|
|
530
|
+
<FormGroup legendText={t('deathConfirmation', 'Death confirmed *')}>
|
|
531
|
+
<Controller
|
|
532
|
+
name="deathConfirmed"
|
|
533
|
+
control={control}
|
|
534
|
+
render={({ field }) => {
|
|
535
|
+
const yesOption = deathConfirmationTypes.find((type) => type.label === 'Yes');
|
|
536
|
+
const noOption = deathConfirmationTypes.find((type) => type.label === 'No');
|
|
537
|
+
|
|
538
|
+
return (
|
|
539
|
+
<RadioButtonGroup
|
|
540
|
+
name="deathConfirmed"
|
|
541
|
+
orientation="vertical"
|
|
542
|
+
value={field.value}
|
|
543
|
+
onChange={field.onChange}
|
|
544
|
+
invalid={!!errors.deathConfirmed}
|
|
545
|
+
invalidText={errors.deathConfirmed?.message}>
|
|
546
|
+
<RadioButton
|
|
547
|
+
className={styles.radioButton}
|
|
548
|
+
value={yesOption?.concept}
|
|
549
|
+
labelText={t('yes', 'Yes')}
|
|
550
|
+
/>
|
|
551
|
+
<RadioButton value={noOption?.concept} labelText={t('no', 'No')} />
|
|
552
|
+
</RadioButtonGroup>
|
|
553
|
+
);
|
|
554
|
+
}}
|
|
555
|
+
/>
|
|
556
|
+
</FormGroup>
|
|
557
|
+
</ResponsiveWrapper>
|
|
558
|
+
|
|
516
559
|
<ResponsiveWrapper>
|
|
517
560
|
<FormGroup legendText="">
|
|
518
561
|
<Column>
|
|
519
562
|
<Controller
|
|
520
|
-
name="
|
|
563
|
+
name="deathNotificationNumber"
|
|
521
564
|
control={control}
|
|
522
565
|
render={({ field }) => (
|
|
523
566
|
<TextInput
|
|
524
567
|
{...field}
|
|
525
|
-
id="
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
invalid={!!errors.dischargeArea}
|
|
530
|
-
invalidText={errors.dischargeArea?.message}
|
|
568
|
+
id="deathNotificationNumber"
|
|
569
|
+
labelText={t('deathNotificationNumber', 'Death Notification Number')}
|
|
570
|
+
invalid={!!errors.deathNotificationNumber}
|
|
571
|
+
invalidText={errors.deathNotificationNumber?.message}
|
|
531
572
|
/>
|
|
532
573
|
)}
|
|
533
574
|
/>
|
|
534
575
|
</Column>
|
|
535
576
|
</FormGroup>
|
|
536
577
|
</ResponsiveWrapper>
|
|
578
|
+
|
|
579
|
+
{isHospitalDeath && (
|
|
580
|
+
<>
|
|
581
|
+
<ResponsiveWrapper>
|
|
582
|
+
<FormGroup legendText="">
|
|
583
|
+
<Column>
|
|
584
|
+
<Controller
|
|
585
|
+
name="attendingClinician"
|
|
586
|
+
control={control}
|
|
587
|
+
render={({ field }) => (
|
|
588
|
+
<TextInput
|
|
589
|
+
{...field}
|
|
590
|
+
id="attendingClinician"
|
|
591
|
+
labelText={t('attendingClinician', 'Attending clinician/Doctor *')}
|
|
592
|
+
invalid={!!errors.attendingClinician}
|
|
593
|
+
invalidText={errors.attendingClinician?.message}
|
|
594
|
+
/>
|
|
595
|
+
)}
|
|
596
|
+
/>
|
|
597
|
+
</Column>
|
|
598
|
+
</FormGroup>
|
|
599
|
+
</ResponsiveWrapper>
|
|
600
|
+
|
|
601
|
+
<ResponsiveWrapper>
|
|
602
|
+
<FormGroup legendText="">
|
|
603
|
+
<Column>
|
|
604
|
+
<Controller
|
|
605
|
+
name="doctorsRemarks"
|
|
606
|
+
control={control}
|
|
607
|
+
render={({ field }) => (
|
|
608
|
+
<TextArea
|
|
609
|
+
{...field}
|
|
610
|
+
id="doctorsRemarks"
|
|
611
|
+
labelText={t('doctorsRemarks', "Doctor's remarks *")}
|
|
612
|
+
invalid={!!errors.doctorsRemarks}
|
|
613
|
+
invalidText={errors.doctorsRemarks?.message}
|
|
614
|
+
/>
|
|
615
|
+
)}
|
|
616
|
+
/>
|
|
617
|
+
</Column>
|
|
618
|
+
</FormGroup>
|
|
619
|
+
</ResponsiveWrapper>
|
|
620
|
+
</>
|
|
621
|
+
)}
|
|
622
|
+
|
|
537
623
|
<ResponsiveWrapper>
|
|
538
624
|
<FormGroup legendText="">
|
|
539
625
|
<Column>
|
|
540
|
-
<
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
626
|
+
<Controller
|
|
627
|
+
name="causeOfDeath"
|
|
628
|
+
control={control}
|
|
629
|
+
render={({ field }) => (
|
|
630
|
+
<TextArea
|
|
631
|
+
{...field}
|
|
632
|
+
id="causeOfDeath"
|
|
633
|
+
labelText={t('causeOfDeath', 'Cause of Death (if known)')}
|
|
634
|
+
invalid={!!errors.causeOfDeath}
|
|
635
|
+
invalidText={errors.causeOfDeath?.message}
|
|
636
|
+
/>
|
|
550
637
|
)}
|
|
551
638
|
/>
|
|
552
639
|
</Column>
|
|
553
640
|
</FormGroup>
|
|
554
641
|
</ResponsiveWrapper>
|
|
642
|
+
|
|
555
643
|
<ResponsiveWrapper>
|
|
556
|
-
<FormGroup legendText=
|
|
557
|
-
|
|
558
|
-
|
|
644
|
+
<FormGroup legendText={t('autopsyPermission', 'Autopsy Permission (if applicable) *')}>
|
|
645
|
+
<Controller
|
|
646
|
+
name="autopsyPermission"
|
|
647
|
+
control={control}
|
|
648
|
+
render={({ field }) => {
|
|
649
|
+
const yesOption = deathConfirmationTypes.find((type) => type.label === 'Yes');
|
|
650
|
+
const noOption = deathConfirmationTypes.find((type) => type.label === 'No');
|
|
651
|
+
|
|
652
|
+
return (
|
|
653
|
+
<RadioButtonGroup
|
|
654
|
+
name="autopsyPermission"
|
|
655
|
+
orientation="vertical"
|
|
656
|
+
value={field.value}
|
|
657
|
+
onChange={field.onChange}
|
|
658
|
+
invalid={!!errors.autopsyPermission}
|
|
659
|
+
invalidText={errors.autopsyPermission?.message}>
|
|
660
|
+
<RadioButton
|
|
661
|
+
className={styles.radioButton}
|
|
662
|
+
value={yesOption?.concept}
|
|
663
|
+
labelText={t('yes', 'Yes')}
|
|
664
|
+
/>
|
|
665
|
+
<RadioButton className={styles.radioButton} value={noOption?.concept} labelText={t('no', 'No')} />
|
|
666
|
+
</RadioButtonGroup>
|
|
667
|
+
);
|
|
668
|
+
}}
|
|
669
|
+
/>
|
|
670
|
+
</FormGroup>
|
|
671
|
+
</ResponsiveWrapper>
|
|
672
|
+
|
|
673
|
+
<ResponsiveWrapper>
|
|
674
|
+
<FormGroup legendText={t('deadBodyPreservation', 'Dead Body preservation')}>
|
|
675
|
+
<Controller
|
|
676
|
+
name="deadBodyPreservation"
|
|
677
|
+
control={control}
|
|
678
|
+
render={({ field }) => (
|
|
679
|
+
<RadioButtonGroup
|
|
680
|
+
name="deadBodyPreservation"
|
|
681
|
+
orientation="vertical"
|
|
682
|
+
value={field.value}
|
|
683
|
+
onChange={field.onChange}
|
|
684
|
+
invalid={!!errors.deadBodyPreservation}
|
|
685
|
+
invalidText={errors.deadBodyPreservation?.message}>
|
|
686
|
+
{deadBodyPreservationTypeUuid.map((preservationType) => (
|
|
687
|
+
<RadioButton
|
|
688
|
+
key={preservationType.concept}
|
|
689
|
+
value={preservationType.concept}
|
|
690
|
+
className={styles.radioButton}
|
|
691
|
+
labelText={t(preservationType.label.toLowerCase().replace(' ', ''), preservationType.label)}
|
|
692
|
+
/>
|
|
693
|
+
))}
|
|
694
|
+
</RadioButtonGroup>
|
|
695
|
+
)}
|
|
696
|
+
/>
|
|
697
|
+
</FormGroup>
|
|
698
|
+
</ResponsiveWrapper>
|
|
699
|
+
|
|
700
|
+
{isBodyEmbalmmentSelected && (
|
|
701
|
+
<ResponsiveWrapper>
|
|
702
|
+
<FormGroup legendText={t('bodyEmbalmentType', 'Body embalment types *')}>
|
|
703
|
+
<Controller
|
|
704
|
+
name="bodyEmbalmentType"
|
|
705
|
+
control={control}
|
|
706
|
+
render={({ field }) => (
|
|
707
|
+
<RadioButtonGroup
|
|
708
|
+
name="bodyEmbalmentType"
|
|
709
|
+
orientation="vertical"
|
|
710
|
+
value={field.value}
|
|
711
|
+
onChange={field.onChange}
|
|
712
|
+
invalid={!!errors.bodyEmbalmentType}
|
|
713
|
+
invalidText={errors.bodyEmbalmentType?.message}>
|
|
714
|
+
{bodyEmbalmmentTypesUuid.map((embalmmentType) => (
|
|
715
|
+
<RadioButton
|
|
716
|
+
key={embalmmentType.concept}
|
|
717
|
+
className={styles.radioButton}
|
|
718
|
+
value={embalmmentType.concept}
|
|
719
|
+
labelText={t(embalmmentType.label.toLowerCase(), embalmmentType.label)}
|
|
720
|
+
/>
|
|
721
|
+
))}
|
|
722
|
+
</RadioButtonGroup>
|
|
723
|
+
)}
|
|
724
|
+
/>
|
|
725
|
+
</FormGroup>
|
|
726
|
+
</ResponsiveWrapper>
|
|
727
|
+
)}
|
|
728
|
+
|
|
729
|
+
{isPoliceCaseDeath && (
|
|
730
|
+
<>
|
|
731
|
+
<ResponsiveWrapper>
|
|
732
|
+
<FormGroup legendText="">
|
|
559
733
|
<Column>
|
|
560
734
|
<Controller
|
|
561
|
-
name="
|
|
735
|
+
name="policeName"
|
|
562
736
|
control={control}
|
|
563
737
|
render={({ field }) => (
|
|
564
738
|
<TextInput
|
|
565
739
|
{...field}
|
|
566
|
-
id="
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
invalid={!!errors.obNumber}
|
|
571
|
-
invalidText={errors.obNumber?.message}
|
|
740
|
+
id="policeName"
|
|
741
|
+
labelText={t('policeName', 'Police name *')}
|
|
742
|
+
invalid={!!errors.policeName}
|
|
743
|
+
invalidText={errors.policeName?.message}
|
|
572
744
|
/>
|
|
573
745
|
)}
|
|
574
746
|
/>
|
|
575
747
|
</Column>
|
|
748
|
+
</FormGroup>
|
|
749
|
+
</ResponsiveWrapper>
|
|
750
|
+
|
|
751
|
+
<ResponsiveWrapper>
|
|
752
|
+
<FormGroup legendText="">
|
|
576
753
|
<Column>
|
|
577
754
|
<Controller
|
|
578
|
-
name="
|
|
755
|
+
name="policeIDNo"
|
|
579
756
|
control={control}
|
|
580
757
|
render={({ field }) => (
|
|
581
758
|
<TextInput
|
|
582
759
|
{...field}
|
|
583
|
-
id="
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
invalid={!!errors.policeName}
|
|
588
|
-
invalidText={errors.policeName?.message}
|
|
760
|
+
id="policeIDNo"
|
|
761
|
+
labelText={t('policeIDNo', 'Police ID number *')}
|
|
762
|
+
invalid={!!errors.policeIDNo}
|
|
763
|
+
invalidText={errors.policeIDNo?.message}
|
|
589
764
|
/>
|
|
590
765
|
)}
|
|
591
766
|
/>
|
|
592
767
|
</Column>
|
|
768
|
+
</FormGroup>
|
|
769
|
+
</ResponsiveWrapper>
|
|
770
|
+
|
|
771
|
+
<ResponsiveWrapper>
|
|
772
|
+
<FormGroup legendText="">
|
|
593
773
|
<Column>
|
|
594
774
|
<Controller
|
|
595
|
-
name="
|
|
775
|
+
name="obNumber"
|
|
596
776
|
control={control}
|
|
597
777
|
render={({ field }) => (
|
|
598
778
|
<TextInput
|
|
599
779
|
{...field}
|
|
600
|
-
id="
|
|
601
|
-
|
|
602
|
-
placeholder={t('
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
invalidText={errors.policeIDNo?.message}
|
|
780
|
+
id="obNumber"
|
|
781
|
+
labelText={t('obNumber', 'OB Number *')}
|
|
782
|
+
placeholder={t('enterObNumber', 'Enter OB number')}
|
|
783
|
+
invalid={!!errors.obNumber}
|
|
784
|
+
invalidText={errors.obNumber?.message}
|
|
606
785
|
/>
|
|
607
786
|
)}
|
|
608
787
|
/>
|
|
609
788
|
</Column>
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
</FormGroup>
|
|
622
|
-
</ResponsiveWrapper>
|
|
789
|
+
</FormGroup>
|
|
790
|
+
</ResponsiveWrapper>
|
|
791
|
+
</>
|
|
792
|
+
)}
|
|
793
|
+
<FormGroup
|
|
794
|
+
className={styles.supportingDocuments}
|
|
795
|
+
legendText={t('supportingDocuments', 'Supporting Documents')}>
|
|
796
|
+
<ResponsiveWrapper>
|
|
797
|
+
<ExtensionSlot name="patient-chart-attachments-dashboard-slot" state={{ patientUuid }} />
|
|
798
|
+
</ResponsiveWrapper>
|
|
799
|
+
</FormGroup>
|
|
623
800
|
</Stack>
|
|
624
801
|
</div>
|
|
625
802
|
|
|
626
|
-
<ButtonSet
|
|
627
|
-
|
|
628
|
-
[styles.tablet]: isTablet,
|
|
629
|
-
[styles.desktop]: !isTablet,
|
|
630
|
-
})}>
|
|
631
|
-
<Button className={styles.buttonContainer} kind="secondary" onClick={() => closeWorkspace()}>
|
|
803
|
+
<ButtonSet className={classNames(styles.buttonSet, { [styles.tablet]: isTablet })}>
|
|
804
|
+
<Button kind="secondary" onClick={closeWorkspace}>
|
|
632
805
|
{t('cancel', 'Cancel')}
|
|
633
806
|
</Button>
|
|
634
|
-
<Button
|
|
807
|
+
<Button kind="primary" type="submit" disabled={isSubmitting || !isDirty}>
|
|
635
808
|
{isSubmitting ? (
|
|
636
|
-
<
|
|
637
|
-
{t('submitting', 'Submitting' + '...')}
|
|
638
|
-
<InlineLoading status="active" iconDescription="Loading" />
|
|
639
|
-
</span>
|
|
809
|
+
<InlineLoading description={t('submitting', 'Submitting...')} />
|
|
640
810
|
) : (
|
|
641
811
|
t('saveAndClose', 'Save & close')
|
|
642
812
|
)}
|