@openmrs/esm-laboratory-app 1.0.1-pre.96

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 (157) hide show
  1. package/.editorconfig +12 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc +32 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.husky/pre-push +6 -0
  6. package/.prettierignore +14 -0
  7. package/.turbo/turbo-build.log +30 -0
  8. package/.turbo/turbo-lint.log +12 -0
  9. package/.turbo/turbo-typescript.log +0 -0
  10. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  11. package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
  12. package/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -0
  13. package/.yarn/versions/1bd1bb50.yml +0 -0
  14. package/README.md +39 -0
  15. package/__mocks__/react-i18next.js +50 -0
  16. package/assets/logo/logo.png +0 -0
  17. package/assets/logo/moh_logo_without_word.png +0 -0
  18. package/assets/screenshots/labs_enter_results.png +0 -0
  19. package/assets/screenshots/labs_general_dashboard.png +0 -0
  20. package/dist/142.js +1 -0
  21. package/dist/142.js.map +1 -0
  22. package/dist/319.js +1 -0
  23. package/dist/36.js +1 -0
  24. package/dist/36.js.map +1 -0
  25. package/dist/395.js +1 -0
  26. package/dist/395.js.map +1 -0
  27. package/dist/453.js +1 -0
  28. package/dist/453.js.map +1 -0
  29. package/dist/533.js +1 -0
  30. package/dist/533.js.map +1 -0
  31. package/dist/56.js +2 -0
  32. package/dist/56.js.LICENSE.txt +32 -0
  33. package/dist/56.js.map +1 -0
  34. package/dist/572.js +1 -0
  35. package/dist/572.js.map +1 -0
  36. package/dist/574.js +1 -0
  37. package/dist/581.js +1 -0
  38. package/dist/581.js.map +1 -0
  39. package/dist/66.js +1 -0
  40. package/dist/66.js.map +1 -0
  41. package/dist/757.js +1 -0
  42. package/dist/769.js +1 -0
  43. package/dist/769.js.map +1 -0
  44. package/dist/770.js +1 -0
  45. package/dist/770.js.map +1 -0
  46. package/dist/800.js +2 -0
  47. package/dist/800.js.LICENSE.txt +3 -0
  48. package/dist/800.js.map +1 -0
  49. package/dist/809.js +1 -0
  50. package/dist/809.js.map +1 -0
  51. package/dist/889.js +1 -0
  52. package/dist/889.js.map +1 -0
  53. package/dist/894.js +2 -0
  54. package/dist/894.js.LICENSE.txt +48 -0
  55. package/dist/894.js.map +1 -0
  56. package/dist/924.js +1 -0
  57. package/dist/924.js.map +1 -0
  58. package/dist/928.js +1 -0
  59. package/dist/928.js.map +1 -0
  60. package/dist/967b98e46b0984c4.png +0 -0
  61. package/dist/97.js +1 -0
  62. package/dist/97.js.map +1 -0
  63. package/dist/983.js +1 -0
  64. package/dist/983.js.map +1 -0
  65. package/dist/main.js +2 -0
  66. package/dist/main.js.LICENSE.txt +48 -0
  67. package/dist/main.js.map +1 -0
  68. package/dist/openmrs-esm-laboratory-app.js +1 -0
  69. package/dist/openmrs-esm-laboratory-app.js.buildmanifest.json +628 -0
  70. package/dist/openmrs-esm-laboratory-app.js.map +1 -0
  71. package/dist/routes.json +1 -0
  72. package/i18next-parser.config.js +89 -0
  73. package/jest.config.js +16 -0
  74. package/package.json +121 -0
  75. package/src/completed-list/completed-list.component.tsx +234 -0
  76. package/src/completed-list/completed-list.resource.ts +0 -0
  77. package/src/completed-list/completed-list.scss +232 -0
  78. package/src/components/create-dashboard-link.component.tsx +44 -0
  79. package/src/components/overlay/hook.ts +47 -0
  80. package/src/components/overlay/overlay.component.tsx +52 -0
  81. package/src/components/overlay/overlay.scss +93 -0
  82. package/src/config-schema.ts +36 -0
  83. package/src/constants.ts +5 -0
  84. package/src/declarations.d.ts +6 -0
  85. package/src/header/laboratory-header.component.tsx +35 -0
  86. package/src/header/laboratory-header.scss +68 -0
  87. package/src/header/laboratory-illustration.component.tsx +13 -0
  88. package/src/index.ts +92 -0
  89. package/src/laboratory.component.tsx +18 -0
  90. package/src/patient-chart/laboratory-item/view-laboratory-item.component.tsx +39 -0
  91. package/src/patient-chart/laboratory-item/view-laboratory-item.resource.ts +290 -0
  92. package/src/patient-chart/laboratory-item/view-laboratory-item.scss +0 -0
  93. package/src/patient-chart/laboratory-order.component.tsx +453 -0
  94. package/src/patient-chart/laboratory-order.resource.ts +437 -0
  95. package/src/patient-chart/laboratory-order.scss +66 -0
  96. package/src/patient-chart/results-summary/print-results-summary.component.tsx +240 -0
  97. package/src/patient-chart/results-summary/print-results-summary.scss +105 -0
  98. package/src/patient-chart/results-summary/print-results-table.component.tsx +163 -0
  99. package/src/patient-chart/results-summary/results/results.component.tsx +25 -0
  100. package/src/patient-chart/results-summary/results/results.resource.ts +50 -0
  101. package/src/patient-chart/results-summary/results/results.scss +0 -0
  102. package/src/patient-chart/results-summary/results-dialog/edit-results-dialog.component.tsx +46 -0
  103. package/src/patient-chart/results-summary/results-summary.component.tsx +98 -0
  104. package/src/patient-chart/results-summary/results-summary.resource.tsx +185 -0
  105. package/src/patient-chart/results-summary/results-summary.scss +154 -0
  106. package/src/patient-chart/results-summary/send-email-dialog.component.tsx +111 -0
  107. package/src/patient-chart/results-summary/test-children-results.component.tsx +221 -0
  108. package/src/patient-chart/results-summary/test-print-results-table.component.tsx +148 -0
  109. package/src/patient-chart/results-summary/test-results-delete-action-menu.component.tsx +27 -0
  110. package/src/patient-chart/results-summary/test-results-rescend-action-menu.component.tsx +26 -0
  111. package/src/patient-chart/results-summary/test-results-table.component.tsx +153 -0
  112. package/src/patient-chart/results-summary/tests-children-detail.component.tsx +54 -0
  113. package/src/patient-chart/results-summary/views/email.handlebars +13 -0
  114. package/src/queue-list/lab-dialogs/add-to-worklist-dialog.component.tsx +323 -0
  115. package/src/queue-list/lab-dialogs/add-to-worklist-dialog.resource.ts +155 -0
  116. package/src/queue-list/lab-dialogs/add-to-worklist-dialog.scss +20 -0
  117. package/src/queue-list/lab-tests/lab-tests.component.tsx +116 -0
  118. package/src/queue-list/lab-tests/lab-tests.resource.ts +17 -0
  119. package/src/queue-list/lab-tests/lab-tests.scss +12 -0
  120. package/src/queue-list/laboratory-patient-list.component.tsx +268 -0
  121. package/src/queue-list/laboratory-patient-list.resource.ts +86 -0
  122. package/src/queue-list/laboratory-queue.component.tsx +120 -0
  123. package/src/queue-list/laboratory-queue.scss +213 -0
  124. package/src/queue-list/laboratory-tabs.component.tsx +81 -0
  125. package/src/queue-list/pick-lab-request-menu.component.tsx +38 -0
  126. package/src/reject-order/reject-order-dialog.component.tsx +114 -0
  127. package/src/reject-order/reject-order-dialog.resource.ts +14 -0
  128. package/src/reject-order/reject-order-dialog.scss +14 -0
  129. package/src/results/result-form.component.tsx +223 -0
  130. package/src/results/result-form.resource.ts +328 -0
  131. package/src/results/result-form.scss +19 -0
  132. package/src/review-list/dialog/review-item.component.tsx +283 -0
  133. package/src/review-list/dialog/review-item.resource.ts +14 -0
  134. package/src/review-list/dialog/review-item.scss +0 -0
  135. package/src/review-list/review-list.component.tsx +269 -0
  136. package/src/review-list/review-list.resource.ts +0 -0
  137. package/src/review-list/review-list.scss +189 -0
  138. package/src/root.component.tsx +15 -0
  139. package/src/root.scss +50 -0
  140. package/src/routes.json +72 -0
  141. package/src/setup-tests.ts +1 -0
  142. package/src/summary-tiles/laboratory-summary-tiles.component.tsx +53 -0
  143. package/src/summary-tiles/laboratory-summary-tiles.scss +12 -0
  144. package/src/summary-tiles/laboratory-summary.resource.tsx +50 -0
  145. package/src/summary-tiles/summary-tile.component.tsx +48 -0
  146. package/src/summary-tiles/summary-tile.scss +43 -0
  147. package/src/types/index.ts +412 -0
  148. package/src/types/patient-queues.ts +189 -0
  149. package/src/utils/functions.ts +246 -0
  150. package/src/work-list/work-list.component.tsx +302 -0
  151. package/src/work-list/work-list.resource.ts +136 -0
  152. package/src/work-list/work-list.scss +215 -0
  153. package/translations/en.json +16 -0
  154. package/translations/es.json +3 -0
  155. package/translations/fr.json +3 -0
  156. package/tsconfig.json +23 -0
  157. package/webpack.config.js +29 -0
@@ -0,0 +1,269 @@
1
+ import React, { useCallback, useMemo, useState } from "react";
2
+ import { useTranslation } from "react-i18next";
3
+ import { useGetOrdersWorklist } from "../work-list/work-list.resource";
4
+ import {
5
+ ErrorState,
6
+ formatDate,
7
+ parseDate,
8
+ showModal,
9
+ usePagination,
10
+ } from "@openmrs/esm-framework";
11
+ import {
12
+ DataTable,
13
+ DataTableSkeleton,
14
+ Pagination,
15
+ Table,
16
+ TableBody,
17
+ TableCell,
18
+ TableContainer,
19
+ TableHead,
20
+ TableHeader,
21
+ TableRow,
22
+ TableToolbar,
23
+ TableToolbarContent,
24
+ TableToolbarSearch,
25
+ Layer,
26
+ Tile,
27
+ DatePicker,
28
+ DatePickerInput,
29
+ Select,
30
+ SelectItem,
31
+ Button,
32
+ Tag,
33
+ } from "@carbon/react";
34
+
35
+ import styles from "./review-list.scss";
36
+ import { Add } from "@carbon/react/icons";
37
+ import { Ob } from "../patient-chart/laboratory-order.resource";
38
+ import { Encounter } from "../types";
39
+ import { getStatusColor } from "../utils/functions";
40
+
41
+ interface ReviewlistProps {
42
+ fulfillerStatus: string;
43
+ }
44
+ interface ApproveResultMenuProps {
45
+ encounterUuid: string;
46
+ }
47
+
48
+ const ApproveTestMenu: React.FC<ApproveResultMenuProps> = ({
49
+ encounterUuid,
50
+ }) => {
51
+ const { t } = useTranslation();
52
+ const launchReviewItemModal = useCallback(() => {
53
+ const dispose = showModal("review-item-dialog", {
54
+ encounterUuid,
55
+ closeModal: () => dispose(),
56
+ });
57
+ }, [encounterUuid]);
58
+
59
+ return (
60
+ <Button
61
+ kind="ghost"
62
+ onClick={launchReviewItemModal}
63
+ iconDescription={t("approveTest", "Approve Results")}
64
+ renderIcon={(props) => <Add size={16} {...props} />}
65
+ >
66
+ {t("approveTest", "Approve Results")}
67
+ </Button>
68
+ );
69
+ };
70
+
71
+ const ReviewList: React.FC<ReviewlistProps> = ({ fulfillerStatus }) => {
72
+ const { t } = useTranslation();
73
+
74
+ const [activatedOnOrAfterDate, setActivatedOnOrAfterDate] = useState("");
75
+
76
+ const { workListEntries, isLoading } = useGetOrdersWorklist(
77
+ activatedOnOrAfterDate,
78
+ fulfillerStatus
79
+ );
80
+
81
+ const pageSizes = [10, 20, 30, 40, 50];
82
+ const [page, setPage] = useState(1);
83
+ const [currentPageSize, setPageSize] = useState(10);
84
+ const [nextOffSet, setNextOffSet] = useState(0);
85
+
86
+ const {
87
+ goTo,
88
+ results: paginatedWorkListEntries,
89
+ currentPage,
90
+ } = usePagination(workListEntries, currentPageSize);
91
+
92
+ // get picked orders
93
+ let columns = [
94
+ { id: 0, header: t("date", "Date"), key: "date" },
95
+
96
+ { id: 1, header: t("orderNumber", "Order Number"), key: "orderNumber" },
97
+ {
98
+ id: 2,
99
+ header: t("accessionNumber", "Accession Number"),
100
+ key: "accessionNumber",
101
+ },
102
+ { id: 3, header: t("test", "Test"), key: "test" },
103
+ { id: 4, header: t("action", "Action"), key: "action" },
104
+ { id: 5, header: t("status", "Status"), key: "status" },
105
+ { id: 6, header: t("orderer", "Orderer"), key: "orderer" },
106
+ { id: 7, header: t("orderType", "Order Type"), key: "orderType" },
107
+ { id: 8, header: t("urgency", "Urgency"), key: "urgency" },
108
+ ];
109
+
110
+ const tableRows = useMemo(() => {
111
+ return paginatedWorkListEntries?.map((entry, index) => ({
112
+ ...entry,
113
+ id: entry.uuid,
114
+ date: {
115
+ content: (
116
+ <>
117
+ <span>{formatDate(parseDate(entry.dateActivated))}</span>
118
+ </>
119
+ ),
120
+ },
121
+ orderNumber: { content: <span>{entry.orderNumber}</span> },
122
+ accessionNumber: { content: <span>{entry.accessionNumber}</span> },
123
+ test: { content: <span>{entry.concept.display}</span> },
124
+ action: { content: <span>{entry.action}</span> },
125
+ status: {
126
+ content: (
127
+ <>
128
+ <Tag>
129
+ <span
130
+ className={styles.statusContainer}
131
+ style={{ color: `${getStatusColor(entry.fulfillerStatus)}` }}
132
+ >
133
+ <span>{entry.fulfillerStatus}</span>
134
+ </span>
135
+ </Tag>
136
+ </>
137
+ ),
138
+ },
139
+ orderer: { content: <span>{entry.orderer.display}</span> },
140
+ orderType: { content: <span>{entry.orderType.display}</span> },
141
+ urgency: { content: <span>{entry.urgency}</span> },
142
+ }));
143
+ }, [paginatedWorkListEntries]);
144
+
145
+ if (isLoading) {
146
+ return <DataTableSkeleton role="progressbar" />;
147
+ }
148
+ if (paginatedWorkListEntries?.length >= 0) {
149
+ return (
150
+ <div>
151
+ <div className={styles.headerBtnContainer}></div>
152
+ <DataTable rows={tableRows} headers={columns} useZebraStyles>
153
+ {({
154
+ rows,
155
+ headers,
156
+ getHeaderProps,
157
+ getTableProps,
158
+ getRowProps,
159
+ onInputChange,
160
+ }) => (
161
+ <TableContainer className={styles.tableContainer}>
162
+ <TableToolbar
163
+ style={{
164
+ position: "static",
165
+ height: "3rem",
166
+ overflow: "visible",
167
+ backgroundColor: "color",
168
+ }}
169
+ >
170
+ <TableToolbarContent>
171
+ <Layer style={{ margin: "5px" }}>
172
+ <DatePicker dateFormat="Y-m-d" datePickerType="single">
173
+ <DatePickerInput
174
+ labelText={""}
175
+ id="activatedOnOrAfterDate"
176
+ placeholder="YYYY-MM-DD"
177
+ onChange={(event) => {
178
+ setActivatedOnOrAfterDate(event.target.value);
179
+ }}
180
+ type="date"
181
+ value={activatedOnOrAfterDate}
182
+ />
183
+ </DatePicker>
184
+ </Layer>
185
+ <Layer>
186
+ <TableToolbarSearch
187
+ onChange={onInputChange}
188
+ placeholder={t("searchThisList", "Search this list")}
189
+ size="sm"
190
+ />
191
+ </Layer>
192
+ </TableToolbarContent>
193
+ </TableToolbar>
194
+ <Table
195
+ {...getTableProps()}
196
+ className={styles.activePatientsTable}
197
+ >
198
+ <TableHead>
199
+ <TableRow>
200
+ {headers.map((header) => (
201
+ <TableHeader {...getHeaderProps({ header })}>
202
+ {header.header?.content ?? header.header}
203
+ </TableHeader>
204
+ ))}
205
+ </TableRow>
206
+ </TableHead>
207
+ <TableBody>
208
+ {rows.map((row, index) => {
209
+ return (
210
+ <React.Fragment key={row.id}>
211
+ <TableRow {...getRowProps({ row })} key={row.id}>
212
+ {row.cells.map((cell) => (
213
+ <TableCell key={cell.id}>
214
+ {cell.value?.content ?? cell.value}
215
+ </TableCell>
216
+ ))}
217
+ <TableCell className="cds--table-column-menu">
218
+ <ApproveTestMenu
219
+ encounterUuid={
220
+ paginatedWorkListEntries[index].encounter.uuid
221
+ }
222
+ />
223
+ </TableCell>
224
+ </TableRow>
225
+ </React.Fragment>
226
+ );
227
+ })}
228
+ </TableBody>
229
+ </Table>
230
+ {rows.length === 0 ? (
231
+ <div className={styles.tileContainer}>
232
+ <Tile className={styles.tile}>
233
+ <div className={styles.tileContent}>
234
+ <p className={styles.content}>
235
+ {t(
236
+ "noReviewListToDisplay",
237
+ "No review list to display"
238
+ )}
239
+ </p>
240
+ </div>
241
+ </Tile>
242
+ </div>
243
+ ) : null}
244
+ <Pagination
245
+ forwardText="Next page"
246
+ backwardText="Previous page"
247
+ page={currentPage}
248
+ pageSize={currentPageSize}
249
+ pageSizes={pageSizes}
250
+ totalItems={workListEntries?.length}
251
+ className={styles.pagination}
252
+ onChange={({ pageSize, page }) => {
253
+ if (pageSize !== currentPageSize) {
254
+ setPageSize(pageSize);
255
+ }
256
+ if (page !== currentPage) {
257
+ goTo(page);
258
+ }
259
+ }}
260
+ />
261
+ </TableContainer>
262
+ )}
263
+ </DataTable>
264
+ </div>
265
+ );
266
+ }
267
+ };
268
+
269
+ export default ReviewList;
File without changes
@@ -0,0 +1,189 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+ @import "~@openmrs/esm-styleguide/src/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
+
23
+ .orderTabs {
24
+ grid-column: 'span 2';
25
+ padding: 0 spacing.$spacing-05;
26
+ }
27
+
28
+ .newListButton {
29
+ width: fit-content;
30
+ justify-self: end;
31
+ align-self: center;
32
+ }
33
+
34
+ .hiddenTabsContent,
35
+ .tabs .hiddenTabsContent {
36
+ display: none;
37
+ }
38
+
39
+ .patientListTableContainer {
40
+ grid-row: 3 / 4;
41
+ grid-column: 1 / 2;
42
+ height: 100%;
43
+ margin: 0.5rem spacing.$spacing-05;
44
+ background-color: $ui-01;
45
+ border: 0.5px solid #e0e0e0;
46
+
47
+ :global(.cds--data-table-container) {
48
+ padding-top: 0 !important;
49
+ }
50
+
51
+ tbody>tr>:nth-child(2) {
52
+ white-space: nowrap;
53
+ }
54
+
55
+ :global(.cds--data-table td) {
56
+ height: unset !important;
57
+ }
58
+
59
+ :global(.cds--data-table--zebra) tbody tr[data-parent-row]:nth-child(4n + 1) td {
60
+ background-color: $ui-02;
61
+ border-bottom: 1px solid $ui-03;
62
+ border-top: 1px solid $ui-03;
63
+ }
64
+
65
+ :global(.cds--data-table--zebra) tbody tr[data-parent-row]:nth-child(4n + 3) td {
66
+ background-color: $ui-01;
67
+ border-bottom: 1px solid $ui-03;
68
+ }
69
+ }
70
+
71
+ .tableContainer {
72
+ background-color: $ui-01;
73
+ margin: 0 spacing.$spacing-05;
74
+ padding: 0;
75
+
76
+ a {
77
+ text-decoration: none;
78
+ }
79
+
80
+ th {
81
+ color: $text-02;
82
+ }
83
+
84
+ :global(.cds--data-table) {
85
+ background-color: $ui-03;
86
+ }
87
+
88
+ .toolbarContent {
89
+ height: spacing.$spacing-07;
90
+ margin-bottom: spacing.$spacing-02;
91
+ }
92
+ }
93
+
94
+ .activePatientsTable tr:last-of-type {
95
+ td {
96
+ border-bottom: none;
97
+ }
98
+ }
99
+ .headerBtnContainer {
100
+ background-color: $ui-background;
101
+ padding: spacing.$spacing-05;
102
+ text-align: right;
103
+ }
104
+
105
+ .searchContainer {
106
+ display: flex;
107
+ align-items: center;
108
+ flex-direction: row-reverse;
109
+ padding-top: 0.5rem;
110
+
111
+ :global(.cds--search-magnifier-icon) {
112
+ z-index: 0 !important;
113
+ }
114
+
115
+ input {
116
+ background-color: #fff;
117
+ }
118
+ }
119
+
120
+ .addOrderBtn {
121
+ width: 10rem !important;
122
+ padding: 0.5rem !important;
123
+ margin-left: 1rem;
124
+ margin-right: 1rem;
125
+ }
126
+
127
+ .patientSearch {
128
+ width: 25rem;
129
+ border-bottom-color: $ui-03;
130
+ }
131
+
132
+ .locationFilter {
133
+ width: 25rem;
134
+ }
135
+
136
+ .search {
137
+ width: 100%;
138
+ max-width: 16rem;
139
+ background-color: $ui-02;
140
+ border-bottom-color: $ui-03;
141
+ }
142
+
143
+ .container {
144
+ background-color: $ui-01;
145
+ }
146
+
147
+ .tileContainer {
148
+ background-color: $ui-02;
149
+ border-top: 1px solid $ui-03;
150
+ padding: 5rem 0;
151
+ }
152
+
153
+ .tile {
154
+ margin: auto;
155
+ width: fit-content;
156
+ }
157
+
158
+ .tileContent {
159
+ display: flex;
160
+ flex-direction: column;
161
+ align-items: center;
162
+ }
163
+ .content {
164
+ @include type.type-style('heading-compact-02');
165
+ color: $text-02;
166
+ margin-bottom: 0.5rem;
167
+ }
168
+
169
+ .section {
170
+ table {
171
+ font-family: Arial, sans-serif;
172
+ border-collapse: collapse;
173
+ width: 100%;
174
+ }
175
+
176
+ td, th {
177
+ border: 1px solid #000;
178
+ text-align: left;
179
+ font-size: 8px;
180
+ padding: 8px;
181
+ width: 80px;
182
+ }
183
+
184
+ th {
185
+ background-color: #f2f2f2;
186
+ }
187
+
188
+
189
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { BrowserRouter, Route, Routes } from "react-router-dom";
3
+ import Laboratory from "./laboratory.component";
4
+
5
+ const Root: React.FC = () => {
6
+ return (
7
+ <BrowserRouter basename={`${window.spaBase}/home/laboratory`}>
8
+ <Routes>
9
+ <Route path="/" element={<Laboratory />} />
10
+ </Routes>
11
+ </BrowserRouter>
12
+ );
13
+ };
14
+
15
+ export default Root;
package/src/root.scss ADDED
@@ -0,0 +1,50 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+ @import '~@openmrs/esm-styleguide/src/vars';
4
+
5
+ .productiveHeading01 {
6
+ @include type.type-style("heading-01");
7
+ }
8
+
9
+ .productiveHeading02 {
10
+ @include type.type-style("heading-02");
11
+ }
12
+
13
+ .productiveHeading03 {
14
+ @include type.type-style("heading-03");
15
+ }
16
+
17
+ .productiveHeading04 {
18
+ @include type.type-style("heading-04");
19
+ }
20
+
21
+ .bodyLong01 {
22
+ @include type.type-style("body-01");
23
+ }
24
+
25
+ .bodyShort01 {
26
+ @include type.type-style("body-compact-01");
27
+ }
28
+
29
+ .bodyShort02 {
30
+ @include type.type-style("body-compact-02");
31
+ }
32
+
33
+ .text02 {
34
+ color: $text-02;
35
+ }
36
+
37
+ .label01 {
38
+ @include type.type-style("label-01")
39
+ }
40
+
41
+ .modal {
42
+ position: fixed;
43
+ width: 100vw;
44
+ height: 100vh;
45
+ display: grid;
46
+ background-color: rgba(0, 0, 0, 0.5);
47
+ z-index: 9000;
48
+ justify-items: center;
49
+ align-items: center;
50
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "https://json.openmrs.org/routes.schema.json",
3
+ "backendDependencies": {
4
+ "fhir2": "^1.2.0",
5
+ "webservices.rest": "^2.24.0"
6
+ },
7
+ "pages": [
8
+ {
9
+ "component": "root",
10
+ "route": "laboratory"
11
+ }
12
+ ],
13
+ "extensions": [
14
+ {
15
+ "name": "laboratory-dashboard",
16
+ "slot": "laboratory-dashboard-slot",
17
+ "component": "root"
18
+ },
19
+ {
20
+ "name": "laboratory-dashboard-link",
21
+ "slot": "homepage-dashboard-slot",
22
+ "component": "laboratoryDashboardLink",
23
+ "meta": {
24
+ "name": "laboratory",
25
+ "slot": "laboratory-dashboard-slot",
26
+ "title": "Laboratory"
27
+ }
28
+ },
29
+ {
30
+ "name": "laboratory-patient-chart-link",
31
+ "slot": "patient-chart-dashboard-slot",
32
+ "component": "laboratoryOrderDashboardLink",
33
+ "order": 13,
34
+ "meta": {
35
+ "path": "laboratory-orders",
36
+ "slot": "laboratory-orders-dashboard-slot",
37
+ "title": "Laboratory",
38
+ "columns": 1,
39
+ "layoutMode": "anchored"
40
+ }
41
+ },
42
+ {
43
+ "name": "laboratory-orders-summary",
44
+ "slot": "laboratory-orders-dashboard-slot",
45
+ "component": "laboratoryOrderComponent"
46
+ },
47
+ {
48
+ "name": "add-to-worklist-dialog",
49
+ "component": "addToWorklistDialog"
50
+ },
51
+ {
52
+ "name": "results-summary",
53
+ "component": "resultsSummaryWorkSpace"
54
+ },
55
+ {
56
+ "name":"edit-results-dialog",
57
+ "component": "editResultsDialog"
58
+ },
59
+ {
60
+ "name":"send-email-dialog",
61
+ "component": "sendEmailDialog"
62
+ },
63
+ {
64
+ "name" : "review-item-dialog",
65
+ "component": "reviewItemDialog"
66
+ },
67
+ {
68
+ "name" : "reject-order-dialog",
69
+ "component": "rejectOrderDialog"
70
+ }
71
+ ]
72
+ }
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom/extend-expect";
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ import { useTranslation } from "react-i18next";
3
+ import { useLabTestsStats, useMetrics } from "./laboratory-summary.resource";
4
+ import SummaryTile from "./summary-tile.component";
5
+ import styles from "./laboratory-summary-tiles.scss";
6
+ import { useSession } from "@openmrs/esm-framework";
7
+ import { usePatientQueuesList } from "../queue-list/laboratory-patient-list.resource";
8
+
9
+ const LaboratorySummaryTiles: React.FC = () => {
10
+ const { t } = useTranslation();
11
+
12
+ const session = useSession();
13
+
14
+ // get tests ordered
15
+ const { count: testOrderedCount } = useLabTestsStats("");
16
+
17
+ // get worklists
18
+ const { count: worklistCount } = useLabTestsStats("IN_PROGRESS");
19
+
20
+ // get refered lists
21
+
22
+ // get approved
23
+ const { count: completedCount } = useLabTestsStats("COMPLETED");
24
+
25
+ return (
26
+ <>
27
+ <div className={styles.cardContainer}>
28
+ <SummaryTile
29
+ label={t("orders", "Orders")}
30
+ value={testOrderedCount}
31
+ headerLabel={t("testsOrdered", "Tests ordered")}
32
+ />
33
+ <SummaryTile
34
+ label={t("inProgress", "In progress")}
35
+ value={worklistCount}
36
+ headerLabel={t("worklist", "Worklist")}
37
+ />
38
+ <SummaryTile
39
+ label={t("transferred", "Transferred")}
40
+ value={0}
41
+ headerLabel={t("referredTests", "Referred tests")}
42
+ />
43
+ <SummaryTile
44
+ label={t("completed", "Completed")}
45
+ value={completedCount}
46
+ headerLabel={t("results", "Results")}
47
+ />
48
+ </div>
49
+ </>
50
+ );
51
+ };
52
+
53
+ export default LaboratorySummaryTiles;
@@ -0,0 +1,12 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+ @import "~@openmrs/esm-styleguide/src/vars";
4
+
5
+ .cardContainer {
6
+ background-color: $ui-02 ;
7
+ display: flex;
8
+ justify-content: space-between;
9
+ padding: 0 spacing.$spacing-05 spacing.$spacing-10 spacing.$spacing-03;
10
+ flex-flow: row wrap;
11
+ margin-top: - spacing.$spacing-03;
12
+ }