@kenyaemr/esm-morgue-app 5.4.2-pre.2279 → 5.4.2-pre.2288

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.
Files changed (193) hide show
  1. package/.turbo/turbo-build.log +19 -19
  2. package/dist/109.js +2 -0
  3. package/dist/109.js.map +1 -0
  4. package/dist/201.js +1 -0
  5. package/dist/201.js.map +1 -0
  6. package/dist/293.js +1 -0
  7. package/dist/293.js.map +1 -0
  8. package/dist/300.js +1 -1
  9. package/dist/347.js +1 -2
  10. package/dist/347.js.map +1 -1
  11. package/dist/373.js +2 -0
  12. package/dist/373.js.map +1 -0
  13. package/dist/38.js +1 -0
  14. package/dist/38.js.map +1 -0
  15. package/dist/389.js +1 -0
  16. package/dist/389.js.map +1 -0
  17. package/dist/398.js +1 -0
  18. package/dist/398.js.map +1 -0
  19. package/dist/4.js +2 -0
  20. package/dist/4.js.map +1 -0
  21. package/dist/410.js +1 -0
  22. package/dist/410.js.map +1 -0
  23. package/dist/420.js +2 -0
  24. package/dist/420.js.map +1 -0
  25. package/dist/467.js +1 -0
  26. package/dist/467.js.map +1 -0
  27. package/dist/632.js +1 -0
  28. package/dist/632.js.map +1 -0
  29. package/dist/798.js +1 -0
  30. package/dist/798.js.map +1 -0
  31. package/dist/811.js +1 -0
  32. package/dist/811.js.map +1 -0
  33. package/dist/824.js +1 -0
  34. package/dist/824.js.map +1 -0
  35. package/dist/827.js +1 -0
  36. package/dist/827.js.map +1 -0
  37. package/dist/842.js +2 -0
  38. package/dist/842.js.LICENSE.txt +5 -0
  39. package/dist/842.js.map +1 -0
  40. package/dist/918.js +1 -1
  41. package/dist/918.js.map +1 -1
  42. package/dist/kenyaemr-esm-morgue-app.js +1 -1
  43. package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +218 -291
  44. package/dist/kenyaemr-esm-morgue-app.js.map +1 -1
  45. package/dist/main.js +2 -1
  46. package/dist/main.js.LICENSE.txt +15 -0
  47. package/dist/main.js.map +1 -1
  48. package/dist/routes.json +1 -1
  49. package/package.json +1 -1
  50. package/src/bed/bed.component.tsx +164 -0
  51. package/src/bed/bed.scss +192 -0
  52. package/src/bed/divider/divider.component.tsx +18 -0
  53. package/src/bed/empty-bed.component.tsx +47 -0
  54. package/src/bed-layout/admitted/admitted-bed-layout.component.tsx +189 -0
  55. package/src/bed-layout/awaiting/awaiting-bed-layout.component.tsx +86 -0
  56. package/src/bed-layout/bed-layout.resource.ts +72 -0
  57. package/src/bed-layout/bed-layout.scss +55 -0
  58. package/src/bed-layout/discharged/discharged-bed-layout.component.tsx +109 -0
  59. package/src/bed-layout/discharged/discharged-bed-layout.resource.ts +99 -0
  60. package/src/bed-linelist-view/admitted/admitted-bed-linelist-view.component.tsx +420 -0
  61. package/src/bed-linelist-view/awaiting/awaiting-bed-linelist-view.component.tsx +224 -0
  62. package/src/bed-linelist-view/bed-linelist-view.scss +5 -0
  63. package/src/bed-linelist-view/discharged/discharged-bed-line-view.component.tsx +256 -0
  64. package/src/config-schema.ts +41 -9
  65. package/src/constants.ts +57 -0
  66. package/src/deceased-patient-header/deceased-patient-header.component.tsx +31 -0
  67. package/src/deceased-patient-header/deceased-patient-header.scss +50 -0
  68. package/src/{component → deceased-patient-header}/deceasedInfo/deceased-info.component.tsx +1 -1
  69. package/src/deceased-patient-header/deceasedInfo/deceased-info.resource.ts +11 -0
  70. package/src/extension/actionButton.component.tsx +5 -59
  71. package/src/extension/deceasedInfoBanner.component.tsx +5 -9
  72. package/src/{hook/useAdmitPatient.ts → forms/admit-deceased-person-workspace/admit-deceased-person.resource.ts} +177 -46
  73. package/src/forms/admit-deceased-person-workspace/admit-deceased-person.scss +143 -0
  74. package/src/forms/admit-deceased-person-workspace/admit-deceased-person.workspace.tsx +648 -0
  75. package/src/{hook/usePersonAttributes.ts → forms/discharge-deceased-person-workspace/discharge-body.resource.ts} +1 -1
  76. package/src/forms/discharge-deceased-person-workspace/discharge-body.scss +56 -0
  77. package/src/forms/discharge-deceased-person-workspace/discharge-body.workspace.tsx +362 -0
  78. package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.resource.ts +18 -0
  79. package/src/{workspaces/patientAdditionalInfoForm.scss → forms/dispose-deceased-person-workspace/dispose-deceased-person.scss} +46 -66
  80. package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.workspace.tsx +401 -0
  81. package/src/forms/form-entry-workspace/form-entry-workspace.workspace.tsx +62 -0
  82. package/src/forms/swap-compartment-workspace/swap-unit.scss +144 -0
  83. package/src/forms/swap-compartment-workspace/swap-unit.workspace.tsx +280 -0
  84. package/src/header/header.component.tsx +41 -0
  85. package/src/header/header.scss +58 -0
  86. package/src/home/home.component.tsx +87 -0
  87. package/src/home/home.resource.ts +261 -0
  88. package/src/home/home.scss +5 -0
  89. package/src/index.ts +18 -12
  90. package/src/metrics/metrics-card.component.tsx +31 -0
  91. package/src/metrics/metrics-card.scss +51 -0
  92. package/src/root.component.tsx +7 -3
  93. package/src/routes.json +25 -1
  94. package/src/schemas/index.ts +66 -0
  95. package/src/summary/summary.component.tsx +42 -0
  96. package/src/summary/summary.scss +10 -0
  97. package/src/switcher/content-switcher.component.tsx +220 -0
  98. package/src/switcher/content-switcher.scss +30 -0
  99. package/src/types/index.ts +336 -359
  100. package/src/utils/utils.ts +20 -2
  101. package/src/view-details/main/main.component.tsx +34 -0
  102. package/src/view-details/main/main.scss +45 -0
  103. package/src/view-details/panels/attachement.component.tsx +21 -0
  104. package/src/view-details/panels/autopsy.component.tsx +215 -0
  105. package/src/view-details/panels/billing-history.component.tsx +13 -0
  106. package/src/view-details/panels/observations/observation.component.tsx +57 -0
  107. package/src/view-details/panels/observations/observation.scss +24 -0
  108. package/src/view-details/panels/panels.scss +46 -0
  109. package/src/view-details/view-details.component.tsx +65 -0
  110. package/src/view-details/view-details.resource.ts +65 -0
  111. package/src/view-details/views-details.scss +82 -0
  112. package/translations/en.json +67 -25
  113. package/tsconfig.json +1 -1
  114. package/dist/113.js +0 -1
  115. package/dist/113.js.map +0 -1
  116. package/dist/160.js +0 -1
  117. package/dist/160.js.map +0 -1
  118. package/dist/299.js +0 -1
  119. package/dist/299.js.map +0 -1
  120. package/dist/433.js +0 -2
  121. package/dist/433.js.map +0 -1
  122. package/dist/441.js +0 -1
  123. package/dist/441.js.map +0 -1
  124. package/dist/496.js +0 -1
  125. package/dist/496.js.map +0 -1
  126. package/dist/511.js +0 -1
  127. package/dist/511.js.map +0 -1
  128. package/dist/603.js +0 -1
  129. package/dist/603.js.map +0 -1
  130. package/dist/610.js +0 -1
  131. package/dist/610.js.map +0 -1
  132. package/dist/612.js +0 -1
  133. package/dist/612.js.map +0 -1
  134. package/dist/656.js +0 -2
  135. package/dist/656.js.map +0 -1
  136. package/dist/752.js +0 -1
  137. package/dist/752.js.map +0 -1
  138. package/dist/754.js +0 -1
  139. package/dist/754.js.map +0 -1
  140. package/dist/781.js +0 -1
  141. package/dist/781.js.map +0 -1
  142. package/dist/801.js +0 -2
  143. package/dist/801.js.map +0 -1
  144. package/dist/817.js +0 -1
  145. package/dist/817.js.map +0 -1
  146. package/dist/877.js +0 -1
  147. package/dist/877.js.map +0 -1
  148. package/dist/924.js +0 -1
  149. package/dist/924.js.map +0 -1
  150. package/src/autosuggest/autosuggest.component.tsx +0 -162
  151. package/src/autosuggest/autosuggest.scss +0 -61
  152. package/src/autosuggest/patient-search-info.component.tsx +0 -75
  153. package/src/autosuggest/patient-search-info.scss +0 -62
  154. package/src/autosuggest/search-empty-state.component.tsx +0 -21
  155. package/src/autosuggest/search-empty-state.scss +0 -18
  156. package/src/card/avail-compartment.compartment.tsx +0 -94
  157. package/src/card/compartment-view.compartment.tsx +0 -62
  158. package/src/card/compartment.scss +0 -128
  159. package/src/card/compartmentSharing.component.tsx +0 -21
  160. package/src/card/compartmentSharing.scss +0 -24
  161. package/src/card/empty-compartment.component.tsx +0 -28
  162. package/src/card/empty-compartment.scss +0 -61
  163. package/src/component/main.component.tsx +0 -17
  164. package/src/component/next-of-kin-details/nextOfKinDetails.component.tsx +0 -50
  165. package/src/component/next-of-kin-details/nextOfKinDetails.scss +0 -37
  166. package/src/header/admitted-queue-header.component.tsx +0 -30
  167. package/src/header/admitted-queue-header.scss +0 -32
  168. package/src/header/morgue-header.component.tsx +0 -38
  169. package/src/header/morgue-header.scss +0 -95
  170. package/src/header/morgue-illustration.component.tsx +0 -13
  171. package/src/hook/useDeceasedPatients.ts +0 -12
  172. package/src/hook/useDischargedPatient.ts +0 -55
  173. package/src/hook/useMorgue.resource.ts +0 -163
  174. package/src/hook/useMortuaryAdmissionLocation.ts +0 -64
  175. package/src/tables/admitted-queue.component.tsx +0 -54
  176. package/src/tables/admitted-queue.scss +0 -62
  177. package/src/tables/discharge-queue.component.tsx +0 -87
  178. package/src/tables/generic-table.component.tsx +0 -140
  179. package/src/tables/generic-table.scss +0 -37
  180. package/src/tabs/tabs.component.tsx +0 -82
  181. package/src/tabs/tabs.scss +0 -15
  182. package/src/workspaces/admit-body.scss +0 -46
  183. package/src/workspaces/admit-body.workspace.tsx +0 -79
  184. package/src/workspaces/discharge-body.scss +0 -67
  185. package/src/workspaces/discharge-body.workspace.tsx +0 -329
  186. package/src/workspaces/patientAdditionalInfoForm.workspace.tsx +0 -562
  187. package/src/workspaces/swap-unit.scss +0 -46
  188. package/src/workspaces/swap-unit.workspace.tsx +0 -168
  189. /package/dist/{347.js.LICENSE.txt → 109.js.LICENSE.txt} +0 -0
  190. /package/dist/{656.js.LICENSE.txt → 373.js.LICENSE.txt} +0 -0
  191. /package/dist/{801.js.LICENSE.txt → 4.js.LICENSE.txt} +0 -0
  192. /package/dist/{433.js.LICENSE.txt → 420.js.LICENSE.txt} +0 -0
  193. /package/src/{component → deceased-patient-header}/deceasedInfo/deceased-info.scss +0 -0
@@ -1,562 +0,0 @@
1
- import {
2
- Button,
3
- ButtonSet,
4
- Column,
5
- ComboBox,
6
- DatePicker,
7
- DatePickerInput,
8
- Dropdown,
9
- FilterableMultiSelect,
10
- Form,
11
- Layer,
12
- RadioButton,
13
- RadioButtonGroup,
14
- Search,
15
- SelectItem,
16
- InlineNotification,
17
- Stack,
18
- TextInput,
19
- Tile,
20
- TimePicker,
21
- InlineLoading,
22
- TimePickerSelect,
23
- } from '@carbon/react';
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';
27
- import classNames from 'classnames';
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
- import {
37
- createPatientBill,
38
- useBillableItems,
39
- useCashPoint,
40
- usePaymentModes,
41
- useVisitType,
42
- } from '../hook/useMorgue.resource';
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';
48
-
49
- interface PatientAdditionalInfoFormProps {
50
- closeWorkspace: () => void;
51
- patientUuid: string;
52
- }
53
-
54
- const MAX_RESULTS = 5;
55
-
56
- const PatientAdditionalInfoForm: React.FC<PatientAdditionalInfoFormProps> = ({ closeWorkspace, patientUuid }) => {
57
- const { t } = useTranslation();
58
- const { data: visitTypes, isLoading: isLoadingVisitTypes } = useVisitType();
59
- const { lineItems, isLoading: isLoadingLineItems, error: lineError } = useBillableItems();
60
- const { time: defaultTime, period: defaultPeriod } = getCurrentTime();
61
- const { cashPoints, isLoading: isLoadingCashPoints, error: cashError } = useCashPoint();
62
- const cashPointUuid = cashPoints?.[0]?.uuid ?? '';
63
-
64
- const { insuranceSchemes } = useConfig({ externalModuleName: '@kenyaemr/esm-billing-app' });
65
-
66
- const { paymentModes, isLoading: isLoadingPaymentModes } = usePaymentModes();
67
- const {
68
- admissionLocation,
69
- isLoading: isLoadingAdmissionLocation,
70
- mutate: mutateAdmissionLocation,
71
- } = useAdmissionLocation();
72
-
73
- const { morgueVisitTypeUuid, morgueDepartmentServiceTypeUuid, insurancepaymentModeUuid } = useConfig<ConfigObject>();
74
- const { admitBody, errorFetchingEmrConfiguration, isLoadingEmrConfiguration } = useMortuaryOperation();
75
-
76
- const [searchTerm, setSearchTerm] = useState<string>('');
77
- const [isPoliceCase, setIsPoliceCase] = useState<string | null>(null);
78
-
79
- const {
80
- control,
81
- watch,
82
- handleSubmit,
83
- setValue,
84
- formState: { errors },
85
- } = useForm<z.infer<typeof patientInfoSchema>>({
86
- resolver: zodResolver(patientInfoSchema),
87
- defaultValues: {
88
- dateOfAdmission: new Date(),
89
- timeOfDeath: defaultTime,
90
- period: defaultPeriod,
91
- tagNumber: '',
92
- obNumber: '',
93
- policeName: '',
94
- policeIDNo: '',
95
- visitType: morgueVisitTypeUuid,
96
- paymentMethod: '',
97
- insuranceScheme: '',
98
- dischargeArea: '',
99
- policyNumber: '',
100
- services: [],
101
- },
102
- });
103
-
104
- const visitTypeValue = watch('visitType');
105
- const paymentMethodObservable = watch('paymentMethod');
106
-
107
- const filteredVisitTypes = useMemo(() => {
108
- if (!visitTypes) {
109
- return [];
110
- }
111
- if (!searchTerm) {
112
- return visitTypes;
113
- }
114
- return fuzzy
115
- .filter(searchTerm, visitTypes, { extract: (visitType) => visitType.display })
116
- .map((result) => result.original);
117
- }, [searchTerm, visitTypes]);
118
-
119
- const truncatedResults = filteredVisitTypes.slice(0, MAX_RESULTS);
120
-
121
- const onSubmit = async (data: z.infer<typeof patientInfoSchema>) => {
122
- const serviceUuid = data.services;
123
-
124
- const linesItems = lineItems
125
- .filter((item) => serviceUuid.includes(item.uuid))
126
- .map((item, index) => {
127
- const priceForPaymentMode =
128
- item.servicePrices.find((p) => p.paymentMode?.uuid === paymentModes) || item?.servicePrices[0];
129
-
130
- return {
131
- billableService: item.uuid,
132
- quantity: 1,
133
- price: priceForPaymentMode ? priceForPaymentMode.price : '0.000',
134
- priceName: 'Default',
135
- priceUuid: priceForPaymentMode ? priceForPaymentMode.uuid : '',
136
- lineItemOrder: index,
137
- paymentStatus: PENDING_PAYMENT_STATUS,
138
- };
139
- });
140
-
141
- const { admissionEncounter, compartment } = await admitBody(patientUuid, data);
142
-
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
- });
159
- }
160
-
161
- const billPayload = {
162
- lineItems: linesItems,
163
- cashPoint: cashPointUuid,
164
- patient: patientUuid,
165
- status: PENDING_PAYMENT_STATUS,
166
- payments: [],
167
- };
168
-
169
- await createPatientBill(billPayload).then(
170
- () => {
171
- showSnackbar({
172
- title: t('patientBill', 'Patient Bill'),
173
- subtitle: t('patientBillSuccess', 'Patient has been billed successfully'),
174
- kind: 'success',
175
- });
176
- },
177
- (error) => {
178
- const errorMessage = JSON.stringify(error?.responseBody?.error?.message?.replace(/\[/g, '').replace(/\]/g, ''));
179
- showSnackbar({
180
- title: 'Patient Bill Error',
181
- subtitle: `An error has occurred while creating patient bill, Contact system administrator quoting this error ${errorMessage}`,
182
- kind: 'error',
183
- isLowContrast: true,
184
- });
185
- },
186
- );
187
- mutateAdmissionLocation();
188
- closeWorkspace();
189
- };
190
-
191
- useEffect(() => {
192
- if (visitTypeValue === morgueVisitTypeUuid) {
193
- setValue('visitType', morgueVisitTypeUuid);
194
- }
195
- }, [visitTypeValue, morgueVisitTypeUuid, setValue]);
196
-
197
- const handlePoliceCaseChange = (selectedItem: string | null) => {
198
- setIsPoliceCase(selectedItem);
199
- };
200
- if (isLoadingEmrConfiguration) {
201
- return <InlineLoading status="active" description="Loading....." />;
202
- }
203
- if (errorFetchingEmrConfiguration) {
204
- return <InlineNotification kind="error" title={errorFetchingEmrConfiguration} />;
205
- }
206
- return (
207
- <Form className={styles.formContainer} onSubmit={handleSubmit(onSubmit)}>
208
- <Stack gap={4} className={styles.formGrid}>
209
- <br />
210
- <DeceasedInfo patientUuid={patientUuid} />
211
- <Column>
212
- <Controller
213
- name="dateOfAdmission"
214
- control={control}
215
- render={({ field }) => (
216
- <DatePicker
217
- datePickerType="single"
218
- className={styles.formAdmissionDatepicker}
219
- onChange={(event) => {
220
- if (event.length) {
221
- field.onChange(event[0]);
222
- }
223
- }}
224
- value={field.value ? new Date(field.value) : null}>
225
- <DatePickerInput
226
- id="date-of-admission"
227
- placeholder="mm/dd/yyyy"
228
- labelText={t('dateOfAdmission', 'Date of admission')}
229
- invalid={!!errors.dateOfAdmission}
230
- invalidText={errors.dateOfAdmission?.message}
231
- />
232
- </DatePicker>
233
- )}
234
- />
235
- </Column>
236
- <Column>
237
- <div className={styles.dateTimeSection}>
238
- <ResponsiveWrapper>
239
- <Controller
240
- name="timeOfDeath"
241
- control={control}
242
- render={({ field }) => {
243
- return (
244
- <TimePicker
245
- {...field}
246
- id="time-of-death-picker"
247
- labelText={t('timeAdmission', 'Time of admission*')}
248
- className={styles.formAdmissionTimepicker}
249
- invalid={!!errors.timeOfDeath}
250
- invalidText={errors.timeOfDeath?.message}
251
- />
252
- );
253
- }}
254
- />
255
- <Controller
256
- name="period"
257
- control={control}
258
- render={({ field }) => (
259
- <TimePickerSelect {...field} className={styles.formDeathTimepickerSelector} id="time-picker-select">
260
- <SelectItem value="AM" text="AM" />
261
- <SelectItem value="PM" text="PM" />
262
- </TimePickerSelect>
263
- )}
264
- />
265
- </ResponsiveWrapper>
266
- </div>
267
- </Column>
268
- <Column>
269
- <span className={styles.visitTypeHeader}>{t('visitTypes', 'Visit type')}</span>
270
-
271
- <div className={classNames(styles.visitTypeOverviewWrapper)}>
272
- <ResponsiveWrapper>
273
- <Search
274
- onChange={(event) => setSearchTerm(event.target.value)}
275
- placeholder={t('searchForAVisitType', 'Search for a visit type')}
276
- labelText=""
277
- />
278
- </ResponsiveWrapper>
279
- {truncatedResults.some(({ uuid }) => uuid === morgueVisitTypeUuid) ? (
280
- <RadioButtonGroup
281
- className={styles.radioButtonGroup}
282
- defaultSelected={morgueVisitTypeUuid}
283
- orientation="vertical"
284
- onChange={(visitType) => setValue('visitType', visitType.toString())}
285
- name="radio-button-group"
286
- valueSelected={visitTypeValue}
287
- invalid={!!errors.visitType}
288
- invalidText={errors.visitType?.message}>
289
- {truncatedResults
290
- .filter(({ uuid }) => uuid === morgueVisitTypeUuid)
291
- .map(({ uuid, display }) => (
292
- <RadioButton
293
- key={uuid}
294
- className={styles.radioButton}
295
- id={uuid}
296
- labelText={display}
297
- value={uuid}
298
- disabled={visitTypeValue === morgueVisitTypeUuid && uuid !== morgueVisitTypeUuid}
299
- />
300
- ))}
301
- </RadioButtonGroup>
302
- ) : (
303
- <Layer>
304
- <Tile className={styles.tile}>
305
- <EmptyDataIllustration />
306
- <p className={styles.content}>
307
- {t('noVisitTypesMatchingSearch', 'There are no visit types matching this search text')}
308
- </p>
309
- </Tile>
310
- </Layer>
311
- )}
312
- </div>
313
- </Column>
314
- <Column>
315
- <div className={styles.sectionFieldLayer}>
316
- <Controller
317
- control={control}
318
- name="paymentMethod"
319
- render={({ field }) => (
320
- <Dropdown
321
- {...field}
322
- initialSelectedItem={field.value}
323
- className={styles.sectionField}
324
- onChange={({ selectedItem }) => field.onChange(selectedItem)}
325
- id="paymentMethods"
326
- items={paymentModes.map((mode) => mode.uuid)}
327
- itemToString={(item) => paymentModes.find((mode) => mode.uuid === item)?.name ?? ''}
328
- titleText={t('selectPaymentMethod', 'Select payment method')}
329
- label={t('selectPaymentMethod', 'Select payment method')}
330
- />
331
- )}
332
- />
333
- </div>
334
- </Column>
335
- {paymentMethodObservable === insurancepaymentModeUuid && (
336
- <>
337
- <Column>
338
- <Controller
339
- control={control}
340
- name="insuranceScheme"
341
- render={({ field }) => (
342
- <ComboBox
343
- className={styles.sectionField}
344
- onChange={({ selectedItem }) => field.onChange(selectedItem)}
345
- id="insurance-scheme"
346
- items={insuranceSchemes}
347
- itemToString={(item) => (item ? item.toString() : '')}
348
- titleText={t('insuranceScheme', 'Insurance scheme')}
349
- invalid={!!errors.insuranceScheme}
350
- invalidText={errors.insuranceScheme?.message}
351
- />
352
- )}
353
- />
354
- </Column>
355
- <Column>
356
- <Controller
357
- control={control}
358
- name="policyNumber"
359
- render={({ field }) => (
360
- <TextInput
361
- className={styles.sectionField}
362
- onChange={(e) => field.onChange(e.target.value)}
363
- id="policy-number"
364
- type="text"
365
- labelText={t('policyNumber', 'Policy number')}
366
- placeholder={t('enterPolicyNumber', 'Enter policy number')}
367
- invalid={!!errors.policyNumber}
368
- invalidText={errors.policyNumber?.message}
369
- />
370
- )}
371
- />
372
- </Column>
373
- </>
374
- )}
375
- {paymentMethodObservable && (
376
- <Column>
377
- <Controller
378
- control={control}
379
- name="services"
380
- render={({ field }) => {
381
- const availableServices = lineItems.filter(
382
- (service) => service?.serviceType?.uuid === morgueDepartmentServiceTypeUuid,
383
- );
384
- return (
385
- <>
386
- {availableServices.length > 0 ? (
387
- <FilterableMultiSelect
388
- id="billing-service"
389
- className={styles.formAdmissionDatepicker}
390
- titleText={t('searchServices', 'Search services')}
391
- items={availableServices.map((service) => service.uuid)}
392
- itemToString={(item) => availableServices.find((i) => i.uuid === item)?.name ?? ''}
393
- onChange={({ selectedItems }) => {
394
- field.onChange(selectedItems);
395
- }}
396
- placeholder={t('Service', 'Service')}
397
- initialSelectedItems={field.value}
398
- invalid={!!errors.services}
399
- invalidText={errors.services?.message}
400
- />
401
- ) : (
402
- <InlineNotification
403
- kind="warning"
404
- title={t(
405
- 'noServicesAvailable',
406
- 'No service price has been configured for the mortuary department.',
407
- )}
408
- lowContrast
409
- />
410
- )}
411
- </>
412
- );
413
- }}
414
- />
415
- </Column>
416
- )}
417
- <Column>
418
- <Controller
419
- name="tagNumber"
420
- control={control}
421
- render={({ field }) => (
422
- <TextInput
423
- {...field}
424
- id="tagNumber"
425
- className={styles.sectionField}
426
- placeholder={t('tagNumber', 'Tag Number*')}
427
- labelText={t('tagNumber', 'Tag Number*')}
428
- invalid={!!errors.tagNumber}
429
- invalidText={errors.tagNumber?.message}
430
- />
431
- )}
432
- />
433
- </Column>
434
- <Column>
435
- <Controller
436
- name="dischargeArea"
437
- control={control}
438
- render={({ field }) => (
439
- <TextInput
440
- {...field}
441
- id="dischargeArea"
442
- className={styles.sectionField}
443
- placeholder={t('dischargeArea', 'Discharge Area')}
444
- labelText={t('dischargeArea', 'Discharge Area')}
445
- invalid={!!errors.dischargeArea}
446
- invalidText={errors.dischargeArea?.message}
447
- />
448
- )}
449
- />
450
- </Column>
451
- <Column>
452
- <Dropdown
453
- onChange={(e) => handlePoliceCaseChange(e.selectedItem)}
454
- id="morgue-combobox"
455
- className={styles.formAdmissionDatepicker}
456
- items={['Yes', 'No']}
457
- itemToString={(item) => (item ? item : '')}
458
- label={t('ChooseOptions', 'Choose option')}
459
- titleText={t(
460
- 'isPoliceCase',
461
- 'Is the body associated with a police case? If so, can you provide the OB number?*',
462
- )}
463
- />
464
- </Column>
465
- {isPoliceCase === 'Yes' && (
466
- <>
467
- <Column>
468
- <Controller
469
- name="obNumber"
470
- control={control}
471
- render={({ field }) => (
472
- <TextInput
473
- {...field}
474
- id="obNumber"
475
- className={styles.formAdmissionDatepicker}
476
- placeholder={t('obNos', 'OB Number')}
477
- labelText={t('obNumber', 'OB Number')}
478
- invalid={!!errors.obNumber}
479
- invalidText={errors.obNumber?.message}
480
- />
481
- )}
482
- />
483
- </Column>
484
- <Column>
485
- <Controller
486
- name="policeName"
487
- control={control}
488
- render={({ field }) => (
489
- <TextInput
490
- {...field}
491
- id="policeName"
492
- className={styles.formAdmissionDatepicker}
493
- placeholder={t('policeNames', 'Police Name')}
494
- labelText={t('policeName', 'Police name')}
495
- invalid={!!errors.policeName}
496
- invalidText={errors.policeName?.message}
497
- />
498
- )}
499
- />
500
- </Column>
501
- <Column>
502
- <Controller
503
- name="policeIDNo"
504
- control={control}
505
- render={({ field }) => (
506
- <TextInput
507
- {...field}
508
- id="policeIDNo"
509
- className={styles.formAdmissionDatepicker}
510
- placeholder={t('policeID', 'Police ID number')}
511
- labelText={t('policeIDNo', 'Police ID number')}
512
- invalid={!!errors.policeIDNo}
513
- invalidText={errors.policeIDNo?.message}
514
- />
515
- )}
516
- />
517
- </Column>
518
- </>
519
- )}
520
- <Column>
521
- <Controller
522
- name="availableCompartment"
523
- control={control}
524
- render={({ field }) => (
525
- <Dropdown
526
- {...field}
527
- id="avail-compartment"
528
- className={styles.sectionField}
529
- items={
530
- admissionLocation?.bedLayouts?.map((bed) => ({
531
- bedId: bed.bedId,
532
- display:
533
- bed.status === 'OCCUPIED'
534
- ? `${bed.bedNumber} . ${bed.patients.map((patient) => patient?.person?.display).join(' . ')}`
535
- : `${bed.bedNumber} . ${bed.status}`,
536
- })) || []
537
- }
538
- itemToString={(item) => item?.display || ''}
539
- titleText={t('availableCompartment', 'Available Compartment')}
540
- label={t('ChooseOptions', 'Choose option')}
541
- onChange={({ selectedItem }) => field.onChange(selectedItem?.bedId)}
542
- invalid={!!errors.availableCompartment}
543
- initialSelectedItem={field.value as any}
544
- invalidText={errors.availableCompartment?.message}
545
- />
546
- )}
547
- />
548
- </Column>
549
- <ButtonSet className={styles.buttonSet}>
550
- <Button style={{ maxWidth: '65%' }} size="lg" kind="secondary" onClick={closeWorkspace}>
551
- {t('discard', 'Discard')}
552
- </Button>
553
- <Button style={{ maxWidth: '60%' }} kind="primary" size="lg" type="submit">
554
- {t('admit', 'Admit')}
555
- </Button>
556
- </ButtonSet>
557
- </Stack>
558
- </Form>
559
- );
560
- };
561
-
562
- export default PatientAdditionalInfoForm;
@@ -1,46 +0,0 @@
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
- }