@openmrs/esm-laboratory-app 1.1.2-pre.88 → 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.
Files changed (257) hide show
  1. package/.turbo/cache/99f2b2ec58ba1a5e-meta.json +1 -0
  2. package/.turbo/cache/99f2b2ec58ba1a5e.tar.zst +0 -0
  3. package/.turbo/turbo-build.log +27 -29
  4. package/dist/1026.js +2 -0
  5. package/dist/1026.js.map +1 -0
  6. package/dist/1083.js +1 -0
  7. package/dist/{7328.js.map → 1083.js.map} +1 -1
  8. package/dist/1119.js +1 -0
  9. package/dist/1120.js +1 -0
  10. package/dist/1120.js.map +1 -0
  11. package/dist/1197.js +1 -0
  12. package/dist/1788.js +1 -0
  13. package/dist/1788.js.map +1 -0
  14. package/dist/2058.js +1 -0
  15. package/dist/2058.js.map +1 -0
  16. package/dist/2146.js +1 -0
  17. package/dist/2246.js +1 -0
  18. package/dist/2246.js.map +1 -0
  19. package/dist/2690.js +1 -0
  20. package/dist/2934.js +2 -0
  21. package/dist/2934.js.map +1 -0
  22. package/dist/3099.js +1 -0
  23. package/dist/3495.js +2 -0
  24. package/dist/3495.js.map +1 -0
  25. package/dist/3584.js +1 -0
  26. package/dist/3656.js +1 -0
  27. package/dist/{8684.js.map → 3656.js.map} +1 -1
  28. package/dist/3671.js +1 -0
  29. package/dist/3671.js.map +1 -0
  30. package/dist/4055.js +1 -0
  31. package/dist/4069.js +1 -0
  32. package/dist/{7724.js.map → 4069.js.map} +1 -1
  33. package/dist/4132.js +1 -0
  34. package/dist/4239.js +1 -0
  35. package/dist/{6092.js.map → 4239.js.map} +1 -1
  36. package/dist/4300.js +1 -0
  37. package/dist/4335.js +1 -0
  38. package/dist/4369.js +1 -0
  39. package/dist/{2156.js.map → 4369.js.map} +1 -1
  40. package/dist/4618.js +1 -0
  41. package/dist/4652.js +1 -0
  42. package/dist/4944.js +1 -0
  43. package/dist/5085.js +1 -0
  44. package/dist/5085.js.map +1 -0
  45. package/dist/5173.js +1 -0
  46. package/dist/520.js +2 -0
  47. package/dist/{7936.js.LICENSE.txt → 520.js.LICENSE.txt} +5 -0
  48. package/dist/520.js.map +1 -0
  49. package/dist/5241.js +1 -0
  50. package/dist/5442.js +1 -0
  51. package/dist/5661.js +1 -0
  52. package/dist/6022.js +1 -0
  53. package/dist/6052.js +1 -0
  54. package/dist/6052.js.map +1 -0
  55. package/dist/6134.js +1 -0
  56. package/dist/6134.js.map +1 -0
  57. package/dist/6468.js +1 -0
  58. package/dist/6547.js +1 -0
  59. package/dist/6547.js.map +1 -0
  60. package/dist/6679.js +1 -0
  61. package/dist/6840.js +1 -0
  62. package/dist/6859.js +1 -0
  63. package/dist/7003.js +2 -0
  64. package/dist/7003.js.LICENSE.txt +9 -0
  65. package/dist/7003.js.map +1 -0
  66. package/dist/7097.js +1 -0
  67. package/dist/7159.js +1 -0
  68. package/dist/723.js +1 -0
  69. package/dist/7423.js +1 -0
  70. package/dist/{1708.js.map → 7423.js.map} +1 -1
  71. package/dist/7617.js +1 -0
  72. package/dist/795.js +1 -0
  73. package/dist/8163.js +1 -0
  74. package/dist/8349.js +1 -0
  75. package/dist/8554.js +1 -0
  76. package/dist/{3956.js.map → 8554.js.map} +1 -1
  77. package/dist/8618.js +1 -0
  78. package/dist/8667.js +1 -0
  79. package/dist/{1636.js.map → 8667.js.map} +1 -1
  80. package/dist/876.js +1 -0
  81. package/dist/876.js.map +1 -0
  82. package/dist/890.js +1 -0
  83. package/dist/9214.js +1 -0
  84. package/dist/9538.js +1 -0
  85. package/dist/9569.js +1 -0
  86. package/dist/9630.js +2 -0
  87. package/dist/9630.js.LICENSE.txt +29 -0
  88. package/dist/9630.js.map +1 -0
  89. package/dist/986.js +1 -0
  90. package/dist/9879.js +1 -0
  91. package/dist/9895.js +1 -0
  92. package/dist/9900.js +1 -0
  93. package/dist/9913.js +1 -0
  94. package/dist/main.js +1 -1
  95. package/dist/main.js.LICENSE.txt +5 -0
  96. package/dist/main.js.map +1 -1
  97. package/dist/openmrs-esm-laboratory-app.js +1 -1
  98. package/dist/openmrs-esm-laboratory-app.js.buildmanifest.json +429 -363
  99. package/dist/openmrs-esm-laboratory-app.js.map +1 -1
  100. package/dist/routes.json +1 -1
  101. package/e2e/README.md +117 -0
  102. package/e2e/commands/encounter-operations.ts +63 -0
  103. package/e2e/commands/index.ts +5 -0
  104. package/e2e/commands/patient-operations.ts +109 -0
  105. package/e2e/commands/provider-operations.ts +9 -0
  106. package/e2e/commands/test-order-operations.ts +46 -0
  107. package/e2e/commands/types/index.ts +157 -0
  108. package/e2e/commands/visit-operations.ts +38 -0
  109. package/e2e/core/global-setup.ts +32 -0
  110. package/e2e/core/index.ts +1 -0
  111. package/e2e/core/test.ts +31 -0
  112. package/e2e/fixtures/api.ts +27 -0
  113. package/e2e/fixtures/fhirApi.ts +28 -0
  114. package/e2e/fixtures/index.ts +2 -0
  115. package/e2e/pages/index.ts +1 -0
  116. package/e2e/pages/laboratory-page.ts +9 -0
  117. package/e2e/specs/add-lab-results.spec.ts +100 -0
  118. package/e2e/specs/test-orders.spec.ts +16 -0
  119. package/e2e/support/github/Dockerfile +34 -0
  120. package/e2e/support/github/docker-compose.yml +24 -0
  121. package/e2e/support/github/run-e2e-docker-env.sh +58 -0
  122. package/example.env +7 -0
  123. package/jest.config.js +10 -2
  124. package/package.json +9 -6
  125. package/playwright.config.ts +36 -0
  126. package/src/components/orders-table/list-order-details.component.tsx +91 -98
  127. package/src/components/orders-table/list-order-details.scss +77 -55
  128. package/src/components/orders-table/orders-data-table.component.tsx +19 -12
  129. package/src/components/orders-table/orders-data-table.scss +12 -6
  130. package/src/components/orders-table/orders-date-range-picker.component.tsx +2 -2
  131. package/src/components/overlay/overlay.component.tsx +8 -10
  132. package/src/index.ts +1 -0
  133. package/src/lab-tabs/actions/pickup-lab-request-action.component.tsx +4 -4
  134. package/src/lab-tabs/laboratory-tabs.component.tsx +48 -50
  135. package/src/lab-tabs/laboratory-tabs.scss +0 -9
  136. package/translations/am.json +6 -5
  137. package/translations/ar.json +6 -5
  138. package/translations/ar_SY.json +6 -5
  139. package/translations/bn.json +6 -5
  140. package/translations/de.json +6 -5
  141. package/translations/en.json +4 -4
  142. package/translations/en_US.json +68 -0
  143. package/translations/es.json +6 -5
  144. package/translations/es_MX.json +6 -5
  145. package/translations/fr.json +6 -5
  146. package/translations/he.json +6 -5
  147. package/translations/hi.json +6 -5
  148. package/translations/hi_IN.json +6 -5
  149. package/translations/id.json +64 -63
  150. package/translations/it.json +6 -5
  151. package/translations/ka.json +68 -0
  152. package/translations/km.json +6 -5
  153. package/translations/ku.json +6 -5
  154. package/translations/ky.json +6 -5
  155. package/translations/lg.json +6 -5
  156. package/translations/ne.json +6 -5
  157. package/translations/pl.json +6 -5
  158. package/translations/pt.json +6 -5
  159. package/translations/pt_BR.json +6 -5
  160. package/translations/qu.json +6 -5
  161. package/translations/ro_RO.json +65 -64
  162. package/translations/ru_RU.json +6 -5
  163. package/translations/si.json +6 -5
  164. package/translations/sw.json +6 -5
  165. package/translations/sw_KE.json +6 -5
  166. package/translations/tr.json +6 -5
  167. package/translations/tr_TR.json +6 -5
  168. package/translations/uk.json +6 -5
  169. package/translations/uz.json +6 -5
  170. package/translations/uz@Latn.json +6 -5
  171. package/translations/uz_UZ.json +6 -5
  172. package/translations/vi.json +6 -5
  173. package/translations/zh.json +6 -5
  174. package/translations/zh_CN.json +9 -8
  175. package/.turbo/cache/4de59823a6517c3e-meta.json +0 -1
  176. package/.turbo/cache/4de59823a6517c3e.tar.zst +0 -0
  177. package/dist/1448.js +0 -1
  178. package/dist/1636.js +0 -1
  179. package/dist/1708.js +0 -1
  180. package/dist/2156.js +0 -1
  181. package/dist/2326.js +0 -1
  182. package/dist/2328.js +0 -1
  183. package/dist/2636.js +0 -1
  184. package/dist/2636.js.map +0 -1
  185. package/dist/2664.js +0 -1
  186. package/dist/2816.js +0 -1
  187. package/dist/3240.js +0 -1
  188. package/dist/3264.js +0 -1
  189. package/dist/3264.js.map +0 -1
  190. package/dist/370.js +0 -1
  191. package/dist/3724.js +0 -1
  192. package/dist/3724.js.map +0 -1
  193. package/dist/3872.js +0 -1
  194. package/dist/3956.js +0 -1
  195. package/dist/400.js +0 -1
  196. package/dist/400.js.map +0 -1
  197. package/dist/436.js +0 -2
  198. package/dist/436.js.map +0 -1
  199. package/dist/4412.js +0 -1
  200. package/dist/4592.js +0 -1
  201. package/dist/464.js +0 -1
  202. package/dist/4656.js +0 -1
  203. package/dist/4744.js +0 -1
  204. package/dist/4868.js +0 -1
  205. package/dist/5028.js +0 -1
  206. package/dist/5086.js +0 -1
  207. package/dist/5136.js +0 -1
  208. package/dist/5144.js +0 -2
  209. package/dist/5144.js.map +0 -1
  210. package/dist/552.js +0 -1
  211. package/dist/5992.js +0 -1
  212. package/dist/6048.js +0 -1
  213. package/dist/6048.js.map +0 -1
  214. package/dist/6092.js +0 -1
  215. package/dist/6172.js +0 -1
  216. package/dist/6172.js.map +0 -1
  217. package/dist/6352.js +0 -1
  218. package/dist/6504.js +0 -1
  219. package/dist/6676.js +0 -1
  220. package/dist/6676.js.map +0 -1
  221. package/dist/6856.js +0 -1
  222. package/dist/6936.js +0 -1
  223. package/dist/7295.js +0 -1
  224. package/dist/7295.js.map +0 -1
  225. package/dist/7328.js +0 -1
  226. package/dist/7540.js +0 -1
  227. package/dist/7540.js.map +0 -1
  228. package/dist/7640.js +0 -1
  229. package/dist/7724.js +0 -1
  230. package/dist/7936.js +0 -2
  231. package/dist/7936.js.map +0 -1
  232. package/dist/8064.js +0 -1
  233. package/dist/8170.js +0 -1
  234. package/dist/8256.js +0 -1
  235. package/dist/8320.js +0 -1
  236. package/dist/8320.js.map +0 -1
  237. package/dist/8552.js +0 -1
  238. package/dist/8552.js.map +0 -1
  239. package/dist/8570.js +0 -1
  240. package/dist/8684.js +0 -1
  241. package/dist/8698.js +0 -1
  242. package/dist/8720.js +0 -1
  243. package/dist/8728.js +0 -2
  244. package/dist/8728.js.LICENSE.txt +0 -7
  245. package/dist/8728.js.map +0 -1
  246. package/dist/8936.js +0 -1
  247. package/dist/9064.js +0 -2
  248. package/dist/9064.js.map +0 -1
  249. package/dist/9372.js +0 -1
  250. package/dist/9464.js +0 -1
  251. package/dist/9656.js +0 -1
  252. package/dist/9832.js +0 -1
  253. package/dist/9864.js +0 -1
  254. package/dist/9960.js +0 -1
  255. /package/dist/{436.js.LICENSE.txt → 1026.js.LICENSE.txt} +0 -0
  256. /package/dist/{9064.js.LICENSE.txt → 2934.js.LICENSE.txt} +0 -0
  257. /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
- const ListOrderDetails: React.FC<ListOrdersDetailsProps> = (props) => {
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 = props.groupedOrders?.orders;
36
+ const orders = groupedOrders?.orders ?? [];
20
37
 
21
38
  return (
22
39
  <div>
23
- {orders &&
24
- orders.map((row) => (
25
- <div className={styles.orderDetailsContainer}>
26
- <div className={styles.orderUrgency}></div>
27
- <div className={styles.orderHeader}>
28
- <span className={styles.orderNumber}>
29
- {t('orderNumbers', 'Order number:')} {row.orderNumber}
30
- </span>
31
- <span className={styles.orderDate}>
32
- {t('orderDate', 'Order Date:')} {row.dateActivated}
33
- </span>
34
- </div>
35
- <div className={styles.orderStatus}>
36
- {t('orderStatus', 'Status:')}
37
- <Tag size="lg" type={row.fulfillerStatus ? 'green' : 'red'}>
38
- {row.fulfillerStatus || t('orderNotPicked', 'Order not picked')}
39
- </Tag>
40
- </div>
41
- <div>
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
- <div className={styles.viewResults}>
74
- <ExtensionSlot
75
- className={styles.labResultSlot}
76
- state={{ order: row }}
77
- name="completed-lab-order-results-slot"
78
- />
79
- </div>
80
- </AccordionItem>
81
- </Accordion>
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
- <StructuredListRow>
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
- <StructuredListRow className={styles.nameOrderRow}>
90
- <StructuredListCell>
91
- <span className={styles.nameOrder}>
92
- {t('ordererName', 'Orderer Name: ')} {capitalize(row.orderer?.display)}
93
- </span>
94
- </StructuredListCell>
95
- </StructuredListRow>
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
- <div className={styles.buttonSection}>
98
- {/* @ts-ignore */}
99
- {row.fulfillerStatus === 'New' || row.fulfillerStatus === 'RECEIVED' || row.fulfillerStatus == null ? (
100
- <>
101
- <div className={styles.testsOrderedActions}>
102
- <ExtensionSlot state={{ order: row }} name="rejected-ordered-actions-slot" />
103
- <ExtensionSlot state={{ order: row }} name="tests-ordered-actions-slot" />
104
- </div>
105
- </>
106
- ) : row.fulfillerStatus === 'IN_PROGRESS' ? (
107
- <>
108
- <div className={styles.testsOrderedActions}>
109
- <ExtensionSlot
110
- className={styles.menuLink}
111
- state={{ order: row }}
112
- name="inprogress-tests-actions-slot"
113
- />
114
- </div>
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
- padding-right: 1rem;
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
- margin: layout.$spacing-05 0;
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
- .orderNumber {
66
- font-size: type.type-scale(2);
34
+ .orderDetailsContainer:last-child {
35
+ margin-bottom: 0;
67
36
  }
68
37
 
69
- .orderStatus {
70
- font-size: type.type-scale(2);
38
+ .orderDetailsRow {
39
+ &:first-child {
40
+ border-top: none !important;
41
+ }
71
42
  }
72
43
 
73
- .orderDate {
74
- text-align: right;
75
- font-size: type.type-scale(2);
44
+ .orderDetailsWrapper {
45
+ :global(.cds--structured-list-td) {
46
+ align-content: center;
47
+ padding: layout.$spacing-03 !important;
48
+ }
76
49
  }
77
50
 
78
- .instructions {
79
- text-align: justify;
80
- font-size: type.type-scale(1);
51
+ .textBold {
52
+ font-weight: bold;
81
53
  }
82
54
 
83
- .urgencyStatus {
84
- font-size: type.type-scale(2);
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
- font-weight: bold;
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 { useLabOrders, useSearchGroupedResults } from '../../laboratory-resource';
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" flipped>
142
- <ExtensionSlot name="transition-overflow-menu-item-slot" state={{ patientUuid: order?.patientId }} />
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 className={styles.loader} role="progressbar" showHeader={false} showToolbar={false} />;
164
+ return <DataTableSkeleton role="progressbar" showHeader={false} showToolbar={false} />;
159
165
  }
160
166
 
161
167
  return (
162
- <DataTable rows={tableRows} headers={columns} useZebraStyles={labOrders?.length > 1}>
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={rows.length > 0} {...getExpandHeaderProps()} />
203
+ <TableExpandHeader enableToggle {...getExpandHeaderProps()} />
197
204
  {headers.map((header) => (
198
- <TableHeader {...getHeaderProps({ header })}>{header.header?.content ?? header.header}</TableHeader>
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
- padding-top: layout.$spacing-04;
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
- <Header
26
- onClick={() => closeOverlay()}
27
- aria-label={t('tabletOverlay', 'Tablet overlay')}
28
- className={styles.tabletOverlayHeader}
29
- >
30
- <Button hasIconOnly>
31
- <ArrowLeft size={16} />
32
- </Button>
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 unSupportedStatuses = ['IN_PROGRESS', 'COMPLETED', 'DECLINED'];
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={unSupportedStatuses.includes(order.fulfillerStatus)}
26
+ disabled={unsupportedStatuses.includes(order.fulfillerStatus)}
27
27
  size="sm"
28
28
  kind="primary"
29
- key={`${order.uuid}`}
29
+ key={order.uuid}
30
30
  onClick={launchModal}
31
31
  >
32
- {t('pickLabRequest', 'Pick Lab Request')}
32
+ {t('pickRequest', 'Pick lab request')}
33
33
  </Button>
34
34
  );
35
35
  };