@ampath/esm-dha-workflow-app 4.0.0-next.4 → 4.0.0-next.41
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/dist/104.js +2 -0
- package/dist/104.js.LICENSE.txt +9 -0
- package/dist/104.js.map +1 -0
- package/dist/15.js +1 -0
- package/dist/15.js.map +1 -0
- package/dist/246.js +2 -0
- package/dist/246.js.LICENSE.txt +54 -0
- package/dist/246.js.map +1 -0
- package/dist/327.js +1 -0
- package/dist/327.js.map +1 -0
- package/dist/339.js +1 -0
- package/dist/339.js.map +1 -0
- package/dist/709.js +1 -0
- package/dist/709.js.map +1 -0
- package/dist/710.js +2 -0
- package/dist/710.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/752.js +1 -0
- package/dist/752.js.map +1 -0
- package/dist/833.js +1 -0
- package/dist/833.js.map +1 -0
- package/dist/91.js +1 -1
- package/dist/91.js.map +1 -1
- package/dist/93.js +1 -0
- package/dist/93.js.map +1 -0
- package/dist/938.js +1 -0
- package/dist/938.js.map +1 -0
- package/dist/esm-dha-workflow-app.js +1 -0
- package/dist/{openmrs-esm-home-app.js.buildmanifest.json → esm-dha-workflow-app.js.buildmanifest.json} +294 -55
- package/dist/{openmrs-esm-home-app.js.map → esm-dha-workflow-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 +3 -3
- package/src/accounting/accounting.component.tsx +13 -0
- package/src/appointments/appointments.component.tsx +13 -0
- package/src/bookings/daily/daily-bookings.component.scss +38 -0
- package/src/bookings/daily/daily-bookings.component.tsx +138 -0
- package/src/bookings/daily/daily-bookings.resource.ts +27 -0
- package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
- package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
- package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
- package/src/bookings/types/index.ts +68 -0
- package/src/config-schema.ts +132 -32
- package/src/dashboard/dashboard.component.scss +7 -0
- package/src/dashboard/dashboard.component.tsx +63 -0
- package/src/dashboard/overview/overview.component.scss +70 -0
- package/src/dashboard/overview/overview.component.tsx +107 -0
- package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
- package/src/hooks/useActions.ts +165 -0
- package/src/index.ts +23 -2
- package/src/laboratory/laboratory.component.tsx +13 -0
- package/src/left-panel/left-panel.component.tsx +20 -0
- package/src/left-panel/left-panel.scss +42 -0
- package/src/mch/queues/consultation/mch-consultation.tsx +18 -0
- package/src/mch/queues/triage/mch-triage.tsx +15 -0
- package/src/modals/sign-off-modal.scss +7 -0
- package/src/modals/sign-off-modal.tsx +52 -0
- package/src/mortuary/mortuary.component.tsx +13 -0
- package/src/pharmacy/pharmacy.component.tsx +13 -0
- package/src/registry/client-details/client-details.tsx +40 -0
- package/src/registry/modal/client-details-modal/client-details-modal.scss +28 -0
- package/src/registry/modal/client-details-modal/client-details-modal.tsx +81 -0
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +31 -0
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +186 -0
- package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +34 -0
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +302 -0
- package/src/registry/payment-details/payment-options/payment-options.tsx +21 -0
- package/src/registry/registry.component.scss +83 -0
- package/src/registry/registry.component.tsx +397 -2
- package/src/registry/registry.resource.ts +60 -0
- package/src/registry/types/index.ts +309 -0
- package/src/registry/utils/error-handler.ts +37 -0
- package/src/registry/utils/format-dependant-display-data.ts +8 -0
- package/src/registry/utils/hie-adapter.ts +56 -0
- package/src/registry/utils/hie-client-adapter.ts +309 -0
- package/src/registry/utils/mask-data.ts +21 -0
- package/src/resources/hie-amrs-automatic-registration.service.ts +16 -0
- package/src/resources/identifier-types.ts +27 -0
- package/src/resources/patient-resource.ts +62 -0
- package/src/resources/patient-search.resource.ts +22 -0
- package/src/resources/queue.resource.ts +60 -0
- package/src/resources/visit.resource.ts +38 -0
- package/src/root.component.tsx +42 -30
- package/src/root.scss +5 -9
- package/src/routes.json +43 -4
- package/src/service-queues/action-button.component.tsx +34 -0
- package/src/service-queues/action-overflow-menu-item.component.tsx +34 -0
- package/src/service-queues/consultation/consultation.component.scss +7 -0
- package/src/service-queues/consultation/consultation.component.tsx +15 -0
- package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
- package/src/service-queues/metrics/metrics-cards/metrics-card.component.tsx +86 -0
- package/src/service-queues/metrics/metrics-cards/metrics-card.scss +106 -0
- package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
- package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
- package/src/service-queues/metrics/metrics-container.scss +36 -0
- package/src/service-queues/metrics/metrics.resource.ts +65 -0
- package/src/service-queues/modals/move/move-patient.component.scss +35 -0
- package/src/service-queues/modals/move/move-patient.component.tsx +138 -0
- package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
- package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
- package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
- package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
- package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
- package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
- package/src/service-queues/queue-list/queue-list.component.scss +19 -0
- package/src/service-queues/queue-list/queue-list.component.tsx +169 -0
- package/src/service-queues/queue-room.component.tsx +39 -0
- package/src/service-queues/room/room.component.tsx +58 -0
- package/src/service-queues/service-queue/service-queue.component.scss +14 -0
- package/src/service-queues/service-queue/service-queue.component.tsx +245 -0
- package/src/service-queues/service-queue/stats/stat-card/stat-card.component.scss +10 -0
- package/src/service-queues/service-queue/stats/stat-card/stat-card.component.tsx +23 -0
- package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +7 -0
- package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +34 -0
- package/src/service-queues/service-queue.scss +27 -0
- package/src/service-queues/service-queue.tsx +31 -0
- package/src/service-queues/service-queues.resource.ts +177 -0
- package/src/service-queues/service.resource.ts +28 -0
- package/src/shared/constants/civil-status.ts +29 -0
- package/src/shared/constants/concepts.ts +30 -0
- package/src/shared/constants/index.ts +1 -0
- package/src/shared/constants/person-attributes.ts +33 -0
- package/src/shared/services/location.resource.ts +9 -0
- package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
- package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
- package/src/shared/ui/timer/timer.component.scss +5 -0
- package/src/shared/ui/timer/timer.component.tsx +40 -0
- package/src/shared/utils/get-base-url.ts +17 -0
- package/src/side-nav-menu/nav-link-config.ts +82 -0
- package/src/side-nav-menu/nav-links.tsx +31 -11
- package/src/triage/metrics/attended-patients.extension.tsx +42 -0
- package/src/triage/metrics/metrics.scss +36 -0
- package/src/triage/metrics/triage-metrics.component.tsx +21 -0
- package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
- package/src/triage/room/room.scss +29 -0
- package/src/triage/triage.component.tsx +15 -0
- package/src/triage/triage.resource.ts +19 -0
- package/src/triage/types.ts +16 -0
- package/src/types/types.ts +128 -0
- package/dist/561.js +0 -2
- package/dist/561.js.map +0 -1
- package/dist/70.js +0 -1
- package/dist/70.js.map +0 -1
- package/dist/731.js +0 -2
- package/dist/731.js.LICENSE.txt +0 -39
- package/dist/731.js.map +0 -1
- package/dist/819.js +0 -1
- package/dist/819.js.map +0 -1
- package/dist/openmrs-esm-home-app.js +0 -1
- package/src/boxes/extensions/blue-box.component.tsx +0 -15
- package/src/boxes/extensions/box.scss +0 -23
- package/src/boxes/extensions/brand-box.component.tsx +0 -15
- package/src/boxes/extensions/red-box.component.tsx +0 -15
- package/src/boxes/slot/boxes.component.tsx +0 -25
- package/src/boxes/slot/boxes.scss +0 -29
- package/src/greeter/greeter.component.tsx +0 -42
- package/src/greeter/greeter.scss +0 -20
- package/src/greeter/greeter.test.tsx +0 -28
- package/src/patient-getter/patient-getter.component.tsx +0 -40
- package/src/patient-getter/patient-getter.resource.ts +0 -39
- package/src/patient-getter/patient-getter.scss +0 -16
- package/src/patient-getter/patient-getter.test.tsx +0 -40
- package/src/resources/resources.component.tsx +0 -56
- package/src/resources/resources.scss +0 -68
- /package/dist/{561.js.LICENSE.txt → 710.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const navLinksConfig = [
|
|
2
|
+
{
|
|
3
|
+
to: 'dashboard',
|
|
4
|
+
title: 'Dashboard',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
to: 'registry',
|
|
8
|
+
title: 'Registry',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
to: 'appointments',
|
|
12
|
+
title: 'Appointments',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
to: 'triage',
|
|
16
|
+
title: 'Triage',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
to: 'consultation',
|
|
20
|
+
title: 'Consultation',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
to: 'mch',
|
|
24
|
+
title: 'MCH',
|
|
25
|
+
children: [
|
|
26
|
+
{
|
|
27
|
+
to: 'triage',
|
|
28
|
+
title: 'Triage',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
to: 'consultation',
|
|
32
|
+
title: 'Consultation',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
to: 'admissions',
|
|
38
|
+
title: 'Admissions',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
to: 'procedures',
|
|
42
|
+
title: 'Procedures',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
to: 'radiology-imaging',
|
|
46
|
+
title: 'Radiology and Imaging',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
to: 'laboratory',
|
|
50
|
+
title: 'Laboratory',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
to: 'pharmacy',
|
|
54
|
+
title: 'Pharmacy',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
to: 'mortuary',
|
|
58
|
+
title: 'Mortuary',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
to: 'accounting',
|
|
62
|
+
title: 'Accounting',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
to: 'registers',
|
|
66
|
+
title: 'Registers',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
to: 'reports',
|
|
70
|
+
title: 'Reports',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
to: 'bookings',
|
|
74
|
+
title: 'Bookings',
|
|
75
|
+
children: [
|
|
76
|
+
{
|
|
77
|
+
to: 'daily',
|
|
78
|
+
title: 'Daily',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
];
|
|
@@ -1,20 +1,40 @@
|
|
|
1
|
-
import { SideNavMenuItem } from '@carbon/react';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { navLinksConfig } from './nav-link-config';
|
|
5
|
+
import { SideNavMenu } from '@carbon/react';
|
|
3
6
|
|
|
4
7
|
interface NavLinksProps {}
|
|
5
8
|
const NavLinks: React.FC<NavLinksProps> = () => {
|
|
6
9
|
return (
|
|
7
10
|
<>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
{navLinksConfig.map((n) => {
|
|
12
|
+
if (n.children && n.children.length > 0) {
|
|
13
|
+
return (
|
|
14
|
+
<SideNavMenu title={n.title}>
|
|
15
|
+
{n.children.map((c) => {
|
|
16
|
+
return (
|
|
17
|
+
<ConfigurableLink
|
|
18
|
+
to={`${window.getOpenmrsSpaBase()}home/${n.to}/${c.to}`}
|
|
19
|
+
className={classNames('cds--side-nav__link', '')}
|
|
20
|
+
>
|
|
21
|
+
{c.title}
|
|
22
|
+
</ConfigurableLink>
|
|
23
|
+
);
|
|
24
|
+
})}
|
|
25
|
+
</SideNavMenu>
|
|
26
|
+
);
|
|
27
|
+
} else {
|
|
28
|
+
return (
|
|
29
|
+
<ConfigurableLink
|
|
30
|
+
to={`${window.getOpenmrsSpaBase()}home/${n.to}`}
|
|
31
|
+
className={classNames('cds--side-nav__link', '')}
|
|
32
|
+
>
|
|
33
|
+
{n.title}
|
|
34
|
+
</ConfigurableLink>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
})}
|
|
18
38
|
</>
|
|
19
39
|
);
|
|
20
40
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import {
|
|
4
|
+
MetricsCard,
|
|
5
|
+
MetricsCardHeader,
|
|
6
|
+
MetricsCardBody,
|
|
7
|
+
MetricsCardItem,
|
|
8
|
+
} from '../../service-queues/metrics/metrics-cards/metrics-card.component';
|
|
9
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
10
|
+
import { QUEUE_SERVICE_UUIDS } from '../../shared/constants/concepts';
|
|
11
|
+
import { getServiceQueueByLocationUuid } from '../../service-queues/service-queues.resource';
|
|
12
|
+
import { type QueueEntryResult } from '../../registry/types';
|
|
13
|
+
|
|
14
|
+
export default function TriageAttendedToPatientsExtension() {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const [triageQueueEntries, setTriageQueueEntries] = useState<QueueEntryResult[]>([]);
|
|
17
|
+
const session = useSession();
|
|
18
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
19
|
+
const triageServiceUuid = QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
getTriageEntryQueues();
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
const getTriageEntryQueues = async () => {
|
|
25
|
+
const res = await getServiceQueueByLocationUuid(triageServiceUuid, locationUuid);
|
|
26
|
+
setTriageQueueEntries(res);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const attendedToPatientsCount = triageQueueEntries?.filter((p) => p.status === 'COMPLETED').length ?? 0;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<MetricsCard>
|
|
33
|
+
<MetricsCardHeader title={t('patientsAttendedTo', 'Patients attended to')} />
|
|
34
|
+
<MetricsCardBody>
|
|
35
|
+
<MetricsCardItem
|
|
36
|
+
label={t('patients', 'Patients')}
|
|
37
|
+
value={attendedToPatientsCount ? attendedToPatientsCount : '--'}
|
|
38
|
+
/>
|
|
39
|
+
</MetricsCardBody>
|
|
40
|
+
</MetricsCard>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
3
|
+
|
|
4
|
+
.cardContainer {
|
|
5
|
+
background-color: $ui-02;
|
|
6
|
+
display: flex;
|
|
7
|
+
padding: layout.$spacing-05;
|
|
8
|
+
flex-flow: row wrap;
|
|
9
|
+
gap: layout.$spacing-05;
|
|
10
|
+
align-items: stretch;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.cardContainer > * {
|
|
14
|
+
flex: 1 0 0%;
|
|
15
|
+
min-width: 16rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// If we're on tablet and the screen is too small for 3 cards across
|
|
19
|
+
// @TODO: This will do nonsense things if there are not exactly 3 cards
|
|
20
|
+
@media (max-width: calc(layout.$spacing-05 * 4 + 18.75rem * 3)) {
|
|
21
|
+
:global(.omrs-breakpoint-lt-desktop) {
|
|
22
|
+
.cardContainer > *:has(:global(.cardWithChildren)) {
|
|
23
|
+
order: 999;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// If we're on desktop and the screen is too small for the left nav bar
|
|
29
|
+
// plus 3 cards across
|
|
30
|
+
@media (max-width: calc(16rem + layout.$spacing-05 * 4 + 18.75rem * 3)) {
|
|
31
|
+
:global(.omrs-breakpoint-gt-tablet) {
|
|
32
|
+
.cardContainer > *:has(:global(.cardWithChildren)) {
|
|
33
|
+
order: 999;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtensionSlot } from '@openmrs/esm-framework';
|
|
3
|
+
import styles from './metrics.scss';
|
|
4
|
+
import TriageWaitingPatientsExtension from './waiting-patients.extension';
|
|
5
|
+
import TriageAttendedToPatientsExtension from './attended-patients.extension';
|
|
6
|
+
|
|
7
|
+
export interface Service {
|
|
8
|
+
display: string;
|
|
9
|
+
uuid?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function TriageMetricsContainer() {
|
|
13
|
+
return (
|
|
14
|
+
<div className={styles.cardContainer}>
|
|
15
|
+
<TriageWaitingPatientsExtension />
|
|
16
|
+
<TriageAttendedToPatientsExtension />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default TriageMetricsContainer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import {
|
|
4
|
+
MetricsCard,
|
|
5
|
+
MetricsCardHeader,
|
|
6
|
+
MetricsCardBody,
|
|
7
|
+
MetricsCardItem,
|
|
8
|
+
} from '../../service-queues/metrics/metrics-cards/metrics-card.component';
|
|
9
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
10
|
+
import { QUEUE_SERVICE_UUIDS } from '../../shared/constants/concepts';
|
|
11
|
+
import { getServiceQueueByLocationUuid } from '../../service-queues/service-queues.resource';
|
|
12
|
+
import { type QueueEntryResult } from '../../registry/types';
|
|
13
|
+
|
|
14
|
+
export default function TriageWaitingPatientsExtension() {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const [triageQueueEntries, setTriageQueueEntries] = useState<QueueEntryResult[]>([]);
|
|
17
|
+
const session = useSession();
|
|
18
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
19
|
+
const triageServiceUuid = QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
getTriageEntryQueues();
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
const getTriageEntryQueues = async () => {
|
|
25
|
+
const res = await getServiceQueueByLocationUuid(triageServiceUuid, locationUuid);
|
|
26
|
+
setTriageQueueEntries(res);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const waitingPatientsCount = triageQueueEntries?.filter((p) => p.status === 'WAITING').length ?? 0;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<MetricsCard>
|
|
33
|
+
<MetricsCardHeader title={t('patientsInWaiting', 'Patients in waiting')} />
|
|
34
|
+
<MetricsCardBody>
|
|
35
|
+
<MetricsCardItem label={t('patients', 'Patients')} value={waitingPatientsCount ? waitingPatientsCount : '--'} />
|
|
36
|
+
</MetricsCardBody>
|
|
37
|
+
</MetricsCard>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
border: 1px solid #9e9e9e;
|
|
3
|
+
padding: 1rem;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
width: fit-content;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.room {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
margin: 1rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.roomName {
|
|
18
|
+
margin-bottom: 0.5rem;
|
|
19
|
+
font-size: large;
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.field {
|
|
24
|
+
margin: 0.25rem 0 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.button {
|
|
28
|
+
margin-top: 0.5rem;
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ServiceQueueComponent from '../service-queues/service-queue/service-queue.component';
|
|
3
|
+
import { QUEUE_SERVICE_UUIDS } from '../shared/constants/concepts';
|
|
4
|
+
|
|
5
|
+
interface TriageProps {}
|
|
6
|
+
const Triage: React.FC<TriageProps> = () => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<div>
|
|
10
|
+
<ServiceQueueComponent serviceTypeUuid={QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID} title="Triage" />
|
|
11
|
+
</div>
|
|
12
|
+
</>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
export default Triage;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import useSWR from 'swr';
|
|
2
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
3
|
+
|
|
4
|
+
import { type Patient } from './types';
|
|
5
|
+
export default function useTriagePatients(locationUuid: string) {
|
|
6
|
+
const { data, error, isLoading } = useSWR(
|
|
7
|
+
`${restBaseUrl}/queue-entry?v=custom:(uuid,display,queue:(display,uuid,location:(display,uuid)),status:(display),patient:(uuid,person:(gender,age)))&totalCount=true&isEnded=false&location=${locationUuid}`,
|
|
8
|
+
(url: string) =>
|
|
9
|
+
openmrsFetch<{
|
|
10
|
+
results: Array<Patient>;
|
|
11
|
+
}>(url).then((res) => res.data.results),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
patients: data,
|
|
16
|
+
isLoading,
|
|
17
|
+
isError: error,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Patient {
|
|
2
|
+
uuid: string;
|
|
3
|
+
middle_name: string;
|
|
4
|
+
given_name: string;
|
|
5
|
+
family_name: string;
|
|
6
|
+
queue_room: string;
|
|
7
|
+
status: string | number;
|
|
8
|
+
patient_name: string;
|
|
9
|
+
patient_uuid: string;
|
|
10
|
+
priority: string | number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Room {
|
|
14
|
+
name: string;
|
|
15
|
+
patients: Patient[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Visit,
|
|
3
|
+
type Concept,
|
|
4
|
+
type Patient,
|
|
5
|
+
type OpenmrsResource,
|
|
6
|
+
type Obs,
|
|
7
|
+
type FetchResponse,
|
|
8
|
+
} from '@openmrs/esm-framework';
|
|
9
|
+
|
|
10
|
+
export interface QueueEntry {
|
|
11
|
+
uuid: string;
|
|
12
|
+
display: string;
|
|
13
|
+
endedAt: string;
|
|
14
|
+
locationWaitingFor: Location;
|
|
15
|
+
patient: Patient;
|
|
16
|
+
priority: Concept;
|
|
17
|
+
priorityComment: string | null;
|
|
18
|
+
providerWaitingFor: Provider;
|
|
19
|
+
queue: Queue;
|
|
20
|
+
startedAt: string;
|
|
21
|
+
status: Concept;
|
|
22
|
+
visit: Visit;
|
|
23
|
+
sortWeight: number;
|
|
24
|
+
queueComingFrom: Queue;
|
|
25
|
+
previousQueueEntry: QueueEntry;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Provider {
|
|
29
|
+
uuid: string;
|
|
30
|
+
display: string;
|
|
31
|
+
comments: string;
|
|
32
|
+
response?: string;
|
|
33
|
+
person: OpenmrsResource;
|
|
34
|
+
location: string;
|
|
35
|
+
serviceType: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Queue {
|
|
39
|
+
uuid: string;
|
|
40
|
+
display: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
location: Location;
|
|
44
|
+
service: Concept;
|
|
45
|
+
allowedPriorities: Array<Concept>;
|
|
46
|
+
allowedStatuses: Array<Concept>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface Identifer {
|
|
50
|
+
identifier: string;
|
|
51
|
+
display: string;
|
|
52
|
+
uuid: string;
|
|
53
|
+
identifierType: {
|
|
54
|
+
uuid: string;
|
|
55
|
+
display: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface Encounter {
|
|
60
|
+
diagnoses?: Array<any>;
|
|
61
|
+
encounterDatetime?: string;
|
|
62
|
+
encounterProviders?: Array<{ provider?: { person?: { display?: string } } }>;
|
|
63
|
+
encounterType?: { display: string; uuid: string };
|
|
64
|
+
obs?: Array<Obs>;
|
|
65
|
+
uuid: string;
|
|
66
|
+
voided?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface MappedEncounter extends Omit<Encounter, 'encounterType' | 'provider'> {
|
|
70
|
+
encounterType: string;
|
|
71
|
+
provider: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface MappedVisitQueueEntry {
|
|
75
|
+
id: string;
|
|
76
|
+
encounters: Array<MappedEncounter>;
|
|
77
|
+
name: string;
|
|
78
|
+
patientAge: string;
|
|
79
|
+
patientDob: string;
|
|
80
|
+
patientGender: string;
|
|
81
|
+
patientUuid: string;
|
|
82
|
+
queue: Queue;
|
|
83
|
+
priority: Concept;
|
|
84
|
+
priorityComment: string;
|
|
85
|
+
status: Concept;
|
|
86
|
+
startedAt: Date;
|
|
87
|
+
endedAt: Date;
|
|
88
|
+
visitType: string;
|
|
89
|
+
visitUuid: string;
|
|
90
|
+
visitTypeUuid: string;
|
|
91
|
+
queueUuid: string;
|
|
92
|
+
queueEntryUuid: string;
|
|
93
|
+
queueLocation: string;
|
|
94
|
+
sortWeight: number;
|
|
95
|
+
visitQueueNumber: string;
|
|
96
|
+
identifiers: Array<Identifer>;
|
|
97
|
+
queueComingFrom: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type QueueEntryResponse = FetchResponse<{
|
|
101
|
+
results: Array<QueueEntry>;
|
|
102
|
+
links: Array<{
|
|
103
|
+
rel: 'prev' | 'next';
|
|
104
|
+
uri: string;
|
|
105
|
+
}>;
|
|
106
|
+
totalCount: number;
|
|
107
|
+
}>;
|
|
108
|
+
|
|
109
|
+
export type TransitionQueueEntryDto = {
|
|
110
|
+
queueEntryToTransition: string;
|
|
111
|
+
newQueue?: string;
|
|
112
|
+
newStatus?: string;
|
|
113
|
+
newPriority?: string;
|
|
114
|
+
newPriorityComment?: string;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export type TagColor = 'green' | 'gray' | 'blue' | 'red';
|
|
118
|
+
|
|
119
|
+
export enum QueueEntryStatus {
|
|
120
|
+
Completed = 'COMPLETED',
|
|
121
|
+
Waiting = 'WAITING',
|
|
122
|
+
InService = 'IN SERVICE',
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export enum QueueEntryPriority {
|
|
126
|
+
Emergency = 'EMERGENCY',
|
|
127
|
+
Normal = 'NORMAL',
|
|
128
|
+
}
|