@kenyaemr/esm-morgue-app 5.4.1-pre.1842 → 5.4.1-pre.1850
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 +85 -22
- package/dist/160.js +1 -0
- package/dist/160.js.map +1 -0
- package/dist/195.js +1 -0
- package/dist/195.js.map +1 -0
- package/dist/240.js +1 -0
- package/dist/240.js.map +1 -0
- package/dist/282.js +1 -0
- package/dist/282.js.map +1 -0
- package/dist/300.js +1 -1
- package/dist/{561.js → 521.js} +1 -1
- package/dist/521.js.map +1 -0
- package/dist/527.js +1 -0
- package/dist/527.js.map +1 -0
- package/dist/596.js +1 -0
- package/dist/596.js.map +1 -0
- package/dist/652.js +1 -1
- package/dist/652.js.map +1 -1
- package/dist/659.js +2 -0
- package/dist/659.js.map +1 -0
- package/dist/675.js +2 -0
- package/dist/{485.js.map → 675.js.map} +1 -1
- package/dist/730.js +1 -0
- package/dist/730.js.map +1 -0
- package/dist/755.js +1 -0
- package/dist/755.js.map +1 -0
- package/dist/795.js +1 -0
- package/dist/795.js.map +1 -0
- package/dist/818.js +1 -0
- package/dist/818.js.map +1 -0
- package/dist/{942.js → 870.js} +1 -1
- package/dist/870.js.map +1 -0
- package/dist/909.js +2 -0
- package/dist/909.js.map +1 -0
- package/dist/926.js +1 -1
- package/dist/926.js.map +1 -1
- package/dist/929.js +1 -0
- package/dist/929.js.map +1 -0
- package/dist/960.js +1 -0
- package/dist/960.js.map +1 -0
- package/dist/kenyaemr-esm-morgue-app.js +1 -1
- package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +371 -127
- package/dist/kenyaemr-esm-morgue-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/autosuggest/autosuggest.component.tsx +162 -0
- package/src/autosuggest/autosuggest.scss +61 -0
- package/src/autosuggest/patient-search-info.component.tsx +75 -0
- package/src/autosuggest/patient-search-info.scss +62 -0
- package/src/autosuggest/search-empty-state.component.tsx +21 -0
- package/src/autosuggest/search-empty-state.scss +18 -0
- package/src/card/avail-compartment.compartment.tsx +40 -41
- package/src/card/compartment-view.compartment.tsx +37 -14
- package/src/card/compartment.scss +18 -13
- package/src/card/compartmentSharing.component.tsx +21 -0
- package/src/card/compartmentSharing.scss +24 -0
- package/src/card/empty-compartment.component.tsx +11 -7
- package/src/card/empty-compartment.scss +61 -0
- package/src/component/deceasedInfo/deceased-info.component.tsx +1 -1
- package/src/component/main.component.tsx +1 -7
- package/src/component/next-of-kin-details/nextOfKinDetails.component.tsx +50 -0
- package/src/component/next-of-kin-details/nextOfKinDetails.scss +37 -0
- package/src/config-schema.ts +30 -22
- package/src/extension/actionButton.component.tsx +74 -0
- package/src/extension/actionButton.scss +69 -0
- package/src/extension/deceasedInfoBanner.component.tsx +57 -0
- package/src/hook/useAdmitPatient.ts +285 -0
- package/src/hook/useDeceasedPatients.ts +12 -0
- package/src/hook/useDischargedPatient.ts +55 -0
- package/src/hook/useMorgue.resource.ts +11 -120
- package/src/hook/useMortuaryAdmissionLocation.ts +64 -0
- package/src/hook/usePersonAttributes.ts +65 -0
- package/src/index.ts +4 -0
- package/src/routes.json +24 -7
- package/src/tables/admitted-queue.component.tsx +17 -21
- package/src/tables/discharge-queue.component.tsx +33 -27
- package/src/tables/generic-table.component.tsx +44 -19
- package/src/tabs/tabs.component.tsx +36 -16
- package/src/tabs/tabs.scss +3 -186
- package/src/types/index.ts +291 -9
- package/src/utils/utils.ts +55 -4
- package/src/workspaces/admit-body.scss +46 -0
- package/src/workspaces/admit-body.workspace.tsx +79 -0
- package/src/workspaces/discharge-body.scss +2 -2
- package/src/workspaces/discharge-body.workspace.tsx +157 -101
- package/src/workspaces/patientAdditionalInfoForm.workspace.tsx +141 -218
- package/src/workspaces/swap-unit.scss +46 -0
- package/src/workspaces/swap-unit.workspace.tsx +168 -0
- package/translations/en.json +22 -7
- package/dist/340.js +0 -1
- package/dist/340.js.map +0 -1
- package/dist/38.js +0 -1
- package/dist/38.js.map +0 -1
- package/dist/485.js +0 -2
- package/dist/553.js +0 -1
- package/dist/553.js.map +0 -1
- package/dist/561.js.map +0 -1
- package/dist/592.js +0 -2
- package/dist/592.js.map +0 -1
- package/dist/759.js +0 -1
- package/dist/759.js.map +0 -1
- package/dist/942.js.map +0 -1
- package/dist/987.js +0 -2
- package/dist/987.js.map +0 -1
- package/src/component/deceasedInfo/deceased-header.component.tsx +0 -37
- package/src/tables/waiting-queue.component.tsx +0 -91
- /package/dist/{987.js.LICENSE.txt → 659.js.LICENSE.txt} +0 -0
- /package/dist/{485.js.LICENSE.txt → 675.js.LICENSE.txt} +0 -0
- /package/dist/{592.js.LICENSE.txt → 909.js.LICENSE.txt} +0 -0
|
@@ -1,58 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button,
|
|
3
3
|
ButtonSet,
|
|
4
|
-
ComboBox,
|
|
5
4
|
Column,
|
|
5
|
+
ComboBox,
|
|
6
6
|
DatePicker,
|
|
7
7
|
DatePickerInput,
|
|
8
|
+
Dropdown,
|
|
9
|
+
FilterableMultiSelect,
|
|
8
10
|
Form,
|
|
9
|
-
|
|
11
|
+
Layer,
|
|
12
|
+
RadioButton,
|
|
13
|
+
RadioButtonGroup,
|
|
14
|
+
Search,
|
|
15
|
+
SelectItem,
|
|
16
|
+
InlineNotification,
|
|
10
17
|
Stack,
|
|
11
18
|
TextInput,
|
|
19
|
+
Tile,
|
|
12
20
|
TimePicker,
|
|
21
|
+
InlineLoading,
|
|
13
22
|
TimePickerSelect,
|
|
14
|
-
SelectItem,
|
|
15
|
-
RadioButtonGroup,
|
|
16
|
-
RadioButton,
|
|
17
|
-
Layer,
|
|
18
|
-
Tile,
|
|
19
|
-
Search,
|
|
20
|
-
FilterableMultiSelect,
|
|
21
|
-
Dropdown,
|
|
22
23
|
} from '@carbon/react';
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
useConfig,
|
|
27
|
-
useSession,
|
|
28
|
-
showSnackbar,
|
|
29
|
-
formatTime,
|
|
30
|
-
parseDate,
|
|
31
|
-
} from '@openmrs/esm-framework';
|
|
32
|
-
import React, { useMemo, useState, useEffect } from 'react';
|
|
33
|
-
import { useTranslation } from 'react-i18next';
|
|
24
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
25
|
+
import { ResponsiveWrapper, restBaseUrl, showSnackbar, useConfig } from '@openmrs/esm-framework';
|
|
26
|
+
import { EmptyDataIllustration } from '@openmrs/esm-patient-common-lib';
|
|
34
27
|
import classNames from 'classnames';
|
|
35
|
-
import
|
|
28
|
+
import fuzzy from 'fuzzy';
|
|
29
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
30
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
31
|
+
import { useTranslation } from 'react-i18next';
|
|
32
|
+
import { mutate } from 'swr';
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { ConfigObject } from '../config-schema';
|
|
35
|
+
import { PENDING_PAYMENT_STATUS } from '../constants';
|
|
36
36
|
import {
|
|
37
37
|
createPatientBill,
|
|
38
|
-
startVisitWithEncounter,
|
|
39
38
|
useBillableItems,
|
|
40
39
|
useCashPoint,
|
|
41
|
-
useMorgueCompartment,
|
|
42
40
|
usePaymentModes,
|
|
43
41
|
useVisitType,
|
|
44
42
|
} from '../hook/useMorgue.resource';
|
|
45
|
-
import
|
|
46
|
-
import {
|
|
47
|
-
import
|
|
48
|
-
import {
|
|
49
|
-
import
|
|
50
|
-
import isEmpty from 'lodash-es/isEmpty';
|
|
51
|
-
import { ConfigObject } from '../config-schema';
|
|
52
|
-
import { PENDING_PAYMENT_STATUS } from '../constants';
|
|
53
|
-
import { mutate } from 'swr';
|
|
54
|
-
import dayjs from 'dayjs';
|
|
55
|
-
import DeceasedHeader from '../component/deceasedInfo/deceased-header.component';
|
|
43
|
+
import { useAdmissionLocation } from '../hook/useMortuaryAdmissionLocation';
|
|
44
|
+
import { getCurrentTime, patientInfoSchema } from '../utils/utils';
|
|
45
|
+
import styles from './patientAdditionalInfoForm.scss';
|
|
46
|
+
import { useMortuaryOperation } from '../hook/useAdmitPatient';
|
|
47
|
+
import DeceasedInfo from '../component/deceasedInfo/deceased-info.component';
|
|
56
48
|
|
|
57
49
|
interface PatientAdditionalInfoFormProps {
|
|
58
50
|
closeWorkspace: () => void;
|
|
@@ -61,58 +53,25 @@ interface PatientAdditionalInfoFormProps {
|
|
|
61
53
|
|
|
62
54
|
const MAX_RESULTS = 5;
|
|
63
55
|
|
|
64
|
-
const patientInfoSchema = z.object({
|
|
65
|
-
dateOfAdmission: z.date({ coerce: true }).refine((date) => !!date, 'Date of admission is required'),
|
|
66
|
-
timeOfDeath: z
|
|
67
|
-
.string()
|
|
68
|
-
.nonempty('Time of death is required')
|
|
69
|
-
.regex(/^(0[1-9]|1[0-2]):[0-5][0-9]\s?(AM|PM)$/i, 'Time of death must be in the format hh:mm AM/PM'),
|
|
70
|
-
tagNumber: z.string().nonempty('Tag number is required'),
|
|
71
|
-
obNumber: z.string().optional(),
|
|
72
|
-
policeName: z.string().optional(),
|
|
73
|
-
policeIDNo: z.string().optional(),
|
|
74
|
-
dischargeArea: z.string().optional(),
|
|
75
|
-
burialPermitNo: z.string().nonempty('Burial Permit is required'),
|
|
76
|
-
visitType: z.string().uuid('invalid visit type'),
|
|
77
|
-
availableCompartment: z.string(),
|
|
78
|
-
services: z.array(z.string().uuid('invalid service')).nonempty('Must select one service'),
|
|
79
|
-
paymentMethod: z.string().uuid('invalid payment method'),
|
|
80
|
-
insuranceScheme: z.string().optional(),
|
|
81
|
-
policyNumber: z.string().optional(),
|
|
82
|
-
});
|
|
83
|
-
|
|
84
56
|
const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ closeWorkspace, patientUuid }) => {
|
|
85
57
|
const { t } = useTranslation();
|
|
86
|
-
const layout = useLayoutType();
|
|
87
58
|
const { data: visitTypes, isLoading: isLoadingVisitTypes } = useVisitType();
|
|
88
59
|
const { lineItems, isLoading: isLoadingLineItems, error: lineError } = useBillableItems();
|
|
60
|
+
const { time: defaultTime, period: defaultPeriod } = getCurrentTime();
|
|
89
61
|
const { cashPoints, isLoading: isLoadingCashPoints, error: cashError } = useCashPoint();
|
|
90
62
|
const cashPointUuid = cashPoints?.[0]?.uuid ?? '';
|
|
91
63
|
|
|
92
64
|
const { insuranceSchemes } = useConfig({ externalModuleName: '@kenyaemr/esm-billing-app' });
|
|
93
65
|
|
|
94
66
|
const { paymentModes, isLoading: isLoadingPaymentModes } = usePaymentModes();
|
|
95
|
-
const { morgueCompartments } = useMorgueCompartment();
|
|
96
67
|
const {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} =
|
|
68
|
+
admissionLocation,
|
|
69
|
+
isLoading: isLoadingAdmissionLocation,
|
|
70
|
+
mutate: mutateAdmissionLocation,
|
|
71
|
+
} = useAdmissionLocation();
|
|
101
72
|
|
|
102
|
-
const {
|
|
103
|
-
|
|
104
|
-
morgueDepartmentServiceTypeUuid,
|
|
105
|
-
insurancepaymentModeUuid,
|
|
106
|
-
visitPaymentMethodAttributeUuid,
|
|
107
|
-
morgueAdmissionEncounterType,
|
|
108
|
-
tagNumberUuid,
|
|
109
|
-
policeIDNumber,
|
|
110
|
-
policeNameUuid,
|
|
111
|
-
burialPermitNumberUuid,
|
|
112
|
-
obNumberUuid,
|
|
113
|
-
encounterProviderRoleUuid,
|
|
114
|
-
dischargeAreaUuid,
|
|
115
|
-
} = useConfig<ConfigObject>();
|
|
73
|
+
const { morgueVisitTypeUuid, morgueDepartmentServiceTypeUuid, insurancepaymentModeUuid } = useConfig<ConfigObject>();
|
|
74
|
+
const { admitBody, errorFetchingEmrConfiguration, isLoadingEmrConfiguration } = useMortuaryOperation();
|
|
116
75
|
|
|
117
76
|
const [searchTerm, setSearchTerm] = useState<string>('');
|
|
118
77
|
const [isPoliceCase, setIsPoliceCase] = useState<string | null>(null);
|
|
@@ -127,14 +86,13 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
127
86
|
resolver: zodResolver(patientInfoSchema),
|
|
128
87
|
defaultValues: {
|
|
129
88
|
dateOfAdmission: new Date(),
|
|
130
|
-
timeOfDeath:
|
|
89
|
+
timeOfDeath: defaultTime,
|
|
90
|
+
period: defaultPeriod,
|
|
131
91
|
tagNumber: '',
|
|
132
92
|
obNumber: '',
|
|
133
93
|
policeName: '',
|
|
134
94
|
policeIDNo: '',
|
|
135
|
-
burialPermitNo: '',
|
|
136
95
|
visitType: morgueVisitTypeUuid,
|
|
137
|
-
availableCompartment: '',
|
|
138
96
|
paymentMethod: '',
|
|
139
97
|
insuranceScheme: '',
|
|
140
98
|
dischargeArea: '',
|
|
@@ -180,68 +138,26 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
180
138
|
};
|
|
181
139
|
});
|
|
182
140
|
|
|
183
|
-
const
|
|
141
|
+
const { admissionEncounter, compartment } = await admitBody(patientUuid, data);
|
|
184
142
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
if (data.dischargeArea) {
|
|
202
|
-
obs.push({ concept: dischargeAreaUuid, value: data.dischargeArea });
|
|
143
|
+
if (admissionEncounter && compartment) {
|
|
144
|
+
showSnackbar({
|
|
145
|
+
title: t('admissionSuccess', 'Deceased Admission'),
|
|
146
|
+
subtitle: t('admissionSuccessMessage', 'Patient has been admitted to the mortuary successfully'),
|
|
147
|
+
kind: 'success',
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
showSnackbar({
|
|
151
|
+
title: t('admissionError', 'Deceased Admission Error'),
|
|
152
|
+
subtitle: t(
|
|
153
|
+
'admissionError',
|
|
154
|
+
'An error has occurred while admitting deceased patient to the mortuary, Contact system administrator',
|
|
155
|
+
),
|
|
156
|
+
kind: 'error',
|
|
157
|
+
isLowContrast: true,
|
|
158
|
+
});
|
|
203
159
|
}
|
|
204
160
|
|
|
205
|
-
const encounterPayload = {
|
|
206
|
-
visit: {
|
|
207
|
-
patient: patientUuid,
|
|
208
|
-
startDatetime: encounterDateTime,
|
|
209
|
-
visitType: data.visitType,
|
|
210
|
-
location: locationUuid,
|
|
211
|
-
attributes: [
|
|
212
|
-
{
|
|
213
|
-
attributeType: visitPaymentMethodAttributeUuid,
|
|
214
|
-
value: data.paymentMethod,
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
},
|
|
218
|
-
encounterDatetime: new Date().toISOString(),
|
|
219
|
-
patient: patientUuid,
|
|
220
|
-
encounterType: morgueAdmissionEncounterType,
|
|
221
|
-
location: data.availableCompartment,
|
|
222
|
-
encounterProviders: [
|
|
223
|
-
{
|
|
224
|
-
provider: currentProviderUuid,
|
|
225
|
-
encounterRole: encounterProviderRoleUuid,
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
obs: obs.length > 0 ? obs : undefined,
|
|
229
|
-
};
|
|
230
|
-
await startVisitWithEncounter(encounterPayload).then(
|
|
231
|
-
() => {
|
|
232
|
-
showSnackbar({ title: 'Start visit', subtitle: ' visit has been started successfully', kind: 'success' });
|
|
233
|
-
},
|
|
234
|
-
(error) => {
|
|
235
|
-
const errorMessage = JSON.stringify(error?.responseBody?.error?.message?.replace(/\[/g, '').replace(/\]/g, ''));
|
|
236
|
-
showSnackbar({
|
|
237
|
-
title: 'Visit Error',
|
|
238
|
-
subtitle: `An error has occurred while starting visit, Contact system administrator quoting this error ${errorMessage}`,
|
|
239
|
-
kind: 'error',
|
|
240
|
-
isLowContrast: true,
|
|
241
|
-
});
|
|
242
|
-
},
|
|
243
|
-
);
|
|
244
|
-
|
|
245
161
|
const billPayload = {
|
|
246
162
|
lineItems: linesItems,
|
|
247
163
|
cashPoint: cashPointUuid,
|
|
@@ -252,7 +168,11 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
252
168
|
|
|
253
169
|
await createPatientBill(billPayload).then(
|
|
254
170
|
() => {
|
|
255
|
-
showSnackbar({
|
|
171
|
+
showSnackbar({
|
|
172
|
+
title: t('patientBill', 'Patient Bill'),
|
|
173
|
+
subtitle: t('patientBillSuccess', 'Patient has been billed successfully'),
|
|
174
|
+
kind: 'success',
|
|
175
|
+
});
|
|
256
176
|
},
|
|
257
177
|
(error) => {
|
|
258
178
|
const errorMessage = JSON.stringify(error?.responseBody?.error?.message?.replace(/\[/g, '').replace(/\]/g, ''));
|
|
@@ -264,10 +184,7 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
264
184
|
});
|
|
265
185
|
},
|
|
266
186
|
);
|
|
267
|
-
|
|
268
|
-
mutate((key) => {
|
|
269
|
-
return typeof key === 'string' && key.startsWith('/ws/rest/v1/morgue');
|
|
270
|
-
});
|
|
187
|
+
mutateAdmissionLocation();
|
|
271
188
|
closeWorkspace();
|
|
272
189
|
};
|
|
273
190
|
|
|
@@ -280,11 +197,17 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
280
197
|
const handlePoliceCaseChange = (selectedItem: string | null) => {
|
|
281
198
|
setIsPoliceCase(selectedItem);
|
|
282
199
|
};
|
|
200
|
+
if (isLoadingEmrConfiguration) {
|
|
201
|
+
return <InlineLoading status="active" description="Loading....." />;
|
|
202
|
+
}
|
|
203
|
+
if (errorFetchingEmrConfiguration) {
|
|
204
|
+
return <InlineNotification kind="error" title={errorFetchingEmrConfiguration} />;
|
|
205
|
+
}
|
|
283
206
|
return (
|
|
284
207
|
<Form className={styles.formContainer} onSubmit={handleSubmit(onSubmit)}>
|
|
285
208
|
<Stack gap={4} className={styles.formGrid}>
|
|
286
209
|
<br />
|
|
287
|
-
<
|
|
210
|
+
<DeceasedInfo patientUuid={patientUuid} />
|
|
288
211
|
<Column>
|
|
289
212
|
<Controller
|
|
290
213
|
name="dateOfAdmission"
|
|
@@ -310,48 +233,44 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
310
233
|
)}
|
|
311
234
|
/>
|
|
312
235
|
</Column>
|
|
313
|
-
|
|
314
236
|
<Column>
|
|
315
|
-
<
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
<div className={styles.dateTimeSection}>
|
|
323
|
-
<ResponsiveWrapper>
|
|
237
|
+
<div className={styles.dateTimeSection}>
|
|
238
|
+
<ResponsiveWrapper>
|
|
239
|
+
<Controller
|
|
240
|
+
name="timeOfDeath"
|
|
241
|
+
control={control}
|
|
242
|
+
render={({ field }) => {
|
|
243
|
+
return (
|
|
324
244
|
<TimePicker
|
|
245
|
+
{...field}
|
|
325
246
|
id="time-of-death-picker"
|
|
326
247
|
labelText={t('timeAdmission', 'Time of admission*')}
|
|
327
248
|
className={styles.formAdmissionTimepicker}
|
|
328
|
-
value={timeValue}
|
|
329
|
-
onChange={(e) => {
|
|
330
|
-
field.onChange(`${e.target.value} ${periodValue}`);
|
|
331
|
-
}}
|
|
332
249
|
invalid={!!errors.timeOfDeath}
|
|
333
250
|
invalidText={errors.timeOfDeath?.message}
|
|
334
251
|
/>
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
252
|
+
);
|
|
253
|
+
}}
|
|
254
|
+
/>
|
|
255
|
+
<Controller
|
|
256
|
+
name="period"
|
|
257
|
+
control={control}
|
|
258
|
+
render={({ field }) => (
|
|
259
|
+
<TimePickerSelect
|
|
260
|
+
{...field}
|
|
261
|
+
className={styles.formDeathTimepickerSelector}
|
|
262
|
+
id="time-picker-select"
|
|
263
|
+
labelText={t('selectPeriod', 'AM/PM')}
|
|
264
|
+
invalid={!!errors.period}
|
|
265
|
+
invalidText={errors.period?.message}>
|
|
266
|
+
<SelectItem value="AM" text="AM" />
|
|
267
|
+
<SelectItem value="PM" text="PM" />
|
|
268
|
+
</TimePickerSelect>
|
|
269
|
+
)}
|
|
270
|
+
/>
|
|
271
|
+
</ResponsiveWrapper>
|
|
272
|
+
</div>
|
|
353
273
|
</Column>
|
|
354
|
-
|
|
355
274
|
<Column>
|
|
356
275
|
<span className={styles.visitTypeHeader}>{t('visitTypes', 'Visit type')}</span>
|
|
357
276
|
|
|
@@ -465,24 +384,42 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
465
384
|
<Controller
|
|
466
385
|
control={control}
|
|
467
386
|
name="services"
|
|
468
|
-
render={({ field }) =>
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
.
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
387
|
+
render={({ field }) => {
|
|
388
|
+
const availableServices = lineItems.filter(
|
|
389
|
+
(service) => service?.serviceType?.uuid === morgueDepartmentServiceTypeUuid,
|
|
390
|
+
);
|
|
391
|
+
return (
|
|
392
|
+
<>
|
|
393
|
+
{availableServices.length > 0 ? (
|
|
394
|
+
<>
|
|
395
|
+
<FilterableMultiSelect
|
|
396
|
+
id="billing-service"
|
|
397
|
+
className={styles.formAdmissionDatepicker}
|
|
398
|
+
titleText={t('searchServices', 'Search services')}
|
|
399
|
+
items={availableServices.map((service) => service.uuid)}
|
|
400
|
+
itemToString={(item) => availableServices.find((i) => i.uuid === item)?.name ?? ''}
|
|
401
|
+
onChange={({ selectedItems }) => {
|
|
402
|
+
field.onChange(selectedItems);
|
|
403
|
+
}}
|
|
404
|
+
placeholder={t('Service', 'Service')}
|
|
405
|
+
initialSelectedItems={field.value}
|
|
406
|
+
invalid={!!errors.services}
|
|
407
|
+
invalidText={errors.services?.message}
|
|
408
|
+
/>
|
|
409
|
+
</>
|
|
410
|
+
) : (
|
|
411
|
+
<InlineNotification
|
|
412
|
+
kind="warning"
|
|
413
|
+
title={t(
|
|
414
|
+
'noServicesAvailable',
|
|
415
|
+
'No service price has been configured for the mortuary department.',
|
|
416
|
+
)}
|
|
417
|
+
lowContrast
|
|
418
|
+
/>
|
|
419
|
+
)}
|
|
420
|
+
</>
|
|
421
|
+
);
|
|
422
|
+
}}
|
|
486
423
|
/>
|
|
487
424
|
</Column>
|
|
488
425
|
)}
|
|
@@ -520,7 +457,6 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
520
457
|
)}
|
|
521
458
|
/>
|
|
522
459
|
</Column>
|
|
523
|
-
|
|
524
460
|
<Column>
|
|
525
461
|
<Dropdown
|
|
526
462
|
onChange={(e) => handlePoliceCaseChange(e.selectedItem)}
|
|
@@ -535,7 +471,6 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
535
471
|
)}
|
|
536
472
|
/>
|
|
537
473
|
</Column>
|
|
538
|
-
|
|
539
474
|
{isPoliceCase === 'Yes' && (
|
|
540
475
|
<>
|
|
541
476
|
<Column>
|
|
@@ -592,7 +527,6 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
592
527
|
</Column>
|
|
593
528
|
</>
|
|
594
529
|
)}
|
|
595
|
-
|
|
596
530
|
<Column>
|
|
597
531
|
<Controller
|
|
598
532
|
name="availableCompartment"
|
|
@@ -602,13 +536,19 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
602
536
|
{...field}
|
|
603
537
|
id="avail-compartment"
|
|
604
538
|
className={styles.sectionField}
|
|
605
|
-
items={
|
|
606
|
-
|
|
607
|
-
|
|
539
|
+
items={
|
|
540
|
+
admissionLocation?.bedLayouts?.map((bed) => ({
|
|
541
|
+
bedId: bed.bedId,
|
|
542
|
+
display:
|
|
543
|
+
bed.status === 'OCCUPIED'
|
|
544
|
+
? `${bed.bedNumber} . ${bed.patients.map((patient) => patient?.person?.display).join(' . ')}`
|
|
545
|
+
: `${bed.bedNumber} . ${bed.status}`,
|
|
546
|
+
})) || []
|
|
608
547
|
}
|
|
548
|
+
itemToString={(item) => item?.display || ''}
|
|
609
549
|
titleText={t('availableCompartment', 'Available Compartment')}
|
|
610
550
|
label={t('ChooseOptions', 'Choose option')}
|
|
611
|
-
onChange={({ selectedItem }) => field.onChange(selectedItem)}
|
|
551
|
+
onChange={({ selectedItem }) => field.onChange(selectedItem?.bedId)}
|
|
612
552
|
initialSelectedItems={field.value}
|
|
613
553
|
invalid={!!errors.availableCompartment}
|
|
614
554
|
invalidText={errors.availableCompartment?.message}
|
|
@@ -616,23 +556,6 @@ const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ c
|
|
|
616
556
|
)}
|
|
617
557
|
/>
|
|
618
558
|
</Column>
|
|
619
|
-
<Column>
|
|
620
|
-
<Controller
|
|
621
|
-
name="burialPermitNo"
|
|
622
|
-
control={control}
|
|
623
|
-
render={({ field }) => (
|
|
624
|
-
<TextInput
|
|
625
|
-
{...field}
|
|
626
|
-
id="burialPermitNo"
|
|
627
|
-
className={styles.formAdmissionDatepicker}
|
|
628
|
-
placeholder={t('burialPermitNo', 'Burial permit number')}
|
|
629
|
-
labelText={t('burialPermitNumber', 'Burial permit number')}
|
|
630
|
-
invalid={!!errors.burialPermitNo}
|
|
631
|
-
invalidText={errors.burialPermitNo?.message}
|
|
632
|
-
/>
|
|
633
|
-
)}
|
|
634
|
-
/>
|
|
635
|
-
</Column>
|
|
636
559
|
<ButtonSet className={styles.buttonSet}>
|
|
637
560
|
<Button style={{ maxWidth: '65%' }} size="lg" kind="secondary" onClick={closeWorkspace}>
|
|
638
561
|
{t('discard', 'Discard')}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
|
|
5
|
+
.formButton {
|
|
6
|
+
height: layout.$spacing-09;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-content: flex-start;
|
|
9
|
+
align-items: baseline;
|
|
10
|
+
min-width: layout.$spacing-11;
|
|
11
|
+
margin-bottom: layout.$spacing-05;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.buttonSet {
|
|
15
|
+
position: absolute;
|
|
16
|
+
bottom: layout.$spacing-05;
|
|
17
|
+
left: 4%;
|
|
18
|
+
width: 80%;
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: layout.$spacing-02;
|
|
21
|
+
|
|
22
|
+
& > button {
|
|
23
|
+
max-width: 40%;
|
|
24
|
+
width: 40%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.searchContainer {
|
|
28
|
+
padding: layout.$spacing-04;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.admissionRequestActionBar {
|
|
32
|
+
width: 100%;
|
|
33
|
+
padding: layout.$spacing-05;
|
|
34
|
+
margin-left: layout.$spacing-10;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.buttonRow {
|
|
38
|
+
display: flex;
|
|
39
|
+
width: 100%;
|
|
40
|
+
gap: 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.actionButton {
|
|
44
|
+
flex-grow: 1;
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|