@kenyaemr/esm-morgue-app 5.4.2-pre.2283 → 5.4.2-pre.2291
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 +19 -19
- package/dist/109.js +2 -0
- package/dist/109.js.map +1 -0
- package/dist/201.js +1 -0
- package/dist/201.js.map +1 -0
- package/dist/293.js +1 -0
- package/dist/293.js.map +1 -0
- package/dist/300.js +1 -1
- package/dist/347.js +1 -2
- package/dist/347.js.map +1 -1
- package/dist/373.js +2 -0
- package/dist/373.js.map +1 -0
- package/dist/38.js +1 -0
- package/dist/38.js.map +1 -0
- package/dist/389.js +1 -0
- package/dist/389.js.map +1 -0
- package/dist/398.js +1 -0
- package/dist/398.js.map +1 -0
- package/dist/4.js +2 -0
- package/dist/4.js.map +1 -0
- package/dist/410.js +1 -0
- package/dist/410.js.map +1 -0
- package/dist/420.js +2 -0
- package/dist/420.js.map +1 -0
- package/dist/467.js +1 -0
- package/dist/467.js.map +1 -0
- package/dist/632.js +1 -0
- package/dist/632.js.map +1 -0
- package/dist/798.js +1 -0
- package/dist/798.js.map +1 -0
- package/dist/811.js +1 -0
- package/dist/811.js.map +1 -0
- package/dist/824.js +1 -0
- package/dist/824.js.map +1 -0
- package/dist/827.js +1 -0
- package/dist/827.js.map +1 -0
- package/dist/842.js +2 -0
- package/dist/842.js.LICENSE.txt +5 -0
- package/dist/842.js.map +1 -0
- package/dist/918.js +1 -1
- package/dist/918.js.map +1 -1
- package/dist/kenyaemr-esm-morgue-app.js +1 -1
- package/dist/kenyaemr-esm-morgue-app.js.buildmanifest.json +218 -291
- package/dist/kenyaemr-esm-morgue-app.js.map +1 -1
- package/dist/main.js +2 -1
- package/dist/main.js.LICENSE.txt +15 -0
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/bed/bed.component.tsx +164 -0
- package/src/bed/bed.scss +192 -0
- package/src/bed/divider/divider.component.tsx +18 -0
- package/src/bed/empty-bed.component.tsx +47 -0
- package/src/bed-layout/admitted/admitted-bed-layout.component.tsx +189 -0
- package/src/bed-layout/awaiting/awaiting-bed-layout.component.tsx +86 -0
- package/src/bed-layout/bed-layout.resource.ts +72 -0
- package/src/bed-layout/bed-layout.scss +55 -0
- package/src/bed-layout/discharged/discharged-bed-layout.component.tsx +109 -0
- package/src/bed-layout/discharged/discharged-bed-layout.resource.ts +99 -0
- package/src/bed-linelist-view/admitted/admitted-bed-linelist-view.component.tsx +420 -0
- package/src/bed-linelist-view/awaiting/awaiting-bed-linelist-view.component.tsx +224 -0
- package/src/bed-linelist-view/bed-linelist-view.scss +5 -0
- package/src/bed-linelist-view/discharged/discharged-bed-line-view.component.tsx +256 -0
- package/src/config-schema.ts +41 -9
- package/src/constants.ts +57 -0
- package/src/deceased-patient-header/deceased-patient-header.component.tsx +31 -0
- package/src/deceased-patient-header/deceased-patient-header.scss +50 -0
- package/src/{component → deceased-patient-header}/deceasedInfo/deceased-info.component.tsx +1 -1
- package/src/deceased-patient-header/deceasedInfo/deceased-info.resource.ts +11 -0
- package/src/extension/actionButton.component.tsx +5 -59
- package/src/extension/deceasedInfoBanner.component.tsx +5 -9
- package/src/{hook/useAdmitPatient.ts → forms/admit-deceased-person-workspace/admit-deceased-person.resource.ts} +177 -46
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.scss +143 -0
- package/src/forms/admit-deceased-person-workspace/admit-deceased-person.workspace.tsx +648 -0
- package/src/{hook/usePersonAttributes.ts → forms/discharge-deceased-person-workspace/discharge-body.resource.ts} +1 -1
- package/src/forms/discharge-deceased-person-workspace/discharge-body.scss +56 -0
- package/src/forms/discharge-deceased-person-workspace/discharge-body.workspace.tsx +362 -0
- package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.resource.ts +18 -0
- package/src/{workspaces/patientAdditionalInfoForm.scss → forms/dispose-deceased-person-workspace/dispose-deceased-person.scss} +46 -66
- package/src/forms/dispose-deceased-person-workspace/dispose-deceased-person.workspace.tsx +401 -0
- package/src/forms/form-entry-workspace/form-entry-workspace.workspace.tsx +62 -0
- package/src/forms/swap-compartment-workspace/swap-unit.scss +144 -0
- package/src/forms/swap-compartment-workspace/swap-unit.workspace.tsx +280 -0
- package/src/header/header.component.tsx +41 -0
- package/src/header/header.scss +58 -0
- package/src/home/home.component.tsx +87 -0
- package/src/home/home.resource.ts +261 -0
- package/src/home/home.scss +5 -0
- package/src/index.ts +18 -12
- package/src/metrics/metrics-card.component.tsx +31 -0
- package/src/metrics/metrics-card.scss +51 -0
- package/src/root.component.tsx +7 -3
- package/src/routes.json +25 -14
- package/src/schemas/index.ts +66 -0
- package/src/summary/summary.component.tsx +42 -0
- package/src/summary/summary.scss +10 -0
- package/src/switcher/content-switcher.component.tsx +220 -0
- package/src/switcher/content-switcher.scss +30 -0
- package/src/types/index.ts +336 -359
- package/src/utils/utils.ts +20 -2
- package/src/view-details/main/main.component.tsx +34 -0
- package/src/view-details/main/main.scss +45 -0
- package/src/view-details/panels/attachement.component.tsx +21 -0
- package/src/view-details/panels/autopsy.component.tsx +215 -0
- package/src/view-details/panels/billing-history.component.tsx +13 -0
- package/src/view-details/panels/observations/observation.component.tsx +57 -0
- package/src/view-details/panels/observations/observation.scss +24 -0
- package/src/view-details/panels/panels.scss +46 -0
- package/src/view-details/view-details.component.tsx +65 -0
- package/src/view-details/view-details.resource.ts +65 -0
- package/src/view-details/views-details.scss +82 -0
- package/translations/en.json +74 -21
- package/tsconfig.json +1 -1
- package/dist/113.js +0 -1
- package/dist/113.js.map +0 -1
- package/dist/160.js +0 -1
- package/dist/160.js.map +0 -1
- package/dist/299.js +0 -1
- package/dist/299.js.map +0 -1
- package/dist/433.js +0 -2
- package/dist/433.js.map +0 -1
- package/dist/441.js +0 -1
- package/dist/441.js.map +0 -1
- package/dist/496.js +0 -1
- package/dist/496.js.map +0 -1
- package/dist/511.js +0 -1
- package/dist/511.js.map +0 -1
- package/dist/603.js +0 -1
- package/dist/603.js.map +0 -1
- package/dist/610.js +0 -1
- package/dist/610.js.map +0 -1
- package/dist/612.js +0 -1
- package/dist/612.js.map +0 -1
- package/dist/656.js +0 -2
- package/dist/656.js.map +0 -1
- package/dist/752.js +0 -1
- package/dist/752.js.map +0 -1
- package/dist/754.js +0 -1
- package/dist/754.js.map +0 -1
- package/dist/781.js +0 -1
- package/dist/781.js.map +0 -1
- package/dist/801.js +0 -2
- package/dist/801.js.map +0 -1
- package/dist/817.js +0 -1
- package/dist/817.js.map +0 -1
- package/dist/877.js +0 -1
- package/dist/877.js.map +0 -1
- package/dist/924.js +0 -1
- package/dist/924.js.map +0 -1
- package/src/autosuggest/autosuggest.component.tsx +0 -162
- package/src/autosuggest/autosuggest.scss +0 -61
- package/src/autosuggest/patient-search-info.component.tsx +0 -75
- package/src/autosuggest/patient-search-info.scss +0 -62
- package/src/autosuggest/search-empty-state.component.tsx +0 -21
- package/src/autosuggest/search-empty-state.scss +0 -18
- package/src/card/avail-compartment.compartment.tsx +0 -94
- package/src/card/compartment-view.compartment.tsx +0 -62
- package/src/card/compartment.scss +0 -128
- package/src/card/compartmentSharing.component.tsx +0 -21
- package/src/card/compartmentSharing.scss +0 -24
- package/src/card/empty-compartment.component.tsx +0 -28
- package/src/card/empty-compartment.scss +0 -61
- package/src/component/main.component.tsx +0 -17
- package/src/component/next-of-kin-details/nextOfKinDetails.component.tsx +0 -50
- package/src/component/next-of-kin-details/nextOfKinDetails.scss +0 -37
- package/src/header/admitted-queue-header.component.tsx +0 -30
- package/src/header/admitted-queue-header.scss +0 -32
- package/src/header/morgue-header.component.tsx +0 -38
- package/src/header/morgue-header.scss +0 -95
- package/src/header/morgue-illustration.component.tsx +0 -13
- package/src/hook/useDeceasedPatients.ts +0 -12
- package/src/hook/useDischargedPatient.ts +0 -55
- package/src/hook/useMorgue.resource.ts +0 -163
- package/src/hook/useMortuaryAdmissionLocation.ts +0 -64
- package/src/tables/admitted-queue.component.tsx +0 -54
- package/src/tables/admitted-queue.scss +0 -62
- package/src/tables/discharge-queue.component.tsx +0 -87
- package/src/tables/generic-table.component.tsx +0 -140
- package/src/tables/generic-table.scss +0 -37
- package/src/tabs/tabs.component.tsx +0 -82
- package/src/tabs/tabs.scss +0 -15
- package/src/workspaces/admit-body.scss +0 -46
- package/src/workspaces/admit-body.workspace.tsx +0 -79
- package/src/workspaces/discharge-body.scss +0 -67
- package/src/workspaces/discharge-body.workspace.tsx +0 -329
- package/src/workspaces/patientAdditionalInfoForm.workspace.tsx +0 -562
- package/src/workspaces/swap-unit.scss +0 -46
- package/src/workspaces/swap-unit.workspace.tsx +0 -168
- /package/dist/{347.js.LICENSE.txt → 109.js.LICENSE.txt} +0 -0
- /package/dist/{656.js.LICENSE.txt → 373.js.LICENSE.txt} +0 -0
- /package/dist/{801.js.LICENSE.txt → 4.js.LICENSE.txt} +0 -0
- /package/dist/{433.js.LICENSE.txt → 420.js.LICENSE.txt} +0 -0
- /package/src/{component → deceased-patient-header}/deceasedInfo/deceased-info.scss +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
DataTableSkeleton,
|
|
4
|
+
ContentSwitcher,
|
|
5
|
+
Switch,
|
|
6
|
+
Tabs,
|
|
7
|
+
TabList,
|
|
8
|
+
Tab,
|
|
9
|
+
TabPanels,
|
|
10
|
+
TabPanel,
|
|
11
|
+
Search,
|
|
12
|
+
ComboBox,
|
|
13
|
+
SkeletonText,
|
|
14
|
+
} from '@carbon/react';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import styles from './content-switcher.scss';
|
|
17
|
+
import { CardHeader } from '@openmrs/esm-patient-common-lib';
|
|
18
|
+
import AwaitingBedLayout from '../bed-layout/awaiting/awaiting-bed-layout.component';
|
|
19
|
+
import BedLayout from '../bed-layout/admitted/admitted-bed-layout.component';
|
|
20
|
+
import { MortuaryLocationResponse, MortuaryPatient } from '../types';
|
|
21
|
+
import AwaitingBedLineListView from '../bed-linelist-view/awaiting/awaiting-bed-linelist-view.component';
|
|
22
|
+
import AdmittedBedLineListView from '../bed-linelist-view/admitted/admitted-bed-linelist-view.component';
|
|
23
|
+
import DischargedBedLayout from '../bed-layout/discharged/discharged-bed-layout.component';
|
|
24
|
+
import DischargedBedLineListView from '../bed-linelist-view/discharged/discharged-bed-line-view.component';
|
|
25
|
+
|
|
26
|
+
enum ViewType {
|
|
27
|
+
LIST = 0,
|
|
28
|
+
CARD = 1,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
enum TabType {
|
|
32
|
+
AWAITING_ADMISSION = 0,
|
|
33
|
+
ADMITTED = 1,
|
|
34
|
+
DISCHARGE = 2,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface TabConfig {
|
|
38
|
+
id: string;
|
|
39
|
+
labelKey: string;
|
|
40
|
+
defaultLabel: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface CustomContentSwitcherProps {
|
|
44
|
+
awaitingQueueDeceasedPatients: Array<MortuaryPatient>;
|
|
45
|
+
isLoading: boolean;
|
|
46
|
+
locationItems: Array<{
|
|
47
|
+
id: string;
|
|
48
|
+
text: string;
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}>;
|
|
51
|
+
selectedLocation: string;
|
|
52
|
+
admissionLocation: MortuaryLocationResponse | null;
|
|
53
|
+
isLoadingLocation: boolean;
|
|
54
|
+
isLoadingAdmission: boolean;
|
|
55
|
+
locationError: Error;
|
|
56
|
+
admissionError: Error;
|
|
57
|
+
onLocationChange: (data: { selectedItem: { id: string; text: string } }) => void;
|
|
58
|
+
mutate: () => void;
|
|
59
|
+
dischargedPatients?: any[];
|
|
60
|
+
isLoadingDischarge?: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const CustomContentSwitcher: React.FC<CustomContentSwitcherProps> = ({
|
|
64
|
+
awaitingQueueDeceasedPatients,
|
|
65
|
+
isLoading,
|
|
66
|
+
locationItems,
|
|
67
|
+
selectedLocation,
|
|
68
|
+
admissionLocation,
|
|
69
|
+
isLoadingLocation,
|
|
70
|
+
isLoadingAdmission,
|
|
71
|
+
locationError,
|
|
72
|
+
admissionError,
|
|
73
|
+
onLocationChange,
|
|
74
|
+
mutate,
|
|
75
|
+
dischargedPatients = [],
|
|
76
|
+
isLoadingDischarge = false,
|
|
77
|
+
}) => {
|
|
78
|
+
const { t } = useTranslation();
|
|
79
|
+
const [selectedView, setSelectedView] = React.useState<ViewType>(ViewType.LIST);
|
|
80
|
+
const [selectedTab, setSelectedTab] = React.useState<TabType>(TabType.AWAITING_ADMISSION);
|
|
81
|
+
|
|
82
|
+
const tabs: TabConfig[] = [
|
|
83
|
+
{ id: 'awaiting-admission', labelKey: 'awaitingAdmission', defaultLabel: 'Awaiting Admission' },
|
|
84
|
+
{ id: 'admitted', labelKey: 'admitted', defaultLabel: 'Admitted' },
|
|
85
|
+
{ id: 'discharge', labelKey: 'discharge', defaultLabel: 'Discharge' },
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
const handleViewChange = React.useCallback(({ index }: { index: number }) => {
|
|
89
|
+
setSelectedView(index as ViewType);
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
const handleTabChange = React.useCallback((state: { selectedIndex: number }) => {
|
|
93
|
+
setSelectedTab(state.selectedIndex as TabType);
|
|
94
|
+
}, []);
|
|
95
|
+
|
|
96
|
+
const renderTabContent = React.useCallback(
|
|
97
|
+
(tabIndex: TabType) => {
|
|
98
|
+
const isListView = selectedView === ViewType.LIST;
|
|
99
|
+
|
|
100
|
+
switch (tabIndex) {
|
|
101
|
+
case TabType.AWAITING_ADMISSION:
|
|
102
|
+
return isListView ? (
|
|
103
|
+
<div className={styles.listContainer}>
|
|
104
|
+
<AwaitingBedLineListView
|
|
105
|
+
awaitingQueueDeceasedPatients={awaitingQueueDeceasedPatients}
|
|
106
|
+
mortuaryLocation={admissionLocation}
|
|
107
|
+
isLoading={isLoading}
|
|
108
|
+
mutated={mutate}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
) : (
|
|
112
|
+
<AwaitingBedLayout
|
|
113
|
+
mortuaryLocation={admissionLocation}
|
|
114
|
+
awaitingQueueDeceasedPatients={awaitingQueueDeceasedPatients}
|
|
115
|
+
isLoading={isLoading}
|
|
116
|
+
mutated={mutate}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
case TabType.ADMITTED:
|
|
121
|
+
return isListView ? (
|
|
122
|
+
<div className={styles.listContainer}>
|
|
123
|
+
<AdmittedBedLineListView
|
|
124
|
+
AdmittedDeceasedPatient={admissionLocation}
|
|
125
|
+
isLoading={isLoadingAdmission}
|
|
126
|
+
mutate={mutate}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
) : (
|
|
130
|
+
<BedLayout AdmittedDeceasedPatient={admissionLocation} isLoading={isLoadingAdmission} mutate={mutate} />
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
case TabType.DISCHARGE:
|
|
134
|
+
return isListView ? (
|
|
135
|
+
<div className={styles.listContainer}>
|
|
136
|
+
<DischargedBedLineListView
|
|
137
|
+
AdmittedDeceasedPatient={admissionLocation}
|
|
138
|
+
isLoading={isLoadingDischarge}
|
|
139
|
+
mutate={mutate}
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
) : (
|
|
143
|
+
<DischargedBedLayout
|
|
144
|
+
AdmittedDeceasedPatient={admissionLocation}
|
|
145
|
+
isLoading={isLoadingDischarge}
|
|
146
|
+
mutate={mutate}
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
default:
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
[
|
|
155
|
+
selectedView,
|
|
156
|
+
t,
|
|
157
|
+
awaitingQueueDeceasedPatients,
|
|
158
|
+
isLoading,
|
|
159
|
+
admissionLocation,
|
|
160
|
+
isLoadingAdmission,
|
|
161
|
+
isLoadingDischarge,
|
|
162
|
+
dischargedPatients,
|
|
163
|
+
|
|
164
|
+
mutate,
|
|
165
|
+
],
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div className={styles.switcherContainer}>
|
|
170
|
+
<CardHeader title={t('mortuaryOperations', 'Mortuary operations')}>
|
|
171
|
+
{locationItems.length > 1 &&
|
|
172
|
+
(isLoadingLocation ? (
|
|
173
|
+
<SkeletonText />
|
|
174
|
+
) : (
|
|
175
|
+
<ComboBox
|
|
176
|
+
items={locationItems}
|
|
177
|
+
id="mortuaryLocations"
|
|
178
|
+
placeholder={t('chooseOptions', 'Choose options')}
|
|
179
|
+
itemToString={(item) => item?.text || ''}
|
|
180
|
+
onChange={onLocationChange}
|
|
181
|
+
selectedItem={locationItems.find((item) => item.id === selectedLocation) || null}
|
|
182
|
+
/>
|
|
183
|
+
))}
|
|
184
|
+
|
|
185
|
+
<ContentSwitcher size="sm" className={styles.switcher} selectedIndex={selectedView} onChange={handleViewChange}>
|
|
186
|
+
<Switch>{t('listView', 'List')}</Switch>
|
|
187
|
+
<Switch>{t('cardView', 'Card')}</Switch>
|
|
188
|
+
</ContentSwitcher>
|
|
189
|
+
</CardHeader>
|
|
190
|
+
<div className={styles.tabsContainer}>
|
|
191
|
+
<Search labelText={t('searchPatients', 'Search Patients')} />
|
|
192
|
+
<Tabs selectedIndex={selectedTab} onChange={handleTabChange}>
|
|
193
|
+
<div className={styles.tabListContainer}>
|
|
194
|
+
<TabList scrollDebounceWait={200}>
|
|
195
|
+
{tabs.map((tab) => (
|
|
196
|
+
<Tab key={tab.id}>
|
|
197
|
+
{t(tab.labelKey, tab.defaultLabel)}
|
|
198
|
+
{tab.id === 'awaiting-admission' && ` (${awaitingQueueDeceasedPatients?.length || 0})`}
|
|
199
|
+
{tab.id === 'admitted' &&
|
|
200
|
+
` (${
|
|
201
|
+
admissionLocation?.bedLayouts?.reduce((total, bed) => total + (bed.patients?.length || 0), 0) || 0
|
|
202
|
+
})`}
|
|
203
|
+
{tab.id === 'discharge' && ` (${dischargedPatients?.length || 0})`}
|
|
204
|
+
</Tab>
|
|
205
|
+
))}
|
|
206
|
+
</TabList>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<TabPanels>
|
|
210
|
+
{tabs.map((_, index) => (
|
|
211
|
+
<TabPanel key={index}>{renderTabContent(index as TabType)}</TabPanel>
|
|
212
|
+
))}
|
|
213
|
+
</TabPanels>
|
|
214
|
+
</Tabs>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export default CustomContentSwitcher;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
|
|
4
|
+
.cardContainer {
|
|
5
|
+
background-color: colors.$white-0;
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
padding: layout.$spacing-05;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.switcher {
|
|
13
|
+
width: 150px;
|
|
14
|
+
margin-right: layout.$spacing-03;
|
|
15
|
+
margin-left: layout.$spacing-03;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.switcherContainer {
|
|
19
|
+
margin-right: layout.$spacing-06;
|
|
20
|
+
margin-left: layout.$spacing-06;
|
|
21
|
+
border: 1px solid colors.$gray-20;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tabListContainer {
|
|
25
|
+
background: colors.$gray-20;
|
|
26
|
+
padding-top: layout.$spacing-04;
|
|
27
|
+
}
|
|
28
|
+
.tabsContainer {
|
|
29
|
+
margin-top: layout.$spacing-04;
|
|
30
|
+
}
|