@kenyaemr/esm-express-workflow-app 5.4.3 → 5.4.4-pre.100
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 +7 -12
- package/dist/1074.js +1 -0
- package/dist/1074.js.map +1 -0
- package/dist/12.js +17 -0
- package/dist/12.js.map +1 -0
- package/dist/1311.js +1 -0
- package/dist/1311.js.map +1 -0
- package/dist/1323.js +1 -0
- package/dist/1323.js.map +1 -0
- package/dist/1469.js +1 -0
- package/dist/1469.js.map +1 -0
- package/dist/1506.js +13 -0
- package/dist/1506.js.map +1 -0
- package/dist/1562.js +1 -0
- package/dist/1562.js.map +1 -0
- package/dist/1760.js +1 -0
- package/dist/1760.js.map +1 -0
- package/dist/1780.js +1 -0
- package/dist/1780.js.map +1 -0
- package/dist/1804.js +1 -0
- package/dist/1804.js.map +1 -0
- package/dist/1884.js +1 -0
- package/dist/1884.js.map +1 -0
- package/dist/1972.js +1 -0
- package/dist/1972.js.map +1 -0
- package/dist/1990.js +1 -0
- package/dist/1990.js.map +1 -0
- package/dist/2016.js +1 -0
- package/dist/2016.js.map +1 -0
- package/dist/2024.js +1 -0
- package/dist/2024.js.map +1 -0
- package/dist/2153.js +1 -0
- package/dist/2153.js.map +1 -0
- package/dist/216.js +1 -0
- package/dist/216.js.map +1 -0
- package/dist/2225.js +1 -0
- package/dist/2225.js.map +1 -0
- package/dist/2294.js +1 -0
- package/dist/2294.js.map +1 -0
- package/dist/2345.js +1 -0
- package/dist/2345.js.map +1 -0
- package/dist/2499.js +1 -0
- package/dist/2499.js.map +1 -0
- package/dist/2500.js +1 -0
- package/dist/2500.js.map +1 -0
- package/dist/2586.js +1 -0
- package/dist/2586.js.map +1 -0
- package/dist/2625.js +1 -0
- package/dist/2625.js.map +1 -0
- package/dist/2685.js +1 -0
- package/dist/2685.js.map +1 -0
- package/dist/2809.js +1 -0
- package/dist/2809.js.map +1 -0
- package/dist/2851.js +1 -0
- package/dist/2851.js.map +1 -0
- package/dist/2881.js +1 -0
- package/dist/2881.js.map +1 -0
- package/dist/2948.js +1 -0
- package/dist/2948.js.map +1 -0
- package/dist/2968.js +1 -0
- package/dist/2968.js.map +1 -0
- package/dist/2978.js +1 -0
- package/dist/2978.js.map +1 -0
- package/dist/2998.js +1 -0
- package/dist/2998.js.map +1 -0
- package/dist/3089.js +1 -0
- package/dist/3089.js.map +1 -0
- package/dist/3548.js +1 -0
- package/dist/3548.js.map +1 -0
- package/dist/3567.js +1 -0
- package/dist/3567.js.map +1 -0
- package/dist/3569.js +1 -0
- package/dist/3569.js.map +1 -0
- package/dist/3571.js +1 -0
- package/dist/3571.js.map +1 -0
- package/dist/3691.js +1 -0
- package/dist/3691.js.map +1 -0
- package/dist/3730.js +1 -0
- package/dist/3730.js.map +1 -0
- package/dist/3923.js +1 -0
- package/dist/3923.js.map +1 -0
- package/dist/3963.js +1 -0
- package/dist/3963.js.map +1 -0
- package/dist/4024.js +1 -0
- package/dist/4024.js.map +1 -0
- package/dist/405.js +1 -0
- package/dist/405.js.map +1 -0
- package/dist/4071.js +1 -0
- package/dist/4071.js.map +1 -0
- package/dist/4271.js +1 -0
- package/dist/4271.js.map +1 -0
- package/dist/4296.js +1 -0
- package/dist/4296.js.map +1 -0
- package/dist/4337.js +1 -0
- package/dist/4337.js.map +1 -0
- package/dist/4432.js +1 -0
- package/dist/4432.js.map +1 -0
- package/dist/4581.js +1 -0
- package/dist/4581.js.map +1 -0
- package/dist/4637.js +11 -0
- package/dist/4637.js.map +1 -0
- package/dist/4666.js +1 -0
- package/dist/4666.js.map +1 -0
- package/dist/4680.js +1 -0
- package/dist/4680.js.map +1 -0
- package/dist/4735.js +1 -0
- package/dist/4735.js.map +1 -0
- package/dist/4737.js +1 -0
- package/dist/4737.js.map +1 -0
- package/dist/4744.js +1 -0
- package/dist/4744.js.map +1 -0
- package/dist/4795.js +1 -0
- package/dist/4795.js.map +1 -0
- package/dist/4813.js +2 -0
- package/dist/4813.js.map +1 -0
- package/dist/4818.js +1 -0
- package/dist/4818.js.map +1 -0
- package/dist/4858.js +1 -0
- package/dist/4858.js.map +1 -0
- package/dist/487.js +1 -0
- package/dist/487.js.map +1 -0
- package/dist/4970.js +1 -0
- package/dist/4970.js.map +1 -0
- package/dist/5038.js +1 -0
- package/dist/5038.js.map +1 -0
- package/dist/5202.js +1 -0
- package/dist/5202.js.map +1 -0
- package/dist/5491.js +1 -0
- package/dist/5491.js.map +1 -0
- package/dist/5592.js +1 -0
- package/dist/5592.js.map +1 -0
- package/dist/5669.js +1 -0
- package/dist/5669.js.map +1 -0
- package/dist/586.js +1 -0
- package/dist/586.js.map +1 -0
- package/dist/5932.js +1 -0
- package/dist/5932.js.map +1 -0
- package/dist/5995.js +1 -0
- package/dist/5995.js.map +1 -0
- package/dist/6258.js +1 -0
- package/dist/6258.js.map +1 -0
- package/dist/629.js +1 -0
- package/dist/629.js.map +1 -0
- package/dist/6328.js +1 -0
- package/dist/6328.js.map +1 -0
- package/dist/6355.js +1 -0
- package/dist/6355.js.map +1 -0
- package/dist/6419.js +1 -0
- package/dist/6419.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/644.js.map +1 -0
- package/dist/6456.js +1 -0
- package/dist/6466.js +3 -0
- package/dist/6466.js.map +1 -0
- package/dist/655.js +1 -0
- package/dist/655.js.map +1 -0
- package/dist/6798.js +66 -0
- package/dist/6798.js.map +1 -0
- package/dist/6910.js +1 -0
- package/dist/6910.js.map +1 -0
- package/dist/6925.js +1 -0
- package/dist/6925.js.map +1 -0
- package/dist/70.js +1 -0
- package/dist/70.js.map +1 -0
- package/dist/7201.js +1 -0
- package/dist/7201.js.map +1 -0
- package/dist/7234.js +1 -0
- package/dist/7234.js.map +1 -0
- package/dist/7261.js +1 -0
- package/dist/7261.js.map +1 -0
- package/dist/7326.js +1 -0
- package/dist/7359.js +1 -0
- package/dist/7487.js +1 -0
- package/dist/7487.js.map +1 -0
- package/dist/7591.js +1 -0
- package/dist/7591.js.map +1 -0
- package/dist/7607.js +1 -0
- package/dist/7701.js +1 -0
- package/dist/7701.js.map +1 -0
- package/dist/7717.js +1 -0
- package/dist/7717.js.map +1 -0
- package/dist/7739.js +1 -0
- package/dist/7739.js.map +1 -0
- package/dist/7788.js +1 -0
- package/dist/7788.js.map +1 -0
- package/dist/7819.js +1 -0
- package/dist/7819.js.map +1 -0
- package/dist/7971.js +1 -0
- package/dist/7971.js.map +1 -0
- package/dist/7983.js +1 -0
- package/dist/7983.js.map +1 -0
- package/dist/807.js +1 -0
- package/dist/807.js.map +1 -0
- package/dist/8159.js +7 -0
- package/dist/8159.js.map +1 -0
- package/dist/8338.js +1 -0
- package/dist/8338.js.map +1 -0
- package/dist/845.js +1 -0
- package/dist/845.js.map +1 -0
- package/dist/8570.js +1 -0
- package/dist/8570.js.map +1 -0
- package/dist/8661.js +1 -0
- package/dist/8661.js.map +1 -0
- package/dist/87.js +1 -0
- package/dist/87.js.map +1 -0
- package/dist/8727.js +1 -0
- package/dist/8766.js +1 -0
- package/dist/8766.js.map +1 -0
- package/dist/8828.js +1 -0
- package/dist/8828.js.map +1 -0
- package/dist/8860.js +1 -0
- package/dist/8860.js.map +1 -0
- package/dist/8911.js +1 -0
- package/dist/8911.js.map +1 -0
- package/dist/8930.js +1 -0
- package/dist/8930.js.map +1 -0
- package/dist/8971.js +1 -0
- package/dist/8971.js.map +1 -0
- package/dist/9124.js +1 -0
- package/dist/9124.js.map +1 -0
- package/dist/9157.js +1 -0
- package/dist/9157.js.map +1 -0
- package/dist/9182.js +1 -0
- package/dist/921.js +1 -0
- package/dist/921.js.map +1 -0
- package/dist/9212.js +1 -0
- package/dist/9212.js.map +1 -0
- package/dist/9255.js +1 -0
- package/dist/9255.js.map +1 -0
- package/dist/9257.js +1 -0
- package/dist/9257.js.map +1 -0
- package/dist/9316.js +1 -0
- package/dist/9316.js.map +1 -0
- package/dist/9333.js +1 -0
- package/dist/9333.js.map +1 -0
- package/dist/9404.js +1 -0
- package/dist/9404.js.map +1 -0
- package/dist/9446.js +1 -0
- package/dist/9446.js.map +1 -0
- package/dist/9447.js +1 -0
- package/dist/9447.js.map +1 -0
- package/dist/9449.js +1 -0
- package/dist/9449.js.map +1 -0
- package/dist/9535.js +1 -0
- package/dist/9535.js.map +1 -0
- package/dist/9606.js +1 -0
- package/dist/9606.js.map +1 -0
- package/dist/973.js +1 -0
- package/dist/973.js.map +1 -0
- package/dist/9845.js +1 -0
- package/dist/9845.js.map +1 -0
- package/dist/kenyaemr-esm-express-workflow-app.js +5 -5
- package/dist/kenyaemr-esm-express-workflow-app.js.buildmanifest.json +3004 -175
- package/dist/kenyaemr-esm-express-workflow-app.js.map +1 -1
- package/dist/main.js +5 -114
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +6 -7
- package/rspack.config.js +1 -1
- package/src/components/accounting/index.tsx +11 -10
- package/src/components/admissions/index.tsx +11 -10
- package/src/components/appointments/index.ts +10 -8
- package/src/components/consultation/clinical-encounter/encounter-details.component.tsx +9 -9
- package/src/components/consultation/clinical-encounter/encounter-details.test.tsx +19 -18
- package/src/components/consultation/consultation-context.tsx +19 -0
- package/src/components/consultation/consultation-summary-cards.component.tsx +124 -0
- package/src/components/consultation/consultation.component.tsx +41 -268
- package/src/components/consultation/consultation.resource.ts +67 -24
- package/src/components/consultation/consultation.scss +5 -0
- package/src/components/consultation/consultation.utils.tsx +222 -0
- package/src/components/consultation/dashboard.component.tsx +0 -2
- package/src/components/consultation/index.ts +27 -20
- package/src/components/facility-dashboard/index.tsx +10 -9
- package/src/components/laboratory/index.ts +11 -10
- package/src/components/laboratory/lab-table.component.tsx +22 -8
- package/src/components/laboratory/laboratory-tabs.component.tsx +2 -2
- package/src/components/mch/dashboard.component.tsx +0 -2
- package/src/components/mch/index.tsx +10 -9
- package/src/components/mch/mch.consultation.component.tsx +27 -15
- package/src/components/mch/mch.triage.component.tsx +42 -33
- package/src/components/pharmacy/index.ts +20 -18
- package/src/components/pharmacy/orders/pharmacy-orders.component.tsx +35 -13
- package/src/components/pharmacy/orders/pharmacy-orders.test.tsx +8 -7
- package/src/components/procedures/index.ts +11 -10
- package/src/components/procedures/procedures-table.component.tsx +44 -13
- package/src/components/procedures/procedures-tabs.component.tsx +2 -2
- package/src/components/radiology-and-imaging/index.ts +14 -10
- package/src/components/radiology-and-imaging/radiology-and-imaging-table.component.tsx +35 -15
- package/src/components/radiology-and-imaging/radiology-and-imaging.component.tsx +2 -2
- package/src/components/registration/card/HIE-card/hie-card.component.tsx +32 -44
- package/src/components/registration/card/Local-card/local-card.component.tsx +22 -24
- package/src/components/registration/dependants/dependants.component.tsx +32 -60
- package/src/components/registration/dependants/dependants.resource.ts +79 -50
- package/src/components/registration/helper/index.ts +4 -0
- package/src/components/registration/index.ts +10 -9
- package/src/components/registration/search-bar/search-bar.resource.ts +32 -93
- package/src/components/registration/start-visit-form/hooks/useDefaultFacilityLocation.tsx +15 -0
- package/src/components/registration/start-visit-form/hooks/useDefaultVisitLocation.tsx +24 -0
- package/src/components/registration/start-visit-form/hooks/useOfflineVisitType.tsx +18 -0
- package/src/components/registration/start-visit-form/hooks/useRecommendedVisitTypes.tsx +36 -0
- package/src/components/registration/start-visit-form/hooks/useVisitAttributeType.tsx +102 -0
- package/src/components/registration/start-visit-form/overflow-menu-extension/overflow-menu-item.extension.tsx +55 -0
- package/src/components/registration/start-visit-form/overflow-menu-extension/overflow-menu-item.scss +3 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/base-visit-type.component.tsx +126 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/base-visit-type.scss +75 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/exported-visit-form.workspace.tsx +743 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/location-selector.component.tsx +86 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/recommended-visit-type.component.tsx +32 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/visit-attribute-type.component.tsx +257 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/visit-attribute-type.scss +5 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/visit-date-time.component.tsx +193 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/visit-form.resource.ts +383 -0
- package/src/components/registration/start-visit-form/start-visit-workspace/visit-form.scss +166 -0
- package/src/components/registration/start-visit-form/visit-form-workspace/visit-form.workspace.tsx +55 -0
- package/src/components/reports/index.ts +10 -9
- package/src/components/triage/dashboard.component.tsx +0 -2
- package/src/components/triage/index.ts +10 -9
- package/src/components/triage/triage.component.tsx +92 -42
- package/src/components/triage/triage.resource.ts +56 -50
- package/src/components/triage/triage.scss +6 -0
- package/src/config-schema.ts +91 -0
- package/src/hooks/useServiceQueues.tsx +95 -25
- package/src/index.ts +32 -13
- package/src/routes.json +53 -254
- package/src/shared/orders/OrdersTabs.tsx +8 -3
- package/src/shared/patient-chart/patient-chart.resources.ts +8 -12
- package/src/shared/patient-chart/patient-summary-dashboard/patient-summary-dashboard.component.tsx +1 -2
- package/src/shared/pin-put/pinput.component.test.tsx +7 -6
- package/src/shared/queue/queue-entry/queue-entry-table.component.tsx +99 -88
- package/src/shared/queue/queue-entry/queue-entry-table.scss +4 -0
- package/src/shared/queue/queue-summary-cards.component.tsx +32 -0
- package/src/shared/queue/queue-tab.component.tsx +182 -70
- package/src/shared/queue/queue-tab.scss +1 -0
- package/src/shared/queue/queue-workflow-context.tsx +90 -0
- package/src/shared/tabs/extension-tabs.component.tsx +9 -6
- package/src/shared/utils/index.ts +1 -2
- package/src/types/index.ts +17 -2
- package/translations/am.json +64 -13
- package/translations/en.json +59 -8
- package/translations/sw.json +58 -7
- package/dist/127.js +0 -1
- package/dist/200.js +0 -1
- package/dist/200.js.map +0 -1
- package/dist/24.js +0 -1
- package/dist/24.js.map +0 -1
- package/dist/267.js +0 -1
- package/dist/267.js.map +0 -1
- package/dist/285.js +0 -1
- package/dist/285.js.map +0 -1
- package/dist/329.js +0 -1
- package/dist/329.js.map +0 -1
- package/dist/40.js +0 -1
- package/dist/466.js +0 -1
- package/dist/466.js.map +0 -1
- package/dist/472.js +0 -66
- package/dist/472.js.map +0 -1
- package/dist/490.js +0 -1
- package/dist/490.js.map +0 -1
- package/dist/54.js +0 -1
- package/dist/54.js.map +0 -1
- package/dist/689.js +0 -1
- package/dist/689.js.map +0 -1
- package/dist/697.js +0 -1
- package/dist/697.js.map +0 -1
- package/dist/704.js +0 -1
- package/dist/704.js.map +0 -1
- package/dist/710.js +0 -1
- package/dist/710.js.map +0 -1
- package/dist/729.js +0 -17
- package/dist/729.js.map +0 -1
- package/dist/805.js +0 -37
- package/dist/805.js.map +0 -1
- package/dist/847.js +0 -1
- package/dist/847.js.map +0 -1
- package/dist/85.js +0 -1
- package/dist/85.js.map +0 -1
- package/dist/882.js +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/916.js +0 -1
- package/dist/994.js +0 -1
- package/dist/994.js.map +0 -1
- package/dist/998.js +0 -1
- package/dist/998.js.map +0 -1
- package/jest.config.js +0 -3
- package/src/shared/patient-chart/patient-chart.component.tsx +0 -61
- package/src/shared/patient-chart/patient-chart.scss +0 -15
- package/src/shared/patient-chart/useInitialize.ts +0 -24
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
4
|
+
import capitalize from 'lodash-es/capitalize';
|
|
5
|
+
import lowerCase from 'lodash-es/lowerCase';
|
|
6
|
+
import startCase from 'lodash-es/startCase';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
1
8
|
import {
|
|
2
9
|
DataTable,
|
|
10
|
+
InlineLoading,
|
|
3
11
|
OverflowMenu,
|
|
4
12
|
OverflowMenuItem,
|
|
5
13
|
Pagination,
|
|
@@ -11,20 +19,13 @@ import {
|
|
|
11
19
|
TableHeader,
|
|
12
20
|
TableRow,
|
|
13
21
|
} from '@carbon/react';
|
|
14
|
-
import { ConfigurableLink, showModal, useConfig, useDebounce
|
|
15
|
-
import { usePaginationInfo } from '@openmrs/esm-patient-common-lib';
|
|
16
|
-
import dayjs from 'dayjs';
|
|
17
|
-
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
18
|
-
import startCase from 'lodash-es/startCase';
|
|
19
|
-
import React, { useMemo, useState } from 'react';
|
|
20
|
-
import { useTranslation } from 'react-i18next';
|
|
22
|
+
import { ConfigurableLink, showModal, useConfig, useDebounce } from '@openmrs/esm-framework';
|
|
23
|
+
import { CardHeader, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
|
|
21
24
|
|
|
22
|
-
import capitalize from 'lodash-es/capitalize';
|
|
23
|
-
import lowerCase from 'lodash-es/lowerCase';
|
|
24
25
|
import { type ExpressWorkflowConfig } from '../../../config-schema';
|
|
25
26
|
import { spaBasePath } from '../../../constants';
|
|
26
27
|
import { serveQueueEntry } from '../../../hooks/useServiceQueues';
|
|
27
|
-
import { type QueueEntry } from '../../../types/index';
|
|
28
|
+
import { type QueueEntriesPagination, type QueueEntry } from '../../../types/index';
|
|
28
29
|
import styles from './queue-entry-table.scss';
|
|
29
30
|
|
|
30
31
|
// Extend dayjs with the relativeTime plugin
|
|
@@ -34,16 +35,23 @@ type QueueEntryTableProps = {
|
|
|
34
35
|
navigatePath?: string;
|
|
35
36
|
queueEntries: Array<QueueEntry>;
|
|
36
37
|
usePatientChart?: boolean;
|
|
38
|
+
pagination?: QueueEntriesPagination;
|
|
39
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
40
|
+
isLoading?: boolean;
|
|
41
|
+
isValidating?: boolean;
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
const QueueEntryTable: React.FC<QueueEntryTableProps> = ({
|
|
40
45
|
navigatePath = 'triage',
|
|
41
46
|
queueEntries,
|
|
42
47
|
usePatientChart,
|
|
48
|
+
pagination,
|
|
49
|
+
onPageSizeChange,
|
|
50
|
+
isValidating,
|
|
51
|
+
isLoading,
|
|
43
52
|
}) => {
|
|
44
53
|
const { visitQueueNumberAttributeUuid } = useConfig<ExpressWorkflowConfig>();
|
|
45
54
|
const [searchString, setSearchString] = useState('');
|
|
46
|
-
const pageSize = 10;
|
|
47
55
|
const { t } = useTranslation();
|
|
48
56
|
const debouncedSearchString = useDebounce(searchString, 500);
|
|
49
57
|
const filteredQueueEntries = useMemo(() => {
|
|
@@ -51,48 +59,32 @@ const QueueEntryTable: React.FC<QueueEntryTableProps> = ({
|
|
|
51
59
|
return queueEntry.patient.person.display.toLowerCase().includes(debouncedSearchString.toLowerCase());
|
|
52
60
|
});
|
|
53
61
|
}, [queueEntries, debouncedSearchString]);
|
|
54
|
-
const { currentPage, goTo, results } = usePagination(filteredQueueEntries, pageSize);
|
|
55
|
-
const { pageSizes } = usePaginationInfo(pageSize, queueEntries.length, currentPage, results.length);
|
|
56
62
|
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
header: t('
|
|
68
|
-
key: 'previousQueue',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
header: t('
|
|
72
|
-
key: '
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
header: t('status', 'status'),
|
|
80
|
-
key: 'status',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
header: t('queue', 'Queue'),
|
|
84
|
-
key: 'queue',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
header: t('waitTime', 'Wait time'),
|
|
88
|
-
key: 'waitTime',
|
|
89
|
-
},
|
|
90
|
-
];
|
|
63
|
+
const { pageSizes } = usePaginationInfo(
|
|
64
|
+
pagination?.defaultPageSize,
|
|
65
|
+
pagination?.totalCount,
|
|
66
|
+
pagination?.currentPage,
|
|
67
|
+
pagination?.currentPageSize.current,
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const headers = useMemo(
|
|
71
|
+
() => [
|
|
72
|
+
{ header: t('name', 'Name'), key: 'patientName' },
|
|
73
|
+
{ header: t('queueNumber', 'Queue Number'), key: 'queueNumber' },
|
|
74
|
+
{ header: t('comingFrom', 'Coming from'), key: 'previousQueue' },
|
|
75
|
+
{ header: t('priority', 'Priority'), key: 'priority' },
|
|
76
|
+
{ header: t('priorityComment', 'Priority Comment'), key: 'priorityComment' },
|
|
77
|
+
{ header: t('status', 'status'), key: 'status' },
|
|
78
|
+
{ header: t('queue', 'Queue'), key: 'queue' },
|
|
79
|
+
{ header: t('waitTime', 'Wait time'), key: 'waitTime' },
|
|
80
|
+
],
|
|
81
|
+
[t],
|
|
82
|
+
);
|
|
91
83
|
|
|
92
84
|
const handleCallQueueEntry = async (queueEntry: QueueEntry) => {
|
|
93
|
-
const queueNumber = queueEntry.visit.attributes?.
|
|
85
|
+
const queueNumber = queueEntry.visit.attributes?.find(
|
|
94
86
|
(attr) => attr['attributeType']?.uuid === visitQueueNumberAttributeUuid,
|
|
95
|
-
)
|
|
87
|
+
);
|
|
96
88
|
const response = await serveQueueEntry(
|
|
97
89
|
queueEntry.queue.name,
|
|
98
90
|
queueNumber.value,
|
|
@@ -108,42 +100,58 @@ const QueueEntryTable: React.FC<QueueEntryTableProps> = ({
|
|
|
108
100
|
}
|
|
109
101
|
};
|
|
110
102
|
|
|
111
|
-
const rows =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
const rows = useMemo(() => {
|
|
104
|
+
return filteredQueueEntries?.map((queueEntry) => {
|
|
105
|
+
const visitNumber = queueEntry?.visit?.attributes?.find(
|
|
106
|
+
(attr) => attr?.attributeType?.uuid === visitQueueNumberAttributeUuid,
|
|
107
|
+
);
|
|
115
108
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
const patientChartUrl = usePatientChart
|
|
110
|
+
? `${globalThis.spaBase}/patient/${queueEntry.patient.uuid}/chart/Patient Summary?path=${navigatePath}`
|
|
111
|
+
: `${spaBasePath}/${navigatePath}/${queueEntry.patient.uuid}`;
|
|
119
112
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
113
|
+
return {
|
|
114
|
+
id: queueEntry.uuid,
|
|
115
|
+
queueNumber: visitNumber?.value ?? '--',
|
|
116
|
+
previousQueue: startCase(queueEntry.previousQueueEntry?.queue?.display?.toLowerCase() ?? '--'),
|
|
117
|
+
patientName: (
|
|
118
|
+
<ConfigurableLink className={styles.link} to={patientChartUrl}>
|
|
119
|
+
{startCase(queueEntry.patient.person.display.toLowerCase())}
|
|
120
|
+
</ConfigurableLink>
|
|
121
|
+
),
|
|
122
|
+
priority: (
|
|
123
|
+
<div className={styles.priorityPill} data-priority={lowerCase(queueEntry?.priority?.display)}>
|
|
124
|
+
{t(queueEntry?.priority?.display, capitalize(queueEntry?.priority?.display.replace('_', ' ')))}
|
|
125
|
+
</div>
|
|
126
|
+
),
|
|
127
|
+
priorityComment: startCase(queueEntry.priorityComment?.toLowerCase() ?? '--'),
|
|
128
|
+
status: queueEntry?.status?.display ?? '--',
|
|
129
|
+
queue: startCase(queueEntry?.queue?.display?.toLowerCase() ?? '--'),
|
|
130
|
+
waitTime: dayjs(queueEntry.startedAt).fromNow(),
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
}, [filteredQueueEntries, visitQueueNumberAttributeUuid, navigatePath, usePatientChart, t]);
|
|
140
134
|
|
|
135
|
+
if (isLoading && queueEntries.length === 0) {
|
|
136
|
+
return <InlineLoading status="active" description={t('loading', 'Loading...')} />;
|
|
137
|
+
}
|
|
141
138
|
if (queueEntries.length === 0) {
|
|
142
139
|
return <div>{t('noPatientsAwaiting', 'No patients awaiting service')}</div>;
|
|
143
140
|
}
|
|
144
141
|
|
|
145
142
|
return (
|
|
146
143
|
<div className={styles.table}>
|
|
144
|
+
<CardHeader title={t('queueEntries', 'Queue Entries')}>
|
|
145
|
+
<div className={styles.loadingContainer}>
|
|
146
|
+
{isValidating && (
|
|
147
|
+
<InlineLoading
|
|
148
|
+
className={styles.loading}
|
|
149
|
+
status="active"
|
|
150
|
+
description={t('refreshingData', 'Refreshing data...')}
|
|
151
|
+
/>
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
</CardHeader>
|
|
147
155
|
<Search
|
|
148
156
|
labelText={t('search', 'Search')}
|
|
149
157
|
placeholder={t('search', 'Search')}
|
|
@@ -172,7 +180,7 @@ const QueueEntryTable: React.FC<QueueEntryTableProps> = ({
|
|
|
172
180
|
<TableCell className="cds--table-column-menu">
|
|
173
181
|
<OverflowMenu size="sm" aria-label="overflow-menu" flipped align="right">
|
|
174
182
|
<OverflowMenuItem
|
|
175
|
-
onClick={() => handleCallQueueEntry(
|
|
183
|
+
onClick={() => handleCallQueueEntry(filteredQueueEntries[index])}
|
|
176
184
|
itemText={t('call', 'Call')}
|
|
177
185
|
/>
|
|
178
186
|
</OverflowMenu>
|
|
@@ -183,17 +191,20 @@ const QueueEntryTable: React.FC<QueueEntryTableProps> = ({
|
|
|
183
191
|
</Table>
|
|
184
192
|
)}
|
|
185
193
|
</DataTable>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
{pagination && (
|
|
195
|
+
<Pagination
|
|
196
|
+
pageSizes={pageSizes}
|
|
197
|
+
forwardText={t('nextPage', 'Next page')}
|
|
198
|
+
backwardText={t('previousPage', 'Previous page')}
|
|
199
|
+
page={pagination.currentPage}
|
|
200
|
+
pageSize={pagination.currentPageSize.current}
|
|
201
|
+
totalItems={pagination.totalCount}
|
|
202
|
+
onChange={({ page, pageSize }) => {
|
|
203
|
+
pagination.goTo(page);
|
|
204
|
+
onPageSizeChange?.(pageSize as number);
|
|
205
|
+
}}
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
197
208
|
</div>
|
|
198
209
|
);
|
|
199
210
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Card from '../cards/card.component';
|
|
3
|
+
import styles from './queue-tab.scss';
|
|
4
|
+
|
|
5
|
+
export type QueueSummaryCard = {
|
|
6
|
+
title: string;
|
|
7
|
+
value: string;
|
|
8
|
+
categories?: Array<{ label: string; value: number; onClick?: () => void }>;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
refreshButton?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface QueueSummaryCardsProps {
|
|
14
|
+
cards?: Array<QueueSummaryCard>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const QueueSummaryCards: React.FC<QueueSummaryCardsProps> = ({ cards }) => (
|
|
18
|
+
<div className={styles.cards}>
|
|
19
|
+
{cards?.map((card) => (
|
|
20
|
+
<Card
|
|
21
|
+
key={card.title}
|
|
22
|
+
title={card.title}
|
|
23
|
+
total={card.value}
|
|
24
|
+
categories={card.categories}
|
|
25
|
+
onClick={card.onClick}
|
|
26
|
+
refreshButton={card.refreshButton}
|
|
27
|
+
/>
|
|
28
|
+
))}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export default QueueSummaryCards;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React, { useState, useMemo, useCallback, useEffect } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Tabs, TabList, Tab, TabPanels, TabPanel } from '@carbon/react';
|
|
4
5
|
import startCase from 'lodash-es/startCase';
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
|
|
7
|
+
import FiltersHeader from './filters-header.component';
|
|
8
|
+
import { type Queue, type QueueFilter } from '../../types/index';
|
|
8
9
|
import { useQueueEntries } from '../../hooks/useServiceQueues';
|
|
10
|
+
import QueueEntryTable from './queue-entry/queue-entry-table.component';
|
|
9
11
|
import styles from './queue-tab.scss';
|
|
10
|
-
import
|
|
12
|
+
import { useQueueWorkflowContextOptional } from './queue-workflow-context';
|
|
11
13
|
|
|
12
14
|
type QueueTabProps = {
|
|
13
15
|
queues: Array<Queue>;
|
|
14
|
-
cards?: Array<{
|
|
15
|
-
title: string;
|
|
16
|
-
value: string;
|
|
17
|
-
categories?: Array<{ label: string; value: number; onClick?: () => void }>;
|
|
18
|
-
onClick?: () => void;
|
|
19
|
-
refreshButton?: React.ReactNode; // Add this property
|
|
20
|
-
}>;
|
|
21
16
|
navigatePath: string;
|
|
22
17
|
onTabChanged?: (queue: Queue) => void;
|
|
23
18
|
usePatientChart?: boolean;
|
|
@@ -25,54 +20,69 @@ type QueueTabProps = {
|
|
|
25
20
|
onFiltersChanged?: (filters: Array<QueueFilter>) => void;
|
|
26
21
|
};
|
|
27
22
|
|
|
28
|
-
const
|
|
23
|
+
const startedOnOrAfter = dayjs().subtract(24, 'hour').format('YYYY-MM-DD HH:mm:ss');
|
|
24
|
+
|
|
25
|
+
const QueueTabWithContext: React.FC<
|
|
26
|
+
QueueTabProps & {
|
|
27
|
+
validQueues: Queue[];
|
|
28
|
+
workflowContext: NonNullable<ReturnType<typeof useQueueWorkflowContextOptional>>;
|
|
29
|
+
}
|
|
30
|
+
> = ({
|
|
29
31
|
queues,
|
|
30
|
-
cards,
|
|
31
32
|
navigatePath,
|
|
32
|
-
onTabChanged,
|
|
33
33
|
usePatientChart,
|
|
34
|
-
filters,
|
|
35
|
-
onFiltersChanged,
|
|
34
|
+
filters: filtersProp,
|
|
35
|
+
onFiltersChanged: onFiltersChangedProp,
|
|
36
|
+
validQueues,
|
|
37
|
+
workflowContext,
|
|
36
38
|
}) => {
|
|
39
|
+
const filters = workflowContext.filters ?? filtersProp ?? [];
|
|
40
|
+
const onFiltersChanged = workflowContext.setFilters ?? onFiltersChangedProp;
|
|
41
|
+
const onTabChanged = workflowContext.setCurrQueue;
|
|
37
42
|
const { t } = useTranslation();
|
|
38
|
-
|
|
39
|
-
// Filter queues with rooms first
|
|
40
|
-
const validQueues = useMemo(() => queues.filter((queue) => queue?.queueRooms?.length > 0), [queues]);
|
|
41
|
-
|
|
42
|
-
// Set initial selected queue to first valid queue
|
|
43
43
|
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
|
|
44
|
-
const [isInitialLoad, setIsInitialLoad] = useState(true);
|
|
45
|
-
|
|
46
44
|
const selectedQueue = validQueues[selectedTabIndex];
|
|
47
|
-
|
|
48
|
-
const { queueEntries, isLoading, error } = useQueueEntries({
|
|
49
|
-
location: selectedQueue?.location?.uuid ? [selectedQueue.location.uuid] : undefined,
|
|
50
|
-
statuses: filters?.filter((filter) => filter.key === 'status')?.flatMap((filter) => filter.value.split(',')),
|
|
51
|
-
});
|
|
45
|
+
const activeQueue = workflowContext.activeQueue;
|
|
52
46
|
|
|
53
47
|
useEffect(() => {
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
const index = validQueues.findIndex((q) => q?.uuid === activeQueue?.uuid);
|
|
49
|
+
if (index >= 0 && index !== selectedTabIndex) {
|
|
50
|
+
setSelectedTabIndex(index);
|
|
56
51
|
}
|
|
57
|
-
}, [
|
|
52
|
+
}, [activeQueue?.uuid, validQueues, selectedTabIndex]);
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
queueEntries,
|
|
56
|
+
isLoadingQueueEntries,
|
|
57
|
+
isValidatingQueueEntries,
|
|
58
|
+
queueEntriesError: error,
|
|
59
|
+
queueEntriesPagination: pagination,
|
|
60
|
+
pageSize,
|
|
61
|
+
setPageSize,
|
|
62
|
+
} = workflowContext;
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
pagination?.goTo(1);
|
|
66
|
+
}, [selectedQueue?.uuid]);
|
|
58
67
|
|
|
59
68
|
const queueEntriesByService = useMemo(() => {
|
|
60
69
|
if (!queueEntries?.length || !selectedQueue?.uuid) {
|
|
61
70
|
return [];
|
|
62
71
|
}
|
|
63
72
|
const priorityFilter = filters?.find((filter) => filter.key === 'priority')?.value;
|
|
64
|
-
const
|
|
73
|
+
const statusFilter =
|
|
74
|
+
filters?.filter((filter) => filter.key === 'status')?.flatMap((filter) => filter.value.split(',')) ?? [];
|
|
75
|
+
const serviceAwaitingFilter = filters?.find((filter) => filter.key === 'service_awaiting')?.value?.split(',') ?? [];
|
|
65
76
|
const serviceCompletedFilter =
|
|
66
|
-
filters?.find((filter) => filter.key === 'service_completed')?.value?.split(',') ?? [];
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
filters?.find((filter) => filter.key === 'service_completed')?.value?.split(',') ?? [];
|
|
78
|
+
return queueEntries.filter(
|
|
79
|
+
(entry) =>
|
|
69
80
|
entry?.queue?.uuid === selectedQueue?.uuid &&
|
|
81
|
+
(statusFilter.length > 0 ? statusFilter.includes(entry?.status?.uuid) : true) &&
|
|
70
82
|
(priorityFilter ? entry?.priority?.uuid === priorityFilter : true) &&
|
|
71
83
|
(serviceAwaitingFilter.length > 0 ? serviceAwaitingFilter.includes(entry?.patient?.uuid) : true) &&
|
|
72
|
-
(serviceCompletedFilter.length > 0 ? serviceCompletedFilter.includes(entry?.patient?.uuid) : true)
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
return filtered;
|
|
84
|
+
(serviceCompletedFilter.length > 0 ? serviceCompletedFilter.includes(entry?.patient?.uuid) : true),
|
|
85
|
+
);
|
|
76
86
|
}, [filters, queueEntries, selectedQueue?.uuid]);
|
|
77
87
|
|
|
78
88
|
const handleTabChange = useCallback(
|
|
@@ -86,21 +96,112 @@ const QueueTab: React.FC<QueueTabProps> = ({
|
|
|
86
96
|
[validQueues, onTabChanged],
|
|
87
97
|
);
|
|
88
98
|
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
99
|
+
if (error) {
|
|
100
|
+
return (
|
|
101
|
+
<div>
|
|
102
|
+
{t('errorLoadingQueueEntries', 'Error loading queue entries')}: {error.message}
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
91
105
|
}
|
|
92
106
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
107
|
+
return (
|
|
108
|
+
<div className={styles.queueTab}>
|
|
109
|
+
<FiltersHeader filters={filters} onFiltersChanged={onFiltersChanged} />
|
|
110
|
+
<div className={styles.tabsContainer}>
|
|
111
|
+
<Tabs selectedIndex={selectedTabIndex} onChange={handleTabChange}>
|
|
112
|
+
<TabList contained>
|
|
113
|
+
{validQueues.map((queue) => (
|
|
114
|
+
<Tab key={queue?.uuid}>{startCase(queue?.queueRooms[0]?.display)}</Tab>
|
|
115
|
+
))}
|
|
116
|
+
</TabList>
|
|
117
|
+
<TabPanels>
|
|
118
|
+
{validQueues.map((queue) => (
|
|
119
|
+
<TabPanel key={queue?.uuid}>
|
|
120
|
+
<QueueEntryTable
|
|
121
|
+
queueEntries={queueEntriesByService}
|
|
122
|
+
navigatePath={navigatePath}
|
|
123
|
+
usePatientChart={usePatientChart}
|
|
124
|
+
pagination={pagination}
|
|
125
|
+
onPageSizeChange={setPageSize}
|
|
126
|
+
isLoading={isLoadingQueueEntries}
|
|
127
|
+
isValidating={isValidatingQueueEntries}
|
|
128
|
+
/>
|
|
129
|
+
</TabPanel>
|
|
130
|
+
))}
|
|
131
|
+
</TabPanels>
|
|
132
|
+
</Tabs>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
96
137
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
138
|
+
const QueueTabWithoutContext: React.FC<QueueTabProps> = ({
|
|
139
|
+
queues,
|
|
140
|
+
navigatePath,
|
|
141
|
+
onTabChanged: onTabChangedProp,
|
|
142
|
+
usePatientChart,
|
|
143
|
+
filters: filtersProp,
|
|
144
|
+
onFiltersChanged: onFiltersChangedProp,
|
|
145
|
+
}) => {
|
|
146
|
+
const { t } = useTranslation();
|
|
147
|
+
const [pageSize, setPageSize] = useState(10);
|
|
148
|
+
const validQueues = useMemo(() => queues.filter((queue) => queue?.queueRooms?.length > 0), [queues]);
|
|
149
|
+
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
|
|
150
|
+
const selectedQueue = validQueues[selectedTabIndex];
|
|
100
151
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
152
|
+
const {
|
|
153
|
+
queueEntries,
|
|
154
|
+
isLoading: isLoadingQueueEntries,
|
|
155
|
+
isValidating: isValidatingQueueEntries,
|
|
156
|
+
error,
|
|
157
|
+
pagination,
|
|
158
|
+
} = useQueueEntries(
|
|
159
|
+
{
|
|
160
|
+
location: selectedQueue?.location?.uuid ? [selectedQueue.location.uuid] : undefined,
|
|
161
|
+
startedOnOrAfter,
|
|
162
|
+
queues: [selectedQueue?.uuid],
|
|
163
|
+
},
|
|
164
|
+
pageSize,
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
pagination?.goTo(1);
|
|
169
|
+
}, [selectedQueue?.uuid]);
|
|
170
|
+
|
|
171
|
+
const filters = filtersProp ?? [];
|
|
172
|
+
const onFiltersChanged = onFiltersChangedProp;
|
|
173
|
+
const onTabChanged = onTabChangedProp;
|
|
174
|
+
|
|
175
|
+
const queueEntriesByService = useMemo(() => {
|
|
176
|
+
if (!queueEntries?.length || !selectedQueue?.uuid) {
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
const priorityFilter = filters?.find((filter) => filter.key === 'priority')?.value;
|
|
180
|
+
const statusFilter =
|
|
181
|
+
filters?.filter((filter) => filter.key === 'status')?.flatMap((filter) => filter.value.split(',')) ?? [];
|
|
182
|
+
const serviceAwaitingFilter = filters?.find((filter) => filter.key === 'service_awaiting')?.value?.split(',') ?? [];
|
|
183
|
+
const serviceCompletedFilter =
|
|
184
|
+
filters?.find((filter) => filter.key === 'service_completed')?.value?.split(',') ?? [];
|
|
185
|
+
return queueEntries.filter(
|
|
186
|
+
(entry) =>
|
|
187
|
+
entry?.queue?.uuid === selectedQueue?.uuid &&
|
|
188
|
+
(statusFilter.length > 0 ? statusFilter.includes(entry?.status?.uuid) : true) &&
|
|
189
|
+
(priorityFilter ? entry?.priority?.uuid === priorityFilter : true) &&
|
|
190
|
+
(serviceAwaitingFilter.length > 0 ? serviceAwaitingFilter.includes(entry?.patient?.uuid) : true) &&
|
|
191
|
+
(serviceCompletedFilter.length > 0 ? serviceCompletedFilter.includes(entry?.patient?.uuid) : true),
|
|
192
|
+
);
|
|
193
|
+
}, [filters, queueEntries, selectedQueue?.uuid]);
|
|
194
|
+
|
|
195
|
+
const handleTabChange = useCallback(
|
|
196
|
+
(evt: { selectedIndex: number }) => {
|
|
197
|
+
setSelectedTabIndex(evt.selectedIndex);
|
|
198
|
+
const newQueue = validQueues[evt.selectedIndex];
|
|
199
|
+
if (newQueue) {
|
|
200
|
+
onTabChanged?.(newQueue);
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
[validQueues, onTabChanged],
|
|
204
|
+
);
|
|
104
205
|
|
|
105
206
|
if (error) {
|
|
106
207
|
return (
|
|
@@ -112,18 +213,6 @@ const QueueTab: React.FC<QueueTabProps> = ({
|
|
|
112
213
|
|
|
113
214
|
return (
|
|
114
215
|
<div className={styles.queueTab}>
|
|
115
|
-
<div className={styles.cards}>
|
|
116
|
-
{cards?.map((card) => (
|
|
117
|
-
<Card
|
|
118
|
-
key={card.title}
|
|
119
|
-
title={card.title}
|
|
120
|
-
total={card.value}
|
|
121
|
-
categories={card.categories}
|
|
122
|
-
onClick={card.onClick}
|
|
123
|
-
refreshButton={card.refreshButton}
|
|
124
|
-
/>
|
|
125
|
-
))}
|
|
126
|
-
</div>
|
|
127
216
|
<FiltersHeader filters={filters} onFiltersChanged={onFiltersChanged} />
|
|
128
217
|
<div className={styles.tabsContainer}>
|
|
129
218
|
<Tabs selectedIndex={selectedTabIndex} onChange={handleTabChange}>
|
|
@@ -133,17 +222,16 @@ const QueueTab: React.FC<QueueTabProps> = ({
|
|
|
133
222
|
))}
|
|
134
223
|
</TabList>
|
|
135
224
|
<TabPanels>
|
|
136
|
-
{validQueues.map((queue
|
|
225
|
+
{validQueues.map((queue) => (
|
|
137
226
|
<TabPanel key={queue?.uuid}>
|
|
138
|
-
{isLoading && !isInitialLoad && (
|
|
139
|
-
<div className={styles.loadingOverlay}>
|
|
140
|
-
<InlineLoading description={t('loadingQueueEntries', 'Loading queue entries...')} />
|
|
141
|
-
</div>
|
|
142
|
-
)}
|
|
143
227
|
<QueueEntryTable
|
|
144
228
|
queueEntries={queueEntriesByService}
|
|
145
229
|
navigatePath={navigatePath}
|
|
146
230
|
usePatientChart={usePatientChart}
|
|
231
|
+
pagination={pagination}
|
|
232
|
+
onPageSizeChange={setPageSize}
|
|
233
|
+
isLoading={isLoadingQueueEntries}
|
|
234
|
+
isValidating={isValidatingQueueEntries}
|
|
147
235
|
/>
|
|
148
236
|
</TabPanel>
|
|
149
237
|
))}
|
|
@@ -154,4 +242,28 @@ const QueueTab: React.FC<QueueTabProps> = ({
|
|
|
154
242
|
);
|
|
155
243
|
};
|
|
156
244
|
|
|
245
|
+
const QueueTab: React.FC<QueueTabProps> = (props) => {
|
|
246
|
+
const workflowContext = useQueueWorkflowContextOptional();
|
|
247
|
+
const { t } = useTranslation();
|
|
248
|
+
const validQueues = useMemo(() => props.queues.filter((queue) => queue?.queueRooms?.length > 0), [props.queues]);
|
|
249
|
+
|
|
250
|
+
if (!props.queues || props.queues.length === 0) {
|
|
251
|
+
return <div>{t('noQueuesAvailable', 'No queues available')}</div>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (validQueues.length === 0) {
|
|
255
|
+
return <div>{t('noQueueRooms', 'No queue rooms configured')}</div>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (!validQueues[0]) {
|
|
259
|
+
return <div>{t('noQueueSelected', 'Please select a queue')}</div>;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (workflowContext) {
|
|
263
|
+
return <QueueTabWithContext {...props} validQueues={validQueues} workflowContext={workflowContext} />;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return <QueueTabWithoutContext {...props} />;
|
|
267
|
+
};
|
|
268
|
+
|
|
157
269
|
export default QueueTab;
|