@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Button, Tile } from '@carbon/react';
|
|
2
|
+
import { Add } from '@carbon/react/icons';
|
|
3
|
+
import { EmptyDataIllustration } from '@openmrs/esm-patient-common-lib';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import styles from './search-empty-state.scss';
|
|
6
|
+
|
|
7
|
+
type SearchEmptyStateProps = {
|
|
8
|
+
searchValue?: string;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const SearchEmptyState: React.FC<SearchEmptyStateProps> = ({ searchValue, message }) => {
|
|
13
|
+
return (
|
|
14
|
+
<Tile className={styles.container}>
|
|
15
|
+
<EmptyDataIllustration height="50" width="50" />
|
|
16
|
+
<p>{message}</p>
|
|
17
|
+
</Tile>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default SearchEmptyState;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/colors';
|
|
3
|
+
|
|
4
|
+
.container {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
gap: layout.$spacing-01;
|
|
10
|
+
font-size: xx-small;
|
|
11
|
+
background-color: colors.$white;
|
|
12
|
+
border: solid 1px colors.$gray-30;
|
|
13
|
+
color: colors.$gray-50;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.emptyIllustration {
|
|
17
|
+
color: colors.$teal-70;
|
|
18
|
+
}
|
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import styles from './compartment.scss';
|
|
3
|
-
import { Button, Tag, InlineLoading } from '@carbon/react';
|
|
1
|
+
import { Tag } from '@carbon/react';
|
|
4
2
|
import { View } from '@carbon/react/icons';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
3
|
+
import { ConfigurableLink, useVisit } from '@openmrs/esm-framework';
|
|
4
|
+
import capitalize from 'lodash-es/capitalize';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { toUpperCase } from '../helpers/expression-helper';
|
|
8
|
+
import { Patient } from '../types';
|
|
8
9
|
import { convertDateToDays } from '../utils/utils';
|
|
9
|
-
import
|
|
10
|
-
import { DeceasedInfo } from '../types';
|
|
11
|
-
import usePerson, { useActiveMorgueVisit } from '../hook/useMorgue.resource';
|
|
10
|
+
import styles from './compartment.scss';
|
|
12
11
|
|
|
13
12
|
interface AvailableCompartmentProps {
|
|
14
|
-
patientInfo:
|
|
15
|
-
|
|
13
|
+
patientInfo: Patient;
|
|
14
|
+
bedNumber: string;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const { data: activeDeceased, error: isActiveError, isLoading: isActiveLoading } = useActiveMorgueVisit(patientUuid);
|
|
17
|
+
const getPatientAndPersionUuid = (patientInfo) => ({
|
|
18
|
+
personUuid: patientInfo?.person?.uuid || null,
|
|
19
|
+
patientUuid: patientInfo?.uuid || null,
|
|
20
|
+
});
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
const AvailableCompartment: React.FC<AvailableCompartmentProps> = ({ patientInfo, bedNumber }) => {
|
|
23
|
+
const { personUuid, patientUuid } = getPatientAndPersionUuid(patientInfo);
|
|
24
|
+
const { t } = useTranslation();
|
|
25
|
+
const { currentVisit } = useVisit(patientUuid);
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<InlineLoading
|
|
29
|
-
status="active"
|
|
30
|
-
iconDescription="Loading"
|
|
31
|
-
description={t('pullingCompartment', 'Pulling compartments data.....')}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
27
|
+
const causeOfDeathDisplay = patientInfo?.person?.causeOfDeath?.display;
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
const causeOfDeathMessage = causeOfDeathDisplay
|
|
30
|
+
? causeOfDeathDisplay.toLowerCase() === 'unknown'
|
|
31
|
+
? causeOfDeathDisplay
|
|
32
|
+
: capitalize(causeOfDeathDisplay)
|
|
33
|
+
: '--';
|
|
39
34
|
|
|
40
|
-
const
|
|
41
|
-
|
|
35
|
+
const causeOfDeathTagType = causeOfDeathDisplay
|
|
36
|
+
? causeOfDeathDisplay.toLowerCase() === 'unknown'
|
|
37
|
+
? 'red'
|
|
38
|
+
: 'undefined'
|
|
39
|
+
: 'undefined';
|
|
42
40
|
|
|
43
|
-
const
|
|
44
|
-
const causeOfDeathTagType = causeOfDeathDisplay?.toLowerCase() === 'unknown' ? 'red' : 'undefined';
|
|
41
|
+
const startDate = currentVisit?.startDatetime;
|
|
45
42
|
|
|
43
|
+
const lengthOfStay = `${convertDateToDays(startDate)} ${
|
|
44
|
+
convertDateToDays(startDate) === 1 ? t('day', 'Day') : t('days', 'Days')
|
|
45
|
+
}`;
|
|
46
|
+
const lengthOfStayDays = parseInt(lengthOfStay.match(/\d+/)?.[0] || '0', 10);
|
|
47
|
+
const timeSpentTagType = lengthOfStayDays > 17 ? 'red' : 'blue';
|
|
46
48
|
return (
|
|
47
49
|
<div className={styles.cardView}>
|
|
48
50
|
<div className={styles.cardRow}>
|
|
49
51
|
<div className={styles.cardLabelWrapper}>
|
|
50
|
-
<div className={styles.cardLabel}>{
|
|
52
|
+
<div className={styles.cardLabel}>{bedNumber}</div>
|
|
51
53
|
</div>
|
|
52
54
|
<span className={styles.deceasedName}>
|
|
53
|
-
{toUpperCase(person?.display)}
|
|
55
|
+
{toUpperCase(patientInfo?.person?.display)}
|
|
54
56
|
<span className={styles.middot}>·</span>
|
|
55
|
-
<span className={styles.age}>{person?.age} Yrs</span>
|
|
57
|
+
<span className={styles.age}>{patientInfo?.person?.age} Yrs</span>
|
|
56
58
|
</span>
|
|
57
59
|
</div>
|
|
58
60
|
<div className={styles.cardRow}>
|
|
@@ -60,10 +62,10 @@ const AvailableCompartment: React.FC<AvailableCompartmentProps> = ({ patientInfo
|
|
|
60
62
|
{t('Reason', 'Reason ')}
|
|
61
63
|
{causeOfDeathTagType === 'red' ? (
|
|
62
64
|
<Tag size="md" type={causeOfDeathTagType}>
|
|
63
|
-
{
|
|
65
|
+
{causeOfDeathMessage}
|
|
64
66
|
</Tag>
|
|
65
67
|
) : (
|
|
66
|
-
<span className={styles.causeDisplay}>{
|
|
68
|
+
<span className={styles.causeDisplay}>{causeOfDeathMessage}</span>
|
|
67
69
|
)}
|
|
68
70
|
</span>
|
|
69
71
|
<span className={styles.viewDetails}>
|
|
@@ -79,12 +81,9 @@ const AvailableCompartment: React.FC<AvailableCompartmentProps> = ({ patientInfo
|
|
|
79
81
|
<span className={styles.deceasedReason}>
|
|
80
82
|
{t('timeSpent', 'Time spent ')}
|
|
81
83
|
<Tag size="md" type={timeSpentTagType}>
|
|
82
|
-
{
|
|
84
|
+
{lengthOfStay}
|
|
83
85
|
</Tag>
|
|
84
86
|
</span>
|
|
85
|
-
<Tag size="md" type="green">
|
|
86
|
-
{patientInfo?.status}
|
|
87
|
-
</Tag>
|
|
88
87
|
</div>
|
|
89
88
|
</div>
|
|
90
89
|
);
|
|
@@ -4,25 +4,48 @@ import EmptyCompartment from './empty-compartment.component';
|
|
|
4
4
|
import AvailableCompartment from './avail-compartment.compartment';
|
|
5
5
|
import EmptyDeceasedSearch from '../empty-state/empty-morgue-admission.component';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import {
|
|
7
|
+
import { useAdmissionLocation } from '../hook/useMortuaryAdmissionLocation';
|
|
8
|
+
import { InlineLoading } from '@carbon/react';
|
|
9
|
+
import CompartmentShareDivider from './compartmentSharing.component';
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
patientVisit: { results: DeceasedInfo[] };
|
|
11
|
-
searchQuery: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const CompartmentView: React.FC<CompartmentViewProps> = ({ patientVisit, searchQuery }) => {
|
|
11
|
+
const CompartmentView: React.FC = () => {
|
|
15
12
|
const { t } = useTranslation();
|
|
13
|
+
const { admissionLocation, isLoading } = useAdmissionLocation();
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
if (isLoading) {
|
|
16
|
+
return (
|
|
17
|
+
<InlineLoading
|
|
18
|
+
status="active"
|
|
19
|
+
iconDescription="Loading"
|
|
20
|
+
description={t('pullingCompartment', 'Pulling compartments data...')}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
20
24
|
|
|
21
|
-
return
|
|
25
|
+
return admissionLocation?.bedLayouts?.length > 0 ? (
|
|
22
26
|
<div className={styles.allPatientCardWrapper}>
|
|
23
|
-
{
|
|
24
|
-
<div key={
|
|
25
|
-
|
|
27
|
+
{admissionLocation?.bedLayouts?.map((bed, index) => (
|
|
28
|
+
<div key={bed.bedUuid} className={styles.cardRow}>
|
|
29
|
+
{bed.status === 'OCCUPIED' ? (
|
|
30
|
+
<>
|
|
31
|
+
{bed.patients.length > 1 ? (
|
|
32
|
+
<div className={styles.verticalLayout}>
|
|
33
|
+
{bed.patients.map((patient, patientIndex) => (
|
|
34
|
+
<React.Fragment key={patient.uuid}>
|
|
35
|
+
<AvailableCompartment patientInfo={patient} bedNumber={bed?.bedNumber} />
|
|
36
|
+
{patientIndex < bed.patients.length - 1 && <CompartmentShareDivider />}
|
|
37
|
+
</React.Fragment>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
) : (
|
|
41
|
+
<div className={styles.horizontalLayout}>
|
|
42
|
+
<AvailableCompartment patientInfo={bed.patients[0]} bedNumber={bed?.bedNumber} />
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
</>
|
|
46
|
+
) : (
|
|
47
|
+
<EmptyCompartment bedNumber={bed?.bedNumber} />
|
|
48
|
+
)}
|
|
26
49
|
</div>
|
|
27
50
|
))}
|
|
28
51
|
</div>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
grid-template-columns: repeat(2, 1fr);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
.cardView {
|
|
19
20
|
width: 100%;
|
|
20
21
|
max-width: 380px;
|
|
@@ -24,7 +25,6 @@
|
|
|
24
25
|
align-items: center;
|
|
25
26
|
padding: layout.$spacing-04;
|
|
26
27
|
background-color: colors.$gray-20;
|
|
27
|
-
margin-bottom: layout.$spacing-05;
|
|
28
28
|
|
|
29
29
|
:global(.omrs-breakpoint-lt-desktop) & {
|
|
30
30
|
padding: layout.$spacing-03;
|
|
@@ -46,22 +46,30 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
.verticalLayout {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.horizontalLayout {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: row;
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
49
61
|
.cardLabelWrapper {
|
|
50
62
|
display: flex;
|
|
51
63
|
justify-content: center;
|
|
52
64
|
align-items: center;
|
|
53
|
-
width: layout.$spacing-
|
|
54
|
-
height: layout.$spacing-07;
|
|
55
|
-
border-radius: 50%;
|
|
56
|
-
background-color: colors.$blue-60;
|
|
65
|
+
width: layout.$spacing-10;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
.cardLabel {
|
|
60
69
|
font-size: layout.$spacing-05;
|
|
61
70
|
line-height: 1.29;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
color: colors.$white;
|
|
71
|
+
color: colors.$blue-60;
|
|
72
|
+
width: layout.$spacing-13;
|
|
65
73
|
}
|
|
66
74
|
|
|
67
75
|
.deceasedName,
|
|
@@ -80,11 +88,6 @@
|
|
|
80
88
|
font-size: type.type-scale(2);
|
|
81
89
|
}
|
|
82
90
|
|
|
83
|
-
.assignButton {
|
|
84
|
-
width: 100%;
|
|
85
|
-
margin-top: layout.$spacing-05;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
91
|
.viewDetailsLink {
|
|
89
92
|
margin: 0;
|
|
90
93
|
padding: 0;
|
|
@@ -103,11 +106,13 @@
|
|
|
103
106
|
color: colors.$gray-60;
|
|
104
107
|
font-size: type.type-scale(2);
|
|
105
108
|
}
|
|
109
|
+
|
|
106
110
|
.causeDisplay {
|
|
107
111
|
font-size: type.type-scale(2);
|
|
108
112
|
color: colors.$gray-60;
|
|
109
113
|
text-align: justify;
|
|
110
114
|
}
|
|
115
|
+
|
|
111
116
|
.emptyStateContainer {
|
|
112
117
|
display: flex;
|
|
113
118
|
justify-content: center;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SkeletonText, Tag } from '@carbon/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import styles from './compartmentSharing.scss';
|
|
5
|
+
|
|
6
|
+
interface CompartmentShareDividerProps {
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const CompartmentShareDivider: React.FC<CompartmentShareDividerProps> = ({ isLoading }) => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles.compartmentDivider}>
|
|
14
|
+
<div className={styles.compartmentDividerLine}></div>
|
|
15
|
+
{isLoading ? <SkeletonText /> : <Tag>{t('sharing', 'Sharing')}</Tag>}
|
|
16
|
+
<div className={styles.compartmentDividerLine}></div>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default CompartmentShareDivider;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
|
|
5
|
+
.compartmentDivider {
|
|
6
|
+
background-color: colors.$gray-80;
|
|
7
|
+
color: colors.$white;
|
|
8
|
+
padding: layout.$spacing-02;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
width: 95.4%;
|
|
13
|
+
|
|
14
|
+
:global(.omrs-breakpoint-lt-desktop) & {
|
|
15
|
+
padding: layout.$spacing-01;
|
|
16
|
+
width: 92%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.compartmentDividerLine {
|
|
21
|
+
height: 1px;
|
|
22
|
+
background-color: colors.$white;
|
|
23
|
+
width: 30%;
|
|
24
|
+
}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import styles from './compartment.scss';
|
|
3
|
-
import { Button } from '@carbon/react';
|
|
2
|
+
import styles from './empty-compartment.scss';
|
|
3
|
+
import { Button, Tile } from '@carbon/react';
|
|
4
4
|
import { Movement } from '@carbon/react/icons';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
|
7
|
+
interface EmptyCompartmentProps {
|
|
8
|
+
bedNumber: string;
|
|
9
|
+
}
|
|
6
10
|
|
|
7
|
-
const EmptyCompartment: React.FC = () => {
|
|
11
|
+
const EmptyCompartment: React.FC<EmptyCompartmentProps> = ({ bedNumber }) => {
|
|
8
12
|
const { t } = useTranslation();
|
|
13
|
+
const handleSearchAdmitWorkspace = () => {
|
|
14
|
+
launchWorkspace('admit-body-form');
|
|
15
|
+
};
|
|
9
16
|
return (
|
|
10
17
|
<div className={styles.cardView}>
|
|
11
18
|
<div className={`${styles.cardRow} ${styles.centeredContent}`}>
|
|
12
19
|
<div className={styles.cardLabelWrapper}>
|
|
13
|
-
<div className={styles.cardLabel}>
|
|
20
|
+
<div className={styles.cardLabel}>{bedNumber}</div>
|
|
14
21
|
</div>
|
|
15
22
|
<span className={styles.noCompartment}>{t('empty', 'Empty')}</span>
|
|
16
23
|
</div>
|
|
17
|
-
<Button className={styles.assignButton} kind="primary" renderIcon={Movement}>
|
|
18
|
-
Assign
|
|
19
|
-
</Button>
|
|
20
24
|
</div>
|
|
21
25
|
);
|
|
22
26
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
|
|
5
|
+
.cardView {
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 380px;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: flex-start;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: layout.$spacing-04;
|
|
13
|
+
background-color: colors.$gray-20;
|
|
14
|
+
|
|
15
|
+
:global(.omrs-breakpoint-lt-desktop) & {
|
|
16
|
+
padding: layout.$spacing-03;
|
|
17
|
+
gap: layout.$spacing-02;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.cardRow {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 100%;
|
|
27
|
+
margin-bottom: layout.$spacing-03;
|
|
28
|
+
|
|
29
|
+
&.centeredContent {
|
|
30
|
+
justify-content: center;
|
|
31
|
+
text-align: center;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.cardLabelWrapper {
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
width: layout.$spacing-10;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cardLabel {
|
|
43
|
+
font-size: layout.$spacing-05;
|
|
44
|
+
line-height: 1.29;
|
|
45
|
+
color: colors.$blue-60;
|
|
46
|
+
width: layout.$spacing-13;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.deceasedName,
|
|
50
|
+
.noCompartment {
|
|
51
|
+
font-size: type.type-scale(2);
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
color: colors.$black;
|
|
54
|
+
width: 100%;
|
|
55
|
+
margin-right: layout.$spacing-09;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.assignButton {
|
|
59
|
+
width: 100%;
|
|
60
|
+
margin-top: layout.$spacing-05;
|
|
61
|
+
}
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import styles from './deceased-info.scss';
|
|
5
5
|
import { formatDeceasedName } from '../../utils/utils';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import usePerson from '../../hook/useMorgue.resource';
|
|
7
|
+
import { usePerson } from '../../hook/useMorgue.resource';
|
|
8
8
|
|
|
9
9
|
const DeceasedInfo: React.FC<{ patientUuid: string }> = ({ patientUuid }) => {
|
|
10
10
|
const { isLoading, patient, error } = usePatient(patientUuid);
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { MorgueHeader } from '../header/morgue-header.component';
|
|
3
4
|
import { MorgueTabs } from '../tabs/tabs.component';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useDeceasedPatient } from '../hook/useMorgue.resource';
|
|
6
5
|
|
|
7
6
|
const MainComponent: React.FC = () => {
|
|
8
7
|
const { t } = useTranslation();
|
|
9
|
-
const { data: deceasedPatients, isLoading } = useDeceasedPatient();
|
|
10
|
-
|
|
11
|
-
const awaitingCount = isLoading ? null : deceasedPatients?.filter((p) => p.status === 'awaiting').length || 0;
|
|
12
|
-
const admittedCount = isLoading ? null : deceasedPatients?.filter((p) => p.status === 'admitted').length || 0;
|
|
13
|
-
const dischargedCount = isLoading ? null : deceasedPatients?.filter((p) => p.status === 'discharged').length || 0;
|
|
14
8
|
|
|
15
9
|
return (
|
|
16
10
|
<div className={`omrs-main-content`}>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './nextOfKinDetails.scss';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Tag } from '@carbon/react';
|
|
5
|
+
import toUpper from 'lodash/toUpper';
|
|
6
|
+
import capitalize from 'lodash/capitalize';
|
|
7
|
+
import { formatDateTime } from '../../utils/utils';
|
|
8
|
+
import { CardHeader } from '@openmrs/esm-patient-common-lib';
|
|
9
|
+
|
|
10
|
+
interface NextOfKinProps {
|
|
11
|
+
nextOfKin?: {
|
|
12
|
+
name: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
address: string;
|
|
15
|
+
relationship: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const NextOfKinDetails: React.FC<NextOfKinProps> = ({ nextOfKin }) => {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
|
|
22
|
+
if (!nextOfKin) {
|
|
23
|
+
return <div>{t('noAvailable', 'No available')}</div>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className={styles.nextOfKinDetailsContainer}>
|
|
28
|
+
<div className={styles.nextOfKinTitle}>
|
|
29
|
+
<span>{toUpper(t('nextOfKin', 'Next of Kin'))}</span>
|
|
30
|
+
<span>{formatDateTime(new Date())}</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div className={styles.nextOfKinName}>
|
|
33
|
+
<span>
|
|
34
|
+
{toUpper(nextOfKin?.name)} ·
|
|
35
|
+
<Tag size="md">{capitalize(nextOfKin?.relationship)}</Tag>
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
<div className={styles.nextOfKinInfo}>
|
|
39
|
+
<span className={styles.nextOfKinPhone}>
|
|
40
|
+
{t('phone', 'Phone')}: {nextOfKin?.phone}
|
|
41
|
+
</span>
|
|
42
|
+
<span>
|
|
43
|
+
{t('address', 'Address')}: {nextOfKin?.address}
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default NextOfKinDetails;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
|
|
5
|
+
.nextOfKinDetailsContainer {
|
|
6
|
+
background-color: colors.$white;
|
|
7
|
+
width: 50%;
|
|
8
|
+
padding: layout.$spacing-04;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.nextOfKinTitle {
|
|
12
|
+
@include type.type-style('label-02');
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
align-items: center;
|
|
16
|
+
color: colors.$gray-70;
|
|
17
|
+
gap: layout.$spacing-01;
|
|
18
|
+
margin-left: layout.$spacing-02;
|
|
19
|
+
margin-right: layout.$spacing-02;
|
|
20
|
+
margin-bottom: layout.$spacing-02;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
}
|
|
23
|
+
.nextOfKinName {
|
|
24
|
+
margin-left: layout.$spacing-02;
|
|
25
|
+
margin-right: layout.$spacing-02;
|
|
26
|
+
}
|
|
27
|
+
.nextOfKinInfo {
|
|
28
|
+
margin-left: layout.$spacing-02;
|
|
29
|
+
margin-right: layout.$spacing-02;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.middot {
|
|
33
|
+
margin: 0 layout.$spacing-01;
|
|
34
|
+
}
|
|
35
|
+
.nextOfKinPhone {
|
|
36
|
+
margin-right: layout.$spacing-05;
|
|
37
|
+
}
|
package/src/config-schema.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { Type } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
3
|
export const configSchema = {
|
|
4
|
-
autopsyEncounterUuid: {
|
|
5
|
-
_type: Type.String,
|
|
6
|
-
_description: 'Encounter UUID for autopsy',
|
|
7
|
-
_default: '',
|
|
8
|
-
},
|
|
9
|
-
formsList: {
|
|
10
|
-
_type: Type.Object,
|
|
11
|
-
_description: 'List of form UUIDs',
|
|
12
|
-
_default: {
|
|
13
|
-
autopsyFormUuid: '',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
4
|
morgueVisitTypeUuid: {
|
|
17
5
|
_type: Type.String,
|
|
18
6
|
_description: ' UUID for morgue visit',
|
|
@@ -21,7 +9,7 @@ export const configSchema = {
|
|
|
21
9
|
morgueDepartmentServiceTypeUuid: {
|
|
22
10
|
_type: Type.String,
|
|
23
11
|
_description: ' UUID for morgue department service type',
|
|
24
|
-
_default: '
|
|
12
|
+
_default: '5b9e6cd1-f836-4144-91e4-401c58dd62af',
|
|
25
13
|
},
|
|
26
14
|
insurancepaymentModeUuid: {
|
|
27
15
|
_type: Type.String,
|
|
@@ -36,7 +24,7 @@ export const configSchema = {
|
|
|
36
24
|
tagNumberUuid: {
|
|
37
25
|
_type: Type.String,
|
|
38
26
|
_description: 'UUID for tag number concept',
|
|
39
|
-
_default: '
|
|
27
|
+
_default: 'f2b35679-7ba9-4619-92cb-6872b0c6bf57',
|
|
40
28
|
},
|
|
41
29
|
morgueAdmissionEncounterType: {
|
|
42
30
|
_type: Type.String,
|
|
@@ -48,6 +36,26 @@ export const configSchema = {
|
|
|
48
36
|
_description: 'Encounter type for morgue discharge',
|
|
49
37
|
_default: '3d618f40b-b5a3-4f17-81c8-2f04e2aad58e',
|
|
50
38
|
},
|
|
39
|
+
nextOfKinNameUuid: {
|
|
40
|
+
_type: Type.String,
|
|
41
|
+
_description: 'UUID for next of kin name concept',
|
|
42
|
+
_default: '830bef6d-b01f-449d-9f8d-ac0fede8dbd3',
|
|
43
|
+
},
|
|
44
|
+
nextOfKinRelationshipUuid: {
|
|
45
|
+
_type: Type.String,
|
|
46
|
+
_description: 'UUID for next of kin relationship concept',
|
|
47
|
+
_default: 'd0aa9fd1-2ac5-45d8-9c5e-4317c622c8f5',
|
|
48
|
+
},
|
|
49
|
+
nextOfKinAddressUuid: {
|
|
50
|
+
_type: Type.String,
|
|
51
|
+
_description: 'UUID for next of kin address concept',
|
|
52
|
+
_default: '7cf22bec-d90a-46ad-9f48-035952261294',
|
|
53
|
+
},
|
|
54
|
+
nextOfKinPhoneUuid: {
|
|
55
|
+
_type: Type.String,
|
|
56
|
+
_description: 'UUID for next of kin phone concept',
|
|
57
|
+
_default: '342a1d39-c541-4b29-8818-930916f4c2dc',
|
|
58
|
+
},
|
|
51
59
|
visitPaymentMethodAttributeUuid: {
|
|
52
60
|
_type: Type.String,
|
|
53
61
|
_description: 'UUID for visit payment method attribute',
|
|
@@ -56,17 +64,17 @@ export const configSchema = {
|
|
|
56
64
|
obNumberUuid: {
|
|
57
65
|
_type: Type.String,
|
|
58
66
|
_description: 'UUID for ob number concept',
|
|
59
|
-
_default: '
|
|
67
|
+
_default: '0dffecb3-2dc4-4d56-8cd4-56ba38579c69',
|
|
60
68
|
},
|
|
61
69
|
policeNameUuid: {
|
|
62
70
|
_type: Type.String,
|
|
63
71
|
_description: 'UUID for police name concept',
|
|
64
|
-
_default: '
|
|
72
|
+
_default: 'd889f05b-0d9b-462f-ae8e-2e9be79fd954',
|
|
65
73
|
},
|
|
66
74
|
burialPermitNumberUuid: {
|
|
67
75
|
_type: Type.String,
|
|
68
76
|
_description: 'UUID for burial permit number concept',
|
|
69
|
-
_default: '
|
|
77
|
+
_default: 'da524812-5600-4677-ba26-eb61eb925eef',
|
|
70
78
|
},
|
|
71
79
|
policeIDNumber: {
|
|
72
80
|
_type: Type.String,
|
|
@@ -81,7 +89,7 @@ export const configSchema = {
|
|
|
81
89
|
dischargeAreaUuid: {
|
|
82
90
|
_type: Type.String,
|
|
83
91
|
_description: 'UUID for discharge area concept',
|
|
84
|
-
_default: '
|
|
92
|
+
_default: '89ebccf1-4cca-4195-aeff-3e75fdf976b4',
|
|
85
93
|
},
|
|
86
94
|
adminUuid: {
|
|
87
95
|
_type: Type.String,
|
|
@@ -113,16 +121,16 @@ export interface BillingConfig {
|
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
export type ConfigObject = {
|
|
116
|
-
formsList: {
|
|
117
|
-
autopsyFormUuid: string;
|
|
118
|
-
};
|
|
119
|
-
autopsyEncounterUuid: string;
|
|
120
124
|
morgueVisitTypeUuid: string;
|
|
121
125
|
morgueDepartmentServiceTypeUuid: string;
|
|
122
126
|
insurancepaymentModeUuid: string;
|
|
123
127
|
morgueCompartmentTagUuid: string;
|
|
124
128
|
tagNumberUuid: string;
|
|
125
129
|
morgueAdmissionEncounterType: string;
|
|
130
|
+
nextOfKinNameUuid: string;
|
|
131
|
+
nextOfKinRelationshipUuid: string;
|
|
132
|
+
nextOfKinAddressUuid: string;
|
|
133
|
+
nextOfKinPhoneUuid: string;
|
|
126
134
|
visitPaymentMethodAttributeUuid: string;
|
|
127
135
|
policeStatementUuid: string;
|
|
128
136
|
obNumberUuid: string;
|