@openmrs/esm-laboratory-app 1.1.2-pre.91 → 1.2.1-pre.590
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/cache/99f2b2ec58ba1a5e-meta.json +1 -0
- package/.turbo/cache/99f2b2ec58ba1a5e.tar.zst +0 -0
- package/.turbo/turbo-build.log +27 -29
- package/dist/1026.js +2 -0
- package/dist/1026.js.map +1 -0
- package/dist/1083.js +1 -0
- package/dist/{7328.js.map → 1083.js.map} +1 -1
- package/dist/1119.js +1 -0
- package/dist/1120.js +1 -0
- package/dist/1120.js.map +1 -0
- package/dist/1197.js +1 -0
- package/dist/1788.js +1 -0
- package/dist/1788.js.map +1 -0
- package/dist/2058.js +1 -0
- package/dist/2058.js.map +1 -0
- package/dist/2146.js +1 -0
- package/dist/2246.js +1 -0
- package/dist/2246.js.map +1 -0
- package/dist/2690.js +1 -0
- package/dist/2934.js +2 -0
- package/dist/2934.js.map +1 -0
- package/dist/3099.js +1 -0
- package/dist/3495.js +2 -0
- package/dist/3495.js.map +1 -0
- package/dist/3584.js +1 -0
- package/dist/3656.js +1 -0
- package/dist/{8684.js.map → 3656.js.map} +1 -1
- package/dist/3671.js +1 -0
- package/dist/3671.js.map +1 -0
- package/dist/4055.js +1 -0
- package/dist/4069.js +1 -0
- package/dist/{7724.js.map → 4069.js.map} +1 -1
- package/dist/4132.js +1 -0
- package/dist/4239.js +1 -0
- package/dist/{6092.js.map → 4239.js.map} +1 -1
- package/dist/4300.js +1 -0
- package/dist/4335.js +1 -0
- package/dist/4369.js +1 -0
- package/dist/{2156.js.map → 4369.js.map} +1 -1
- package/dist/4618.js +1 -0
- package/dist/4652.js +1 -0
- package/dist/4944.js +1 -0
- package/dist/5085.js +1 -0
- package/dist/5085.js.map +1 -0
- package/dist/5173.js +1 -0
- package/dist/520.js +2 -0
- package/dist/{7936.js.LICENSE.txt → 520.js.LICENSE.txt} +5 -0
- package/dist/520.js.map +1 -0
- package/dist/5241.js +1 -0
- package/dist/5442.js +1 -0
- package/dist/5661.js +1 -0
- package/dist/6022.js +1 -0
- package/dist/6052.js +1 -0
- package/dist/6052.js.map +1 -0
- package/dist/6134.js +1 -0
- package/dist/6134.js.map +1 -0
- package/dist/6468.js +1 -0
- package/dist/6547.js +1 -0
- package/dist/6547.js.map +1 -0
- package/dist/6679.js +1 -0
- package/dist/6840.js +1 -0
- package/dist/6859.js +1 -0
- package/dist/7003.js +2 -0
- package/dist/7003.js.LICENSE.txt +9 -0
- package/dist/7003.js.map +1 -0
- package/dist/7097.js +1 -0
- package/dist/7159.js +1 -0
- package/dist/723.js +1 -0
- package/dist/7423.js +1 -0
- package/dist/{1708.js.map → 7423.js.map} +1 -1
- package/dist/7617.js +1 -0
- package/dist/795.js +1 -0
- package/dist/8163.js +1 -0
- package/dist/8349.js +1 -0
- package/dist/8554.js +1 -0
- package/dist/{3956.js.map → 8554.js.map} +1 -1
- package/dist/8618.js +1 -0
- package/dist/8667.js +1 -0
- package/dist/{1636.js.map → 8667.js.map} +1 -1
- package/dist/876.js +1 -0
- package/dist/876.js.map +1 -0
- package/dist/890.js +1 -0
- package/dist/9214.js +1 -0
- package/dist/9538.js +1 -0
- package/dist/9569.js +1 -0
- package/dist/9630.js +2 -0
- package/dist/9630.js.LICENSE.txt +29 -0
- package/dist/9630.js.map +1 -0
- package/dist/986.js +1 -0
- package/dist/9879.js +1 -0
- package/dist/9895.js +1 -0
- package/dist/9900.js +1 -0
- package/dist/9913.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +5 -0
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-laboratory-app.js +1 -1
- package/dist/openmrs-esm-laboratory-app.js.buildmanifest.json +429 -363
- package/dist/openmrs-esm-laboratory-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/e2e/README.md +117 -0
- package/e2e/commands/encounter-operations.ts +63 -0
- package/e2e/commands/index.ts +5 -0
- package/e2e/commands/patient-operations.ts +109 -0
- package/e2e/commands/provider-operations.ts +9 -0
- package/e2e/commands/test-order-operations.ts +46 -0
- package/e2e/commands/types/index.ts +157 -0
- package/e2e/commands/visit-operations.ts +38 -0
- package/e2e/core/global-setup.ts +32 -0
- package/e2e/core/index.ts +1 -0
- package/e2e/core/test.ts +31 -0
- package/e2e/fixtures/api.ts +27 -0
- package/e2e/fixtures/fhirApi.ts +28 -0
- package/e2e/fixtures/index.ts +2 -0
- package/e2e/pages/index.ts +1 -0
- package/e2e/pages/laboratory-page.ts +9 -0
- package/e2e/specs/add-lab-results.spec.ts +100 -0
- package/e2e/specs/test-orders.spec.ts +16 -0
- package/e2e/support/github/Dockerfile +34 -0
- package/e2e/support/github/docker-compose.yml +24 -0
- package/e2e/support/github/run-e2e-docker-env.sh +58 -0
- package/example.env +7 -0
- package/jest.config.js +10 -2
- package/package.json +9 -6
- package/playwright.config.ts +36 -0
- package/src/components/orders-table/list-order-details.component.tsx +91 -98
- package/src/components/orders-table/list-order-details.scss +77 -55
- package/src/components/orders-table/orders-data-table.component.tsx +19 -12
- package/src/components/orders-table/orders-data-table.scss +12 -6
- package/src/components/orders-table/orders-date-range-picker.component.tsx +2 -2
- package/src/components/overlay/overlay.component.tsx +8 -10
- package/src/index.ts +1 -0
- package/src/lab-tabs/actions/pickup-lab-request-action.component.tsx +4 -4
- package/src/lab-tabs/laboratory-tabs.component.tsx +48 -50
- package/src/lab-tabs/laboratory-tabs.scss +0 -9
- package/translations/am.json +6 -5
- package/translations/ar.json +6 -5
- package/translations/ar_SY.json +6 -5
- package/translations/bn.json +6 -5
- package/translations/de.json +6 -5
- package/translations/en.json +4 -4
- package/translations/en_US.json +68 -0
- package/translations/es.json +6 -5
- package/translations/es_MX.json +6 -5
- package/translations/fr.json +6 -5
- package/translations/he.json +6 -5
- package/translations/hi.json +6 -5
- package/translations/hi_IN.json +6 -5
- package/translations/id.json +64 -63
- package/translations/it.json +6 -5
- package/translations/ka.json +68 -0
- package/translations/km.json +6 -5
- package/translations/ku.json +6 -5
- package/translations/ky.json +6 -5
- package/translations/lg.json +6 -5
- package/translations/ne.json +6 -5
- package/translations/pl.json +6 -5
- package/translations/pt.json +6 -5
- package/translations/pt_BR.json +6 -5
- package/translations/qu.json +6 -5
- package/translations/ro_RO.json +65 -64
- package/translations/ru_RU.json +6 -5
- package/translations/si.json +6 -5
- package/translations/sw.json +6 -5
- package/translations/sw_KE.json +6 -5
- package/translations/tr.json +6 -5
- package/translations/tr_TR.json +6 -5
- package/translations/uk.json +6 -5
- package/translations/uz.json +6 -5
- package/translations/uz@Latn.json +6 -5
- package/translations/uz_UZ.json +6 -5
- package/translations/vi.json +6 -5
- package/translations/zh.json +6 -5
- package/translations/zh_CN.json +9 -8
- package/.turbo/cache/c038133c8b4257e2-meta.json +0 -1
- package/.turbo/cache/c038133c8b4257e2.tar.zst +0 -0
- package/dist/1448.js +0 -1
- package/dist/1636.js +0 -1
- package/dist/1708.js +0 -1
- package/dist/2156.js +0 -1
- package/dist/2326.js +0 -1
- package/dist/2328.js +0 -1
- package/dist/2636.js +0 -1
- package/dist/2636.js.map +0 -1
- package/dist/2664.js +0 -1
- package/dist/2816.js +0 -1
- package/dist/3240.js +0 -1
- package/dist/3264.js +0 -1
- package/dist/3264.js.map +0 -1
- package/dist/370.js +0 -1
- package/dist/3724.js +0 -1
- package/dist/3724.js.map +0 -1
- package/dist/3872.js +0 -1
- package/dist/3956.js +0 -1
- package/dist/400.js +0 -1
- package/dist/400.js.map +0 -1
- package/dist/436.js +0 -2
- package/dist/436.js.map +0 -1
- package/dist/4412.js +0 -1
- package/dist/4592.js +0 -1
- package/dist/464.js +0 -1
- package/dist/4656.js +0 -1
- package/dist/4744.js +0 -1
- package/dist/4868.js +0 -1
- package/dist/5028.js +0 -1
- package/dist/5086.js +0 -1
- package/dist/5136.js +0 -1
- package/dist/5144.js +0 -2
- package/dist/5144.js.map +0 -1
- package/dist/552.js +0 -1
- package/dist/5992.js +0 -1
- package/dist/6048.js +0 -1
- package/dist/6048.js.map +0 -1
- package/dist/6092.js +0 -1
- package/dist/6172.js +0 -1
- package/dist/6172.js.map +0 -1
- package/dist/6352.js +0 -1
- package/dist/6504.js +0 -1
- package/dist/6676.js +0 -1
- package/dist/6676.js.map +0 -1
- package/dist/6856.js +0 -1
- package/dist/6936.js +0 -1
- package/dist/7295.js +0 -1
- package/dist/7295.js.map +0 -1
- package/dist/7328.js +0 -1
- package/dist/7540.js +0 -1
- package/dist/7540.js.map +0 -1
- package/dist/7640.js +0 -1
- package/dist/7724.js +0 -1
- package/dist/7936.js +0 -2
- package/dist/7936.js.map +0 -1
- package/dist/8064.js +0 -1
- package/dist/8170.js +0 -1
- package/dist/8256.js +0 -1
- package/dist/8320.js +0 -1
- package/dist/8320.js.map +0 -1
- package/dist/8552.js +0 -1
- package/dist/8552.js.map +0 -1
- package/dist/8570.js +0 -1
- package/dist/8684.js +0 -1
- package/dist/8698.js +0 -1
- package/dist/8720.js +0 -1
- package/dist/8728.js +0 -2
- package/dist/8728.js.LICENSE.txt +0 -7
- package/dist/8728.js.map +0 -1
- package/dist/8936.js +0 -1
- package/dist/9064.js +0 -2
- package/dist/9064.js.map +0 -1
- package/dist/9372.js +0 -1
- package/dist/9464.js +0 -1
- package/dist/9656.js +0 -1
- package/dist/9832.js +0 -1
- package/dist/9864.js +0 -1
- package/dist/9960.js +0 -1
- /package/dist/{436.js.LICENSE.txt → 1026.js.LICENSE.txt} +0 -0
- /package/dist/{9064.js.LICENSE.txt → 2934.js.LICENSE.txt} +0 -0
- /package/dist/{5144.js.LICENSE.txt → 3495.js.LICENSE.txt} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
3
4
|
import {
|
|
4
5
|
Accordion,
|
|
5
6
|
AccordionItem,
|
|
@@ -7,119 +8,111 @@ import {
|
|
|
7
8
|
StructuredListCell,
|
|
8
9
|
StructuredListRow,
|
|
9
10
|
StructuredListWrapper,
|
|
10
|
-
Tag,
|
|
11
11
|
} from '@carbon/react';
|
|
12
12
|
import { capitalize } from 'lodash-es';
|
|
13
13
|
import { ExtensionSlot } from '@openmrs/esm-framework';
|
|
14
14
|
import { type ListOrdersDetailsProps } from '../../types';
|
|
15
15
|
import styles from './list-order-details.scss';
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
type OrderDetailsRowProps = {
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
value: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const OrderDetailRow = ({ label, value }: OrderDetailsRowProps) => {
|
|
23
|
+
return (
|
|
24
|
+
<StructuredListRow className={styles.orderDetailsRow}>
|
|
25
|
+
<StructuredListCell className={styles.orderDetailsCell}>
|
|
26
|
+
<span className={styles.orderDetailsTextBold}>{label}</span>
|
|
27
|
+
</StructuredListCell>
|
|
28
|
+
<StructuredListCell className={styles.orderDetailsCell}>
|
|
29
|
+
<span className={styles.orderDetailsText}>{value}</span>
|
|
30
|
+
</StructuredListCell>
|
|
31
|
+
</StructuredListRow>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
const ListOrderDetails: React.FC<ListOrdersDetailsProps> = ({ groupedOrders }) => {
|
|
18
35
|
const { t } = useTranslation();
|
|
19
|
-
const orders =
|
|
36
|
+
const orders = groupedOrders?.orders ?? [];
|
|
20
37
|
|
|
21
38
|
return (
|
|
22
39
|
<div>
|
|
23
|
-
{orders
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<div className={styles.orderUrgency}>
|
|
43
|
-
<span className={styles.urgencyStatus}>
|
|
44
|
-
{t('urgencyStatus', 'Urgency: ')} {capitalize(row.urgency)}
|
|
45
|
-
</span>
|
|
46
|
-
</div>
|
|
47
|
-
<StructuredListWrapper>
|
|
48
|
-
<StructuredListBody>
|
|
49
|
-
<StructuredListRow>
|
|
50
|
-
<StructuredListCell>{t('testOrdered', 'Test ordered: ')}</StructuredListCell>
|
|
51
|
-
<StructuredListCell>{capitalize(row?.display)}</StructuredListCell>
|
|
52
|
-
<br />
|
|
53
|
-
<StructuredListCell>
|
|
54
|
-
<div className={styles.instructionLabelContainer}>
|
|
55
|
-
<span className={styles.instructionLabel}>{t('orderInStruction', 'Instructions: ')}</span>
|
|
56
|
-
<span className={styles.instructions}>
|
|
57
|
-
{row.instructions ?? (
|
|
58
|
-
<Tag size="lg" type="red">
|
|
59
|
-
{t('NoInstructionLeft', 'No instructions are provided.')}
|
|
60
|
-
</Tag>
|
|
61
|
-
)}
|
|
62
|
-
</span>
|
|
63
|
-
</div>
|
|
64
|
-
</StructuredListCell>
|
|
65
|
-
</StructuredListRow>
|
|
66
|
-
</StructuredListBody>
|
|
67
|
-
</StructuredListWrapper>
|
|
68
|
-
{row.fulfillerStatus === 'COMPLETED' && (
|
|
69
|
-
<Accordion>
|
|
70
|
-
<AccordionItem
|
|
71
|
-
title={<span className={styles.accordionTitle}>{t('viewTestResults', 'View test results')}</span>}
|
|
40
|
+
{orders.map((row) => (
|
|
41
|
+
<div key={row.orderNumber} className={styles.orderDetailsContainer}>
|
|
42
|
+
<StructuredListWrapper className={styles.orderDetailsWrapper}>
|
|
43
|
+
<StructuredListBody>
|
|
44
|
+
<OrderDetailRow
|
|
45
|
+
label={t('urgencyStatus', 'Urgency:')}
|
|
46
|
+
value={
|
|
47
|
+
<div className={styles.priorityPill} data-urgency={row.urgency?.replace('_', ' ')}>
|
|
48
|
+
{capitalize(row.urgency?.replace(/_/g, ' '))}
|
|
49
|
+
</div>
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
<OrderDetailRow label={t('testOrdered', 'Test ordered:')} value={capitalize(row.display)} />
|
|
53
|
+
<OrderDetailRow
|
|
54
|
+
label={t('orderStatus', 'Status:')}
|
|
55
|
+
value={
|
|
56
|
+
<div
|
|
57
|
+
className={styles.statusPill}
|
|
58
|
+
data-status={(row.fulfillerStatus ?? 'Order not picked').replace('_', ' ')}
|
|
72
59
|
>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
60
|
+
{capitalize(row.fulfillerStatus?.replace('_', '')) || t('orderNotPicked', 'Order not picked')}
|
|
61
|
+
</div>
|
|
62
|
+
}
|
|
63
|
+
/>
|
|
64
|
+
<OrderDetailRow label={t('orderNumbers', 'Order number:')} value={capitalize(row.orderNumber)} />
|
|
65
|
+
<OrderDetailRow label={t('orderDate', 'Order date:')} value={row.dateActivated} />
|
|
66
|
+
<OrderDetailRow label={t('orderedBy', 'Ordered By:')} value={capitalize(row.orderer?.display)} />
|
|
67
|
+
<OrderDetailRow
|
|
68
|
+
label={t('orderInstructions', 'Instructions:')}
|
|
69
|
+
value={row.instructions ?? t('NoInstructionLeft', 'No instructions are provided.')}
|
|
70
|
+
/>
|
|
71
|
+
|
|
83
72
|
{row.fulfillerStatus === 'DECLINED' && (
|
|
84
|
-
<
|
|
85
|
-
<StructuredListCell> {t('reasonForDecline', 'Reason for decline:')}</StructuredListCell>
|
|
86
|
-
<StructuredListCell>{row.fulfillerComment}</StructuredListCell>
|
|
87
|
-
</StructuredListRow>
|
|
73
|
+
<OrderDetailRow label={t('reasonForDecline', 'Reason for decline:')} value={row.fulfillerComment} />
|
|
88
74
|
)}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</
|
|
95
|
-
|
|
75
|
+
</StructuredListBody>
|
|
76
|
+
</StructuredListWrapper>
|
|
77
|
+
{row.fulfillerStatus === 'COMPLETED' && (
|
|
78
|
+
<Accordion>
|
|
79
|
+
<AccordionItem
|
|
80
|
+
title={<span className={styles.accordionTitle}>{t('viewTestResults', 'View test results')}</span>}
|
|
81
|
+
>
|
|
82
|
+
<div className={styles.viewResults}>
|
|
83
|
+
<ExtensionSlot
|
|
84
|
+
className={styles.labResultSlot}
|
|
85
|
+
state={{ order: row }}
|
|
86
|
+
name="completed-lab-order-results-slot"
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
</AccordionItem>
|
|
90
|
+
</Accordion>
|
|
91
|
+
)}
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<div></div>
|
|
118
|
-
)}
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
93
|
+
<div className={styles.buttonSection}>
|
|
94
|
+
{/* @ts-ignore */}
|
|
95
|
+
{row.fulfillerStatus === 'New' || row.fulfillerStatus === 'RECEIVED' || row.fulfillerStatus == null ? (
|
|
96
|
+
<>
|
|
97
|
+
<div className={styles.testsOrderedActions}>
|
|
98
|
+
<ExtensionSlot state={{ order: row }} name="rejected-ordered-actions-slot" />
|
|
99
|
+
<ExtensionSlot state={{ order: row }} name="tests-ordered-actions-slot" />
|
|
100
|
+
</div>
|
|
101
|
+
</>
|
|
102
|
+
) : row.fulfillerStatus === 'IN_PROGRESS' ? (
|
|
103
|
+
<>
|
|
104
|
+
<div className={styles.testsOrderedActions}>
|
|
105
|
+
<ExtensionSlot
|
|
106
|
+
className={styles.menuLink}
|
|
107
|
+
state={{ order: row }}
|
|
108
|
+
name="inprogress-tests-actions-slot"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</>
|
|
112
|
+
) : null}
|
|
121
113
|
</div>
|
|
122
|
-
|
|
114
|
+
</div>
|
|
115
|
+
))}
|
|
123
116
|
</div>
|
|
124
117
|
);
|
|
125
118
|
};
|
|
@@ -7,29 +7,14 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
align-items: flex-start;
|
|
10
|
-
padding-top: layout.$spacing-03;
|
|
11
10
|
width: 100%;
|
|
12
|
-
margin-left: layout.$spacing-05;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.nameOrderRow {
|
|
16
|
-
border-top: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.nameOrder {
|
|
20
|
-
// TODO: Prefer type styles over scales as mentioned here: https://carbondesignsystem.com/elements/typography/code/#type-scale
|
|
21
|
-
font-size: type.type-scale(2);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.testOrder {
|
|
25
|
-
font-size: type.type-scale(2);
|
|
26
|
-
font-weight: bold;
|
|
27
11
|
}
|
|
28
12
|
|
|
29
13
|
.testsOrderedActions {
|
|
30
|
-
margin-left: auto;
|
|
31
14
|
display: flex;
|
|
32
|
-
|
|
15
|
+
justify-content: flex-end;
|
|
16
|
+
padding: layout.$spacing-03 0;
|
|
17
|
+
width: 100%;
|
|
33
18
|
}
|
|
34
19
|
|
|
35
20
|
.menuLink {
|
|
@@ -40,53 +25,35 @@
|
|
|
40
25
|
width: 80%;
|
|
41
26
|
display: flex;
|
|
42
27
|
flex-direction: column;
|
|
43
|
-
padding: layout.$spacing-05;
|
|
44
|
-
margin-left: layout.$spacing-13;
|
|
45
28
|
background-color: colors.$white-0;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.orderUrgency {
|
|
50
|
-
display: flex;
|
|
51
|
-
justify-content: flex-end;
|
|
52
|
-
width: 100%;
|
|
53
|
-
padding: 0 layout.$spacing-03;
|
|
54
|
-
margin-bottom: layout.$spacing-03;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.orderHeader {
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: space-between;
|
|
60
|
-
width: 100%;
|
|
61
|
-
padding: 0;
|
|
62
|
-
margin-bottom: layout.$spacing-03;
|
|
29
|
+
padding: layout.$spacing-03;
|
|
30
|
+
gap: layout.$spacing-03;
|
|
31
|
+
margin-bottom: layout.$spacing-05;
|
|
63
32
|
}
|
|
64
33
|
|
|
65
|
-
.
|
|
66
|
-
|
|
34
|
+
.orderDetailsContainer:last-child {
|
|
35
|
+
margin-bottom: 0;
|
|
67
36
|
}
|
|
68
37
|
|
|
69
|
-
.
|
|
70
|
-
|
|
38
|
+
.orderDetailsRow {
|
|
39
|
+
&:first-child {
|
|
40
|
+
border-top: none !important;
|
|
41
|
+
}
|
|
71
42
|
}
|
|
72
43
|
|
|
73
|
-
.
|
|
74
|
-
|
|
75
|
-
|
|
44
|
+
.orderDetailsWrapper {
|
|
45
|
+
:global(.cds--structured-list-td) {
|
|
46
|
+
align-content: center;
|
|
47
|
+
padding: layout.$spacing-03 !important;
|
|
48
|
+
}
|
|
76
49
|
}
|
|
77
50
|
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
font-size: type.type-scale(1);
|
|
51
|
+
.textBold {
|
|
52
|
+
font-weight: bold;
|
|
81
53
|
}
|
|
82
54
|
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.instructionLabel {
|
|
88
|
-
font-weight: bold;
|
|
89
|
-
font-size: type.type-scale(2);
|
|
55
|
+
.orderDetailsTextBold {
|
|
56
|
+
@extend .textBold;
|
|
90
57
|
}
|
|
91
58
|
|
|
92
59
|
.labResultSlot {
|
|
@@ -95,7 +62,7 @@
|
|
|
95
62
|
}
|
|
96
63
|
|
|
97
64
|
.accordionTitle {
|
|
98
|
-
|
|
65
|
+
@extend .textBold;
|
|
99
66
|
}
|
|
100
67
|
|
|
101
68
|
.instructionLabelContainer {
|
|
@@ -103,3 +70,58 @@
|
|
|
103
70
|
align-items: center;
|
|
104
71
|
justify-content: center;
|
|
105
72
|
}
|
|
73
|
+
|
|
74
|
+
.pill {
|
|
75
|
+
@include type.type-style('label-01');
|
|
76
|
+
display: inline-block;
|
|
77
|
+
background-color: colors.$gray-20;
|
|
78
|
+
border-radius: layout.$spacing-03;
|
|
79
|
+
padding: layout.$spacing-02;
|
|
80
|
+
padding-inline: layout.$spacing-03;
|
|
81
|
+
text-align: center;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.priorityPill {
|
|
88
|
+
@extend .pill;
|
|
89
|
+
|
|
90
|
+
&[data-urgency='ROUTINE'] {
|
|
91
|
+
background-color: colors.$green-20;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&[data-urgency='ON SCHEDULED_DATE'] {
|
|
95
|
+
background-color: colors.$red-20;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.statusPill {
|
|
100
|
+
@extend .pill;
|
|
101
|
+
|
|
102
|
+
&[data-status='RECEIVED'] {
|
|
103
|
+
background-color: colors.$blue-20;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&[data-status='IN PROGRESS'] {
|
|
107
|
+
background-color: colors.$cyan-20;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&[data-status='ON HOLD'] {
|
|
111
|
+
background-color: colors.$teal-20;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&[data-status='EXCEPTION'] {
|
|
115
|
+
background-color: colors.$magenta-20;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&[data-status='COMPLETED'] {
|
|
119
|
+
background-color: colors.$green-20;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&[data-status='DISCONTINUED'],
|
|
123
|
+
&[data-status='DECLINED'],
|
|
124
|
+
&[data-status='Order not picked'] {
|
|
125
|
+
background-color: colors.$red-20;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -23,14 +23,13 @@ import {
|
|
|
23
23
|
Tile,
|
|
24
24
|
} from '@carbon/react';
|
|
25
25
|
import { ExtensionSlot, formatDate, parseDate, showModal, usePagination } from '@openmrs/esm-framework';
|
|
26
|
-
import { type Order } from '@openmrs/esm-patient-common-lib';
|
|
27
|
-
import { upperCase } from 'lodash-es';
|
|
28
26
|
import { useTranslation } from 'react-i18next';
|
|
29
|
-
import {
|
|
27
|
+
import { type Order } from '@openmrs/esm-patient-common-lib';
|
|
30
28
|
import type { FulfillerStatus, OrdersDataTableProps } from '../../types';
|
|
29
|
+
import { useLabOrders, useSearchGroupedResults } from '../../laboratory-resource';
|
|
30
|
+
import { OrdersDateRangePicker } from './orders-date-range-picker.component';
|
|
31
31
|
import ListOrderDetails from './list-order-details.component';
|
|
32
32
|
import styles from './orders-data-table.scss';
|
|
33
|
-
import { OrdersDateRangePicker } from './orders-date-range-picker.component';
|
|
34
33
|
|
|
35
34
|
const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
36
35
|
const { t } = useTranslation();
|
|
@@ -127,7 +126,6 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
|
127
126
|
});
|
|
128
127
|
};
|
|
129
128
|
|
|
130
|
-
|
|
131
129
|
const tableRows = useMemo(() => {
|
|
132
130
|
return paginatedLabOrders.map((order) => ({
|
|
133
131
|
id: order.patientId,
|
|
@@ -138,13 +136,21 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
|
138
136
|
patientGender: order.orders[0]?.patient?.person?.gender || '',
|
|
139
137
|
action: order.orders.some((o) => o.fulfillerStatus === 'COMPLETED') ? (
|
|
140
138
|
<div className={styles.actionCell}>
|
|
141
|
-
<OverflowMenu aria-label="Actions" iconDescription="Actions"
|
|
142
|
-
<ExtensionSlot
|
|
139
|
+
<OverflowMenu aria-label="Actions" flipped iconDescription="Actions">
|
|
140
|
+
<ExtensionSlot
|
|
141
|
+
className={styles.transitionOverflowMenuItemSlot}
|
|
142
|
+
name="transition-overflow-menu-item-slot"
|
|
143
|
+
state={{ patientUuid: order?.patientId }}
|
|
144
|
+
// Without tabIndex={0} here, the overflow menu incorrectly sets initial focus to the second item instead of the first.
|
|
145
|
+
tabIndex={0}
|
|
146
|
+
/>
|
|
143
147
|
<OverflowMenuItem
|
|
148
|
+
className={styles.menuitem}
|
|
144
149
|
itemText={t('editResults', 'Edit results')}
|
|
145
150
|
onClick={() => handleLaunchModal(order?.orders)}
|
|
146
151
|
/>
|
|
147
152
|
<OverflowMenuItem
|
|
153
|
+
className={styles.menuitem}
|
|
148
154
|
itemText={t('printTestResults', 'Print test results')}
|
|
149
155
|
onClick={() => handlePrintModal(order?.orders)}
|
|
150
156
|
/>
|
|
@@ -155,11 +161,11 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
|
155
161
|
}, [paginatedLabOrders, t]);
|
|
156
162
|
|
|
157
163
|
if (isLoading) {
|
|
158
|
-
return <DataTableSkeleton
|
|
164
|
+
return <DataTableSkeleton role="progressbar" showHeader={false} showToolbar={false} />;
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
return (
|
|
162
|
-
<DataTable rows={tableRows} headers={columns} useZebraStyles
|
|
168
|
+
<DataTable rows={tableRows} headers={columns} useZebraStyles>
|
|
163
169
|
{({ getExpandHeaderProps, getHeaderProps, getRowProps, getTableProps, headers, rows }) => (
|
|
164
170
|
<TableContainer className={styles.tableContainer}>
|
|
165
171
|
<TableToolbar>
|
|
@@ -173,6 +179,7 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
|
173
179
|
}
|
|
174
180
|
items={orderStatuses}
|
|
175
181
|
itemToString={(item) => item?.display}
|
|
182
|
+
label=""
|
|
176
183
|
onChange={handleOrderStatusChange}
|
|
177
184
|
titleText={t('filterOrdersByStatus', 'Filter orders by status') + ':'}
|
|
178
185
|
type="inline"
|
|
@@ -183,7 +190,7 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
|
183
190
|
<Layer className={styles.toolbarItem}>
|
|
184
191
|
<TableToolbarSearch
|
|
185
192
|
expanded
|
|
186
|
-
onChange={(e) => setSearchString(e.target.value)}
|
|
193
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearchString(e.target.value)}
|
|
187
194
|
placeholder={t('searchThisList', 'Search this list')}
|
|
188
195
|
size="sm"
|
|
189
196
|
/>
|
|
@@ -193,9 +200,9 @@ const OrdersDataTable: React.FC<OrdersDataTableProps> = (props) => {
|
|
|
193
200
|
<Table className={styles.tableWrapper} {...getTableProps()}>
|
|
194
201
|
<TableHead>
|
|
195
202
|
<TableRow>
|
|
196
|
-
<TableExpandHeader enableToggle
|
|
203
|
+
<TableExpandHeader enableToggle {...getExpandHeaderProps()} />
|
|
197
204
|
{headers.map((header) => (
|
|
198
|
-
<TableHeader {...getHeaderProps({ header })}>{header.header
|
|
205
|
+
<TableHeader {...getHeaderProps({ header })}>{header.header}</TableHeader>
|
|
199
206
|
))}
|
|
200
207
|
</TableRow>
|
|
201
208
|
</TableHead>
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
.tableContainer {
|
|
6
6
|
border: 1px solid colors.$gray-20;
|
|
7
7
|
background-color: colors.$gray-10;
|
|
8
|
-
margin: layout.$spacing-05;
|
|
9
8
|
padding: 0;
|
|
10
9
|
|
|
11
10
|
:global(.cds--data-table-content) {
|
|
@@ -43,10 +42,6 @@
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
.loader {
|
|
47
|
-
margin: layout.$spacing-05;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
45
|
.toolbarItem {
|
|
51
46
|
margin-left: layout.$spacing-05;
|
|
52
47
|
display: flex;
|
|
@@ -114,5 +109,16 @@
|
|
|
114
109
|
|
|
115
110
|
.tableToolBar {
|
|
116
111
|
height: auto;
|
|
117
|
-
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.menuitem {
|
|
115
|
+
max-width: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.transitionOverflowMenuItemSlot {
|
|
119
|
+
min-width: 100%;
|
|
120
|
+
|
|
121
|
+
:global(.cds--overflow-menu-options__btn) {
|
|
122
|
+
min-width: 100%;
|
|
123
|
+
}
|
|
118
124
|
}
|
|
@@ -30,8 +30,8 @@ export const OrdersDateRangePicker = () => {
|
|
|
30
30
|
maxDate={currentDate.toISOString()}
|
|
31
31
|
value={dateRange}
|
|
32
32
|
>
|
|
33
|
-
<DatePickerInput id="date-picker-input-id-start" placeholder="dd/mm/yyyy" size="md" />
|
|
34
|
-
<DatePickerInput id="date-picker-input-id-finish" placeholder="dd/mm/yyyy" size="md" />
|
|
33
|
+
<DatePickerInput id="date-picker-input-id-start" labelText="" placeholder="dd/mm/yyyy" size="md" />
|
|
34
|
+
<DatePickerInput id="date-picker-input-id-finish" labelText="" placeholder="dd/mm/yyyy" size="md" />
|
|
35
35
|
</DatePicker>
|
|
36
36
|
</div>
|
|
37
37
|
);
|
|
@@ -22,16 +22,14 @@ const Overlay: React.FC = () => {
|
|
|
22
22
|
</Button>
|
|
23
23
|
</div>
|
|
24
24
|
) : (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<div className={styles.headerContent}>{header}</div>
|
|
34
|
-
</Header>
|
|
25
|
+
<div onClick={() => closeOverlay()}>
|
|
26
|
+
<Header aria-label={t('tabletOverlay', 'Tablet overlay')} className={styles.tabletOverlayHeader}>
|
|
27
|
+
<Button hasIconOnly>
|
|
28
|
+
<ArrowLeft size={16} />
|
|
29
|
+
</Button>
|
|
30
|
+
<div className={styles.headerContent}>{header}</div>
|
|
31
|
+
</Header>
|
|
32
|
+
</div>
|
|
35
33
|
)}
|
|
36
34
|
<div>{component}</div>
|
|
37
35
|
</div>
|
package/src/index.ts
CHANGED
|
@@ -55,6 +55,7 @@ export const completedLabRequestsTable = getAsyncLifecycle(
|
|
|
55
55
|
options,
|
|
56
56
|
);
|
|
57
57
|
|
|
58
|
+
// t('Declined tests', 'Declined tests')
|
|
58
59
|
export const declinedLabRequestsTable = getAsyncLifecycle(
|
|
59
60
|
() => import('./lab-tabs/data-table-extensions/declined-lab-requests-table-extension'),
|
|
60
61
|
options,
|
|
@@ -11,7 +11,7 @@ interface PickLabRequestActionMenuProps {
|
|
|
11
11
|
|
|
12
12
|
const PickupLabRequestAction: React.FC<PickLabRequestActionMenuProps> = ({ order }) => {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
|
-
const
|
|
14
|
+
const unsupportedStatuses = ['COMPLETED', 'DECLINED', 'IN_PROGRESS'];
|
|
15
15
|
|
|
16
16
|
const launchModal = useCallback(() => {
|
|
17
17
|
const dispose = showModal('pickup-lab-request-modal', {
|
|
@@ -23,13 +23,13 @@ const PickupLabRequestAction: React.FC<PickLabRequestActionMenuProps> = ({ order
|
|
|
23
23
|
return (
|
|
24
24
|
<Button
|
|
25
25
|
className={styles.actionButton}
|
|
26
|
-
disabled={
|
|
26
|
+
disabled={unsupportedStatuses.includes(order.fulfillerStatus)}
|
|
27
27
|
size="sm"
|
|
28
28
|
kind="primary"
|
|
29
|
-
key={
|
|
29
|
+
key={order.uuid}
|
|
30
30
|
onClick={launchModal}
|
|
31
31
|
>
|
|
32
|
-
{t('
|
|
32
|
+
{t('pickRequest', 'Pick lab request')}
|
|
33
33
|
</Button>
|
|
34
34
|
);
|
|
35
35
|
};
|