@thrustdevs/esm-procedure-orders-app 1.0.2-pre.6

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 (207) hide show
  1. package/.turbo/turbo-build.log +41 -0
  2. package/README.md +7 -0
  3. package/dist/122.js +1 -0
  4. package/dist/122.js.map +1 -0
  5. package/dist/144.js +2 -0
  6. package/dist/144.js.LICENSE.txt +19 -0
  7. package/dist/144.js.map +1 -0
  8. package/dist/182.js +1 -0
  9. package/dist/182.js.map +1 -0
  10. package/dist/205.js +1 -0
  11. package/dist/205.js.map +1 -0
  12. package/dist/216.js +2 -0
  13. package/dist/216.js.LICENSE.txt +9 -0
  14. package/dist/216.js.map +1 -0
  15. package/dist/290.js +2 -0
  16. package/dist/290.js.LICENSE.txt +5 -0
  17. package/dist/290.js.map +1 -0
  18. package/dist/300.js +1 -0
  19. package/dist/341.js +2 -0
  20. package/dist/341.js.LICENSE.txt +29 -0
  21. package/dist/341.js.map +1 -0
  22. package/dist/41.js +2 -0
  23. package/dist/41.js.LICENSE.txt +9 -0
  24. package/dist/41.js.map +1 -0
  25. package/dist/470.js +1 -0
  26. package/dist/470.js.map +1 -0
  27. package/dist/495.js +1 -0
  28. package/dist/495.js.map +1 -0
  29. package/dist/506.js +2 -0
  30. package/dist/506.js.LICENSE.txt +39 -0
  31. package/dist/506.js.map +1 -0
  32. package/dist/537.js +1 -0
  33. package/dist/537.js.map +1 -0
  34. package/dist/647.js +2 -0
  35. package/dist/647.js.LICENSE.txt +5 -0
  36. package/dist/647.js.map +1 -0
  37. package/dist/7.js +1 -0
  38. package/dist/7.js.map +1 -0
  39. package/dist/719.js +2 -0
  40. package/dist/719.js.LICENSE.txt +5 -0
  41. package/dist/719.js.map +1 -0
  42. package/dist/720.js +1 -0
  43. package/dist/720.js.map +1 -0
  44. package/dist/876.js +1 -0
  45. package/dist/876.js.map +1 -0
  46. package/dist/883.js +1 -0
  47. package/dist/883.js.map +1 -0
  48. package/dist/89.js +1 -0
  49. package/dist/89.js.map +1 -0
  50. package/dist/892.js +1 -0
  51. package/dist/892.js.map +1 -0
  52. package/dist/895.js +1 -0
  53. package/dist/895.js.map +1 -0
  54. package/dist/913.js +2 -0
  55. package/dist/913.js.LICENSE.txt +32 -0
  56. package/dist/913.js.map +1 -0
  57. package/dist/924.js +1 -0
  58. package/dist/924.js.map +1 -0
  59. package/dist/943.js +1 -0
  60. package/dist/943.js.map +1 -0
  61. package/dist/99.js +2 -0
  62. package/dist/99.js.LICENSE.txt +5 -0
  63. package/dist/99.js.map +1 -0
  64. package/dist/kenyaemr-esm-procedure-orders-app.js +1 -0
  65. package/dist/kenyaemr-esm-procedure-orders-app.js.buildmanifest.json +786 -0
  66. package/dist/kenyaemr-esm-procedure-orders-app.js.map +1 -0
  67. package/dist/main.js +2 -0
  68. package/dist/main.js.LICENSE.txt +35 -0
  69. package/dist/main.js.map +1 -0
  70. package/dist/routes.json +1 -0
  71. package/jest.config.js +8 -0
  72. package/package.json +55 -0
  73. package/src/completed-list/completed-list.component.tsx +40 -0
  74. package/src/completed-list/completed-list.resource.ts +0 -0
  75. package/src/completed-list/completed-list.scss +223 -0
  76. package/src/components/create-dashboard-link.component.tsx +35 -0
  77. package/src/components/overlay/hook.ts +47 -0
  78. package/src/components/overlay/overlay.component.tsx +42 -0
  79. package/src/components/overlay/overlay.scss +92 -0
  80. package/src/config-schema.ts +78 -0
  81. package/src/constants.ts +5 -0
  82. package/src/declarations.d.ts +6 -0
  83. package/src/empty-state/empty-state-component.tsx +21 -0
  84. package/src/empty-state/empty-state.scss +23 -0
  85. package/src/form/post-procedures/post-procedure-form.component.tsx +468 -0
  86. package/src/form/post-procedures/post-procedure-form.scss +189 -0
  87. package/src/form/post-procedures/post-procedure.resource.tsx +71 -0
  88. package/src/form/procedures-orders/add-procedures-order/add-procedures-order.scss +44 -0
  89. package/src/form/procedures-orders/add-procedures-order/add-procedures-order.workspace.tsx +93 -0
  90. package/src/form/procedures-orders/add-procedures-order/procedures-order-form.component.tsx +476 -0
  91. package/src/form/procedures-orders/add-procedures-order/procedures-order-form.scss +80 -0
  92. package/src/form/procedures-orders/add-procedures-order/procedures-order.ts +17 -0
  93. package/src/form/procedures-orders/add-procedures-order/procedures-type-search.scss +115 -0
  94. package/src/form/procedures-orders/add-procedures-order/procedures-type-search.tsx +236 -0
  95. package/src/form/procedures-orders/add-procedures-order/useProceduresTypes.ts +93 -0
  96. package/src/form/procedures-orders/api.ts +282 -0
  97. package/src/form/procedures-orders/order-config.ts +48 -0
  98. package/src/form/procedures-orders/procedures-order-basket-panel/procedures-icon.component.tsx +39 -0
  99. package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-item-tile.component.tsx +100 -0
  100. package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-item-tile.scss +72 -0
  101. package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-panel.extension.tsx +190 -0
  102. package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-panel.scss +74 -0
  103. package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket.scss +55 -0
  104. package/src/header/procedure-header.component.tsx +32 -0
  105. package/src/header/procedure-header.scss +70 -0
  106. package/src/header/procedure-illustration.component.tsx +52 -0
  107. package/src/hooks/useOrdersWorklist.ts +70 -0
  108. package/src/hooks/useSearchGroupedResults.ts +22 -0
  109. package/src/hooks/useSearchResults.ts +39 -0
  110. package/src/index.ts +59 -0
  111. package/src/left-panel-link.tsx +40 -0
  112. package/src/not-done-list/not-done-list.component.tsx +44 -0
  113. package/src/not-done-list/not-done.scss +207 -0
  114. package/src/patient-chart/patient-procedure-order-results-table.resource.ts +43 -0
  115. package/src/patient-chart/patient-procedure-order-results.component.tsx +12 -0
  116. package/src/patient-chart/patient-procedure-order-results.resource.ts +485 -0
  117. package/src/patient-chart/patient-procedure-results.component.tsx +30 -0
  118. package/src/patient-chart/procedure-active-order/procedure-active-order-results.component.tsx +390 -0
  119. package/src/patient-chart/procedure-active-order/procedure-active-order-results.scss +78 -0
  120. package/src/patient-chart/procedure-order-referals/procedure-order-referals.component.tsx +394 -0
  121. package/src/patient-chart/procedure-order-referals/procedure-order-referals.resource.tsx +0 -0
  122. package/src/patient-chart/procedure-order-referals/procedure-order-referals.scss +78 -0
  123. package/src/patient-chart/procedure-past-test/laboratory-past-test-order-results.component.tsx +366 -0
  124. package/src/patient-chart/procedure-past-test/laboratory-past-test-order-results.scss +74 -0
  125. package/src/patient-chart/procedure-tabs/laboratory-order-tabs.component.tsx +44 -0
  126. package/src/patient-chart/procedure-tabs/laboratory-order-tabs.scss +7 -0
  127. package/src/patient-chart/procedure-workspaces/laboratory-referral.workspace.component.tsx +11 -0
  128. package/src/patient-chart/procedure-workspaces/laboratory-referral.workspace.scss +0 -0
  129. package/src/patient-chart/results-summary/print-results-summary.component.tsx +152 -0
  130. package/src/patient-chart/results-summary/print-results-summary.scss +80 -0
  131. package/src/patient-chart/results-summary/print-results-table.component.tsx +134 -0
  132. package/src/patient-chart/results-summary/results-summary.resource.tsx +174 -0
  133. package/src/patient-chart/results-summary/results-summary.scss +158 -0
  134. package/src/patient-chart/results-summary/send-email-dialog.component.tsx +59 -0
  135. package/src/patient-chart/results-summary/test-children-results.component.tsx +177 -0
  136. package/src/patient-chart/results-summary/test-print-results-table.component.tsx +105 -0
  137. package/src/patient-chart/results-summary/test-results-table.component.tsx +103 -0
  138. package/src/print/print-procedure-results.component.tsx +49 -0
  139. package/src/print/print-procedure.component.tsx +105 -0
  140. package/src/print/print-procedure.scss +98 -0
  141. package/src/procedure-tabs/completed-tab.component.tsx +12 -0
  142. package/src/procedure-tabs/not-done-tab.component.tsx +12 -0
  143. package/src/procedure-tabs/referred-tab.component.tsx +12 -0
  144. package/src/procedure-tabs/work-list-tab.component.tsx +13 -0
  145. package/src/procedure.component.tsx +24 -0
  146. package/src/procedures-ordered/_pick-procedure-request-menu.component.tsx +33 -0
  147. package/src/procedures-ordered/pick-procedure-order/add-to-worklist-dialog.component.tsx +105 -0
  148. package/src/procedures-ordered/pick-procedure-order/add-to-worklist-dialog.resource.ts +106 -0
  149. package/src/procedures-ordered/pick-procedure-order/add-to-worklist-dialog.scss +38 -0
  150. package/src/procedures-ordered/pick-procedure-request-menu.component.tsx +32 -0
  151. package/src/procedures-ordered/procedure-dialogs/add-to-worklist-dialog.component.tsx +300 -0
  152. package/src/procedures-ordered/procedure-dialogs/add-to-worklist-dialog.resource.ts +153 -0
  153. package/src/procedures-ordered/procedure-dialogs/add-to-worklist-dialog.scss +38 -0
  154. package/src/procedures-ordered/procedure-instructions/instructions.scss +24 -0
  155. package/src/procedures-ordered/procedure-instructions/procedure-instructions-menu.component.tsx +32 -0
  156. package/src/procedures-ordered/procedure-instructions/procedure-instructions.component.tsx +78 -0
  157. package/src/procedures-ordered/procedure-instructions/procedure-instructions.scss +24 -0
  158. package/src/procedures-ordered/procedure-queue.scss +211 -0
  159. package/src/procedures-ordered/procedure-tabs.component.tsx +104 -0
  160. package/src/procedures-ordered/procedure-tests/procedure-tests.component.tsx +83 -0
  161. package/src/procedures-ordered/procedure-tests/procedure-tests.resource.ts +14 -0
  162. package/src/procedures-ordered/procedure-tests/procedure-tests.scss +12 -0
  163. package/src/procedures-ordered/procedures-ordered-list.component.tsx +38 -0
  164. package/src/procedures-ordered/reject-order-dialog/reject-order-dialog.scss +14 -0
  165. package/src/procedures-ordered/reject-order-dialog/reject-procedure-order-dialog.component.tsx +98 -0
  166. package/src/procedures-ordered/reject-reason/procedure-reject-reason-menu.component.tsx +32 -0
  167. package/src/procedures-ordered/reject-reason/procedure-reject-reason.component.tsx +40 -0
  168. package/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.component.tsx +42 -0
  169. package/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss +14 -0
  170. package/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.test.tsx +67 -0
  171. package/src/referred-procedures/referred-procedures.component.tsx +37 -0
  172. package/src/results/result-form-field.component.tsx +141 -0
  173. package/src/results/result-form.component.tsx +120 -0
  174. package/src/results/result-form.resource.ts +361 -0
  175. package/src/results/result-form.scss +22 -0
  176. package/src/root.component.tsx +16 -0
  177. package/src/routes.json +152 -0
  178. package/src/setup-tests.ts +7 -0
  179. package/src/shared/ui/common/action-button/action-button.component.tsx +68 -0
  180. package/src/shared/ui/common/action-button/action-button.scss +12 -0
  181. package/src/shared/ui/common/action-button/order-action-extension.component.tsx +21 -0
  182. package/src/shared/ui/common/grouped-orders-table.component.tsx +176 -0
  183. package/src/shared/ui/common/grouped-orders-table.scss +30 -0
  184. package/src/shared/ui/common/grouped-procedure-types.ts +47 -0
  185. package/src/shared/ui/common/list-order-details.component.tsx +171 -0
  186. package/src/shared/ui/common/list-order-details.resource.ts +41 -0
  187. package/src/shared/ui/common/list-order-details.scss +118 -0
  188. package/src/shared/ui/common/orders-date-range-picker.scss +15 -0
  189. package/src/shared/ui/common/orders-date-range-picker.tsx +38 -0
  190. package/src/summary-tiles/procedure-summary-tiles.component.tsx +36 -0
  191. package/src/summary-tiles/procedure-summary-tiles.scss +11 -0
  192. package/src/summary-tiles/procedure-summary.resource.tsx +79 -0
  193. package/src/summary-tiles/summary-tile.component.tsx +41 -0
  194. package/src/summary-tiles/summary-tile.scss +53 -0
  195. package/src/types/index.ts +661 -0
  196. package/src/types/patient-queue.ts +77 -0
  197. package/src/ui-components/overflow-menu.component.tsx +74 -0
  198. package/src/ui-components/overflow-menu.scss +39 -0
  199. package/src/utils/functions.ts +236 -0
  200. package/src/utils/orders-table/orders-data-table.component.tsx +129 -0
  201. package/src/utils/orders-table/orders-data-table.scss +50 -0
  202. package/src/work-list/work-list.component.tsx +38 -0
  203. package/src/work-list/work-list.resource.ts +26 -0
  204. package/src/work-list/work-list.scss +207 -0
  205. package/translations/en.json +141 -0
  206. package/tsconfig.json +5 -0
  207. package/webpack.config.js +1 -0
@@ -0,0 +1,153 @@
1
+ import { type FetchResponse, openmrsFetch, restBaseUrl, useConfig } from '@openmrs/esm-framework';
2
+ import { useMemo } from 'react';
3
+ import useSWR from 'swr';
4
+ import useSWRImmutable from 'swr/immutable';
5
+
6
+ export interface QueueRoomsResponse {
7
+ uuid: string;
8
+ display: string;
9
+ name: string;
10
+ description: string;
11
+ address1: string;
12
+ address2: string;
13
+ cityvillage: string;
14
+ stateprovince: string;
15
+ country: string;
16
+ postalcode: string;
17
+ latitude: string;
18
+ longitude: string;
19
+ countydistrict: string;
20
+ address3: string;
21
+ address4: string;
22
+ address5: string;
23
+ address6: string;
24
+ parentLocation: ParentLocation;
25
+ childLocations: string[];
26
+ retired: boolean;
27
+ attributes: string[];
28
+ address7: string;
29
+ address8: string;
30
+ address9: string;
31
+ address10: string;
32
+ address11: string;
33
+ address12: string;
34
+ address13: string;
35
+ address14: string;
36
+ address15: string;
37
+ resourceVersion: string;
38
+ }
39
+
40
+ export interface ParentLocation {
41
+ uuid: string;
42
+ display: string;
43
+ name: string;
44
+ description: string;
45
+ address1: string;
46
+ address2: string;
47
+ cityVillage: string;
48
+ stateProvince: string;
49
+ country: string;
50
+ postalcode: string;
51
+ latitude: string;
52
+ longitude: string;
53
+ countydistrict: string;
54
+ address3: string;
55
+ address4: string;
56
+ address5: string;
57
+ address6: string;
58
+ parentLocation: ParentLocation;
59
+ childLocations: ChildLocations[];
60
+ retired: boolean;
61
+ attributes: string[];
62
+ address7: string;
63
+ address8: string;
64
+ address9: string;
65
+ address10: string;
66
+ address11: string;
67
+ address12: string;
68
+ address13: string;
69
+ address14: string;
70
+ address15: string;
71
+ resourceversion: string;
72
+ }
73
+
74
+ export interface ChildLocations {
75
+ uuid: string;
76
+ display: string;
77
+ }
78
+
79
+ export interface ParentLocation {
80
+ uuid: string;
81
+ display: string;
82
+ }
83
+
84
+ // get referral locations
85
+ export function useReferralLocations() {
86
+ const config = useConfig();
87
+ const { laboratoryReferalDestinationUuid } = config;
88
+ const apiUrl = `${restBaseUrl}/concept/${laboratoryReferalDestinationUuid}`;
89
+ const { data, error, isLoading } = useSWRImmutable<FetchResponse>(apiUrl, openmrsFetch);
90
+
91
+ return {
92
+ referrals: data ? data?.data?.answers : [],
93
+ isLoading,
94
+ };
95
+ }
96
+
97
+ // get specimen types
98
+ export function useSpecimenTypes() {
99
+ const config = useConfig();
100
+ const { laboratorySpecimenTypeConcept } = config;
101
+
102
+ const apiUrl = `${restBaseUrl}/concept/${laboratorySpecimenTypeConcept}`;
103
+ const { data, error, isLoading } = useSWRImmutable<FetchResponse>(apiUrl, openmrsFetch);
104
+
105
+ let specimenTypes = [];
106
+ if (data) {
107
+ if (data?.data?.setMembers?.length) {
108
+ specimenTypes = data.data.setMembers;
109
+ } else if (data?.data?.answers?.length) {
110
+ specimenTypes = data.data.answers;
111
+ }
112
+ }
113
+
114
+ return {
115
+ specimenTypes: specimenTypes,
116
+ isLoading,
117
+ };
118
+ }
119
+
120
+ // generate specimen id
121
+ export async function GenerateSpecimenId(uuid: string) {
122
+ const abortController = new AbortController();
123
+ return openmrsFetch(`${restBaseUrl}/generatesampleId?uuid=${uuid}`, {
124
+ method: 'GET',
125
+ headers: {
126
+ 'Content-Type': 'application/json',
127
+ },
128
+ signal: abortController.signal,
129
+ });
130
+ }
131
+
132
+ // update Order
133
+ export async function UpdateOrder(uuid: string, body: any) {
134
+ const abortController = new AbortController();
135
+ return openmrsFetch(`${restBaseUrl}/order/${uuid}/fulfillerdetails`, {
136
+ method: 'POST',
137
+ headers: {
138
+ 'Content-Type': 'application/json',
139
+ },
140
+ signal: abortController.signal,
141
+ body: body,
142
+ });
143
+ }
144
+
145
+ export async function GetOrderByUuid(uuid: string) {
146
+ const abortController = new AbortController();
147
+ return openmrsFetch(`${restBaseUrl}/order/${uuid}`, {
148
+ headers: {
149
+ 'Content-Type': 'application/json',
150
+ },
151
+ signal: abortController.signal,
152
+ });
153
+ }
@@ -0,0 +1,38 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+
4
+ .radioButton {
5
+ padding: spacing.$spacing-02 spacing.$spacing-02;
6
+ margin: spacing.$spacing-03 0;
7
+ }
8
+
9
+ .section {
10
+ margin: spacing.$spacing-03;
11
+ }
12
+
13
+ .sectionTitle {
14
+ margin-bottom: spacing.$spacing-04;
15
+ }
16
+
17
+ .modalBody {
18
+ padding-bottom: spacing.$spacing-05;
19
+ }
20
+
21
+ .container {
22
+ display: 'flex';
23
+ align-items: 'center';
24
+ justify-content: 'space-between';
25
+ align-content: 'stretch';
26
+ }
27
+
28
+ .specimenContainer {
29
+ display: 'flex';
30
+ align-items: 'center';
31
+ justify-content: 'space-between';
32
+ column-gap: '10px';
33
+ }
34
+
35
+ .inputText {
36
+ display: 'flex';
37
+ align-items: 'center';
38
+ }
@@ -0,0 +1,24 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+
4
+ .section {
5
+ margin: spacing.$spacing-03;
6
+ }
7
+
8
+ .sectionTitle {
9
+ margin-bottom: spacing.$spacing-04;
10
+ }
11
+
12
+ .modalBody {
13
+ padding-bottom: spacing.$spacing-05;
14
+ }
15
+ .instructions {
16
+ margin-top: 1rem;
17
+ white-space: pre-wrap;
18
+ }
19
+
20
+ .modalBody {
21
+ :global(.cds--tooltip-trigger__wrapper) {
22
+ visibility: hidden;
23
+ }
24
+ }
@@ -0,0 +1,32 @@
1
+ import { OverflowMenuItem } from '@carbon/react';
2
+ import { showModal } from '@openmrs/esm-framework';
3
+ import React, { useCallback } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ interface ProcedureInstructionsActionMenuProps {
7
+ order: any;
8
+ closeModal: () => void;
9
+ }
10
+
11
+ const ProcedureInstructionsActionMenu: React.FC<ProcedureInstructionsActionMenuProps> = ({ order }) => {
12
+ const { t } = useTranslation();
13
+
14
+ const launchProcedureInstructionsModal = useCallback(() => {
15
+ const dispose = showModal('procedure-instructions-modal', {
16
+ closeModal: () => dispose(),
17
+ order,
18
+ });
19
+ }, [order]);
20
+
21
+ return (
22
+ <OverflowMenuItem
23
+ itemText={t('procedureInstructionsModal', 'Procedure Instructions')}
24
+ onClick={launchProcedureInstructionsModal}
25
+ style={{
26
+ maxWidth: '100vw',
27
+ }}
28
+ />
29
+ );
30
+ };
31
+
32
+ export default ProcedureInstructionsActionMenu;
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ ModalBody,
5
+ ModalFooter,
6
+ ModalHeader,
7
+ Table,
8
+ TableRow,
9
+ TableBody,
10
+ TableCell,
11
+ Tile,
12
+ } from '@carbon/react';
13
+ import { useTranslation } from 'react-i18next';
14
+ import styles from './instructions.scss';
15
+ import { formatDate, parseDate } from '@openmrs/esm-framework';
16
+ import { type Result } from '../../types';
17
+
18
+ interface ProcedureInstructionsModalProps {
19
+ order: Result;
20
+ closeModal: () => void;
21
+ }
22
+
23
+ const ProcedureInstructionsModal: React.FC<ProcedureInstructionsModalProps> = ({ order, closeModal }) => {
24
+ const { t } = useTranslation();
25
+
26
+ const tableData = [
27
+ { key: 'Ordered Procedure', value: order.display },
28
+ { key: 'Order Urgency', value: order.urgency },
29
+ {
30
+ key: 'Schedule date',
31
+ value: order.scheduledDate ? formatDate(parseDate(order.scheduledDate)) : new Date().toLocaleDateString(),
32
+ },
33
+ { key: 'Number of repeats', value: order.numberOfRepeats },
34
+ { key: 'Frequency', value: order.frequency?.display },
35
+ ];
36
+
37
+ return (
38
+ <div>
39
+ <ModalHeader closeModal={closeModal} title={t('procedureInstructions', 'Procedure Order Instructions')} />
40
+ <ModalBody>
41
+ <div className={styles.modalBody}>
42
+ <section className={styles.section}>
43
+ <Table size="lg" useZebraStyles={false} aria-label="sample table">
44
+ <TableBody>
45
+ {tableData.map((row, index) => (
46
+ <TableRow key={index}>
47
+ <TableCell>{row.key}</TableCell>
48
+ <TableCell>{row.value}</TableCell>
49
+ </TableRow>
50
+ ))}
51
+ </TableBody>
52
+ </Table>
53
+ <b />
54
+ <Tile>
55
+ <p>
56
+ <b>Instructions</b>
57
+ </p>
58
+ <p className={styles.instructions}>{order.instructions}</p>
59
+ </Tile>
60
+ <Tile>
61
+ <p>
62
+ <b>Orderer comments</b>
63
+ </p>
64
+ <p className={styles.instructions}>{order.commentToFulfiller}</p>
65
+ </Tile>
66
+ </section>
67
+ </div>
68
+ </ModalBody>
69
+ <ModalFooter>
70
+ <Button kind="secondary" onClick={closeModal}>
71
+ {t('cancel', 'Cancel')}
72
+ </Button>
73
+ </ModalFooter>
74
+ </div>
75
+ );
76
+ };
77
+
78
+ export default ProcedureInstructionsModal;
@@ -0,0 +1,24 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+
4
+ .section {
5
+ margin: spacing.$spacing-03;
6
+ }
7
+
8
+ .sectionTitle {
9
+ margin-bottom: spacing.$spacing-04;
10
+ }
11
+
12
+ .modalBody {
13
+ padding-bottom: spacing.$spacing-05;
14
+ }
15
+ .instructions {
16
+ margin-top: 1rem;
17
+ white-space: pre-wrap;
18
+ }
19
+
20
+ .modalBody {
21
+ :global(.cds--tooltip-trigger__wrapper) {
22
+ visibility: hidden;
23
+ }
24
+ }
@@ -0,0 +1,211 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as vars;
4
+
5
+ title {
6
+ width: 6.938rem;
7
+ height: 1.75rem;
8
+ margin: 0.438rem 22.875rem 0.813rem 0;
9
+ font-family: IBMPlexSans;
10
+ font-size: 1.25rem;
11
+ font-weight: normal;
12
+ font-stretch: normal;
13
+ font-style: normal;
14
+ line-height: 1.4;
15
+ letter-spacing: normal;
16
+ }
17
+
18
+ .link {
19
+ text-decoration: none;
20
+ }
21
+
22
+ .breadcrumbsSlot {
23
+ grid-row: 1 / 2;
24
+ grid-column: 1 / 2;
25
+ }
26
+
27
+ .orderTabsContainer {
28
+ height: 100%;
29
+ width: 100%;
30
+
31
+ :global(.cds--tab-content) {
32
+ padding: 0 !important;
33
+ }
34
+ }
35
+
36
+ .orderTabs {
37
+ grid-column: 'span 2';
38
+ padding: 0 spacing.$spacing-05;
39
+ }
40
+
41
+ .newListButton {
42
+ width: fit-content;
43
+ justify-self: end;
44
+ align-self: center;
45
+ }
46
+
47
+ .tabsContainer {
48
+ background-color: vars.$ui-02;
49
+
50
+ :global(.cds--tabs__nav-item--selected) {
51
+ box-shadow: inset 0 2px 0 0 var(--brand-03) !important;
52
+ }
53
+
54
+ :global(.cds--tab--list) button {
55
+ max-width: 12rem !important;
56
+ }
57
+ }
58
+
59
+ .hiddenTabsContent,
60
+ .tabs .hiddenTabsContent {
61
+ display: none;
62
+ }
63
+
64
+ .patientListTableContainer {
65
+ grid-row: 3 / 4;
66
+ grid-column: 1 / 2;
67
+ height: 100%;
68
+ margin: 0.5rem spacing.$spacing-05;
69
+ background-color: vars.$ui-01;
70
+ border: 0.5px solid #e0e0e0;
71
+
72
+ :global(.cds--data-table-container) {
73
+ padding-top: 0 !important;
74
+ }
75
+
76
+ tbody > tr > :nth-child(2) {
77
+ white-space: nowrap;
78
+ }
79
+
80
+ :global(.cds--data-table td) {
81
+ height: unset !important;
82
+ }
83
+
84
+ :global(.cds--data-table--zebra) tbody tr[data-parent-row]:nth-child(4n + 1) td {
85
+ background-color: vars.$ui-02;
86
+ border-bottom: 1px solid vars.$ui-03;
87
+ border-top: 1px solid vars.$ui-03;
88
+ }
89
+
90
+ :global(.cds--data-table--zebra) tbody tr[data-parent-row]:nth-child(4n + 3) td {
91
+ background-color: vars.$ui-01;
92
+ border-bottom: 1px solid vars.$ui-03;
93
+ }
94
+ }
95
+
96
+ .tableContainer {
97
+ background-color: vars.$ui-01;
98
+ margin: 0 spacing.$spacing-05;
99
+ padding: 0;
100
+
101
+ a {
102
+ text-decoration: none;
103
+ }
104
+
105
+ th {
106
+ color: vars.$text-02;
107
+ }
108
+
109
+ :global(.cds--data-table) {
110
+ background-color: vars.$ui-03;
111
+ }
112
+
113
+ .toolbarContent {
114
+ height: spacing.$spacing-07;
115
+ margin-bottom: spacing.$spacing-02;
116
+ }
117
+ }
118
+
119
+ .activePatientsTable tr:last-of-type {
120
+ td {
121
+ border-bottom: none;
122
+ }
123
+ }
124
+
125
+ .searchContainer {
126
+ display: flex;
127
+ align-items: center;
128
+ flex-direction: row-reverse;
129
+ padding-top: 0.5rem;
130
+
131
+ :global(.cds--search-magnifier-icon) {
132
+ z-index: 0 !important;
133
+ }
134
+
135
+ input {
136
+ background-color: #fff;
137
+ }
138
+ }
139
+
140
+ .addOrderBtn {
141
+ width: 10rem !important;
142
+ padding: 0.5rem !important;
143
+ margin-left: 1rem;
144
+ margin-right: 1rem;
145
+ }
146
+
147
+ .patientSearch {
148
+ width: 25rem;
149
+ border-bottom-color: vars.$ui-03;
150
+ }
151
+
152
+ .locationFilter {
153
+ width: 25rem;
154
+ }
155
+
156
+ .search {
157
+ width: 100%;
158
+ max-width: 16rem;
159
+ background-color: vars.$ui-02;
160
+ border-bottom-color: vars.$ui-03;
161
+ }
162
+
163
+ .container {
164
+ background-color: vars.$ui-01;
165
+ }
166
+
167
+ .expandedLabQueueVisitRow {
168
+ :global(.cds--tab-content) {
169
+ padding: 0.5rem 0;
170
+ }
171
+
172
+ td {
173
+ padding: 0.5rem;
174
+
175
+ > div {
176
+ max-height: max-content !important;
177
+ background-color: vars.$ui-02;
178
+ }
179
+ }
180
+
181
+ th[colspan] td[colspan] > div:first-child {
182
+ padding: 0 1rem;
183
+ }
184
+ }
185
+
186
+ .tileContainer {
187
+ background-color: vars.$ui-02;
188
+ border-top: 1px solid vars.$ui-03;
189
+ padding: 5rem 0;
190
+ }
191
+
192
+ .tile {
193
+ margin: auto;
194
+ width: fit-content;
195
+ }
196
+
197
+ .tileContent {
198
+ display: flex;
199
+ flex-direction: column;
200
+ align-items: center;
201
+ }
202
+
203
+ .content {
204
+ @include type.type-style('heading-compact-02');
205
+ color: vars.$text-02;
206
+ margin-bottom: 0.5rem;
207
+ }
208
+
209
+ .single-line-display {
210
+ white-space: nowrap;
211
+ }
@@ -0,0 +1,104 @@
1
+ import React, { useState } from 'react';
2
+ import { type AssignedExtension, Extension, useConnectedExtensions } from '@openmrs/esm-framework';
3
+ import { Tab, Tabs, TabList, TabPanels, TabPanel } from '@carbon/react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import styles from './procedure-queue.scss';
6
+ import ProcedureOrderedList from './procedures-ordered-list.component';
7
+ import { ComponentContext } from '@openmrs/esm-framework/src/internal';
8
+ import { useProcedureOrderStats } from '../summary-tiles/procedure-summary.resource';
9
+
10
+ const procedurePanelSlot = 'procedures-panels-slot';
11
+
12
+ const ProcedureOrdersTabs: React.FC = () => {
13
+ const { t } = useTranslation();
14
+ const [selectedTab, setSelectedTab] = useState(0);
15
+ const tabExtensions = useConnectedExtensions(procedurePanelSlot) as AssignedExtension[];
16
+
17
+ // Get individual statistics each tab using their fulfillerstatus
18
+ const activeOrdersStats = useProcedureOrderStats('');
19
+ const inProgressStats = useProcedureOrderStats('IN_PROGRESS');
20
+ const referredStats = useProcedureOrderStats('EXCEPTION');
21
+ const notDoneStats = useProcedureOrderStats('DECLINED');
22
+ const completedStats = useProcedureOrderStats('COMPLETED');
23
+
24
+ // Returns appropriate statistics based on their tab names
25
+ const getStatsForTab = (tabName: string) => {
26
+ switch (tabName) {
27
+ case 'procedures-worklist-tab-component':
28
+ return inProgressStats;
29
+ case 'procedures-referred-tab-component':
30
+ return referredStats;
31
+ case 'procedures-not-done-tab-component':
32
+ return notDoneStats;
33
+ case 'procedures-completed-tab-component':
34
+ return completedStats;
35
+ default:
36
+ return { count: 0, isLoading: false, isError: false };
37
+ }
38
+ };
39
+
40
+ return (
41
+ <main className={`omrs-main-content`}>
42
+ <section className={styles.orderTabsContainer}>
43
+ <Tabs
44
+ selectedIndex={selectedTab}
45
+ onChange={({ selectedIndex }) => setSelectedTab(selectedIndex)}
46
+ className={styles.tabs}>
47
+ <TabList style={{ paddingLeft: '1rem' }} aria-label="Procedure tabs" contained>
48
+ <Tab>
49
+ {t('proceduresOrdered', 'Active Orders')} ({activeOrdersStats.isLoading ? '...' : activeOrdersStats.count}
50
+ )
51
+ </Tab>
52
+ {tabExtensions
53
+ .filter((extension) => Object.keys(extension.meta).length > 0)
54
+ .map((extension, index) => {
55
+ const { name, title } = extension.meta;
56
+ if (name && title) {
57
+ const stats = getStatsForTab(extension.name);
58
+ return (
59
+ <Tab key={index} className={styles.tab} id={`${title || index}-tab`}>
60
+ {t(title, {
61
+ ns: extension.moduleName,
62
+ defaultValue: title,
63
+ })}
64
+ ({stats.isLoading ? '...' : stats.count})
65
+ </Tab>
66
+ );
67
+ } else {
68
+ return null;
69
+ }
70
+ })}
71
+ </TabList>
72
+ <TabPanels>
73
+ <TabPanel style={{ padding: 0 }}>
74
+ <ProcedureOrderedList fulfillerStatus="NEW" />
75
+ </TabPanel>
76
+ {tabExtensions
77
+ .filter((extension) => Object.keys(extension.meta).length > 0)
78
+ .map((extension, index) => {
79
+ return (
80
+ <TabPanel key={`${extension.meta.title}-tab-${index}`}>
81
+ <ComponentContext.Provider
82
+ key={extension.id}
83
+ value={{
84
+ featureName: extension.meta.featureName,
85
+ moduleName: extension.moduleName,
86
+ extension: {
87
+ extensionId: extension.id,
88
+ extensionSlotName: procedurePanelSlot,
89
+ extensionSlotModuleName: extension.moduleName,
90
+ },
91
+ }}>
92
+ <Extension />
93
+ </ComponentContext.Provider>
94
+ </TabPanel>
95
+ );
96
+ })}
97
+ </TabPanels>
98
+ </Tabs>
99
+ </section>
100
+ </main>
101
+ );
102
+ };
103
+
104
+ export default ProcedureOrdersTabs;