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

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/3d4697b8.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 +242 -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 +277 -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 +277 -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 +310 -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,89 @@
1
+ module.exports = {
2
+ contextSeparator: "_",
3
+ // Key separator used in your translation keys
4
+
5
+ createOldCatalogs: false,
6
+ // Save the \_old files
7
+
8
+ defaultNamespace: "translations",
9
+ // Default namespace used in your i18next config
10
+
11
+ defaultValue: "",
12
+ // Default value to give to empty keys
13
+ // You may also specify a function accepting the locale, namespace, and key as arguments
14
+
15
+ indentation: 2,
16
+ // Indentation of the catalog files
17
+
18
+ keepRemoved: false,
19
+ // Keep keys from the catalog that are no longer in code
20
+
21
+ keySeparator: ".",
22
+ // Key separator used in your translation keys
23
+ // If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
24
+
25
+ // see below for more details
26
+ lexers: {
27
+ hbs: ["HandlebarsLexer"],
28
+ handlebars: ["HandlebarsLexer"],
29
+
30
+ htm: ["HTMLLexer"],
31
+ html: ["HTMLLexer"],
32
+
33
+ mjs: ["JavascriptLexer"],
34
+ js: ["JavascriptLexer"], // if you're writing jsx inside .js files, change this to JsxLexer
35
+ ts: ["JavascriptLexer"],
36
+ jsx: ["JsxLexer"],
37
+ tsx: ["JsxLexer"],
38
+
39
+ default: ["JavascriptLexer"],
40
+ },
41
+
42
+ lineEnding: "auto",
43
+ // Control the line ending. See options at https://github.com/ryanve/eol
44
+
45
+ locales: ["en", "am", "es", "fr", "km", "he"],
46
+ // An array of the locales in your applications
47
+
48
+ namespaceSeparator: ":",
49
+ // Namespace separator used in your translation keys
50
+ // If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
51
+
52
+ output: "$NAMESPACE/$LOCALE.json",
53
+ // Supports $LOCALE and $NAMESPACE injection
54
+ // Supports JSON (.json) and YAML (.yml) file formats
55
+ // Where to write the locale files relative to process.cwd()
56
+
57
+ pluralSeparator: "_",
58
+ // Plural separator used in your translation keys
59
+ // If you want to use plain english keys, separators such as `_` might conflict. You might want to set `pluralSeparator` to a different string that does not occur in your keys.
60
+
61
+ input: undefined,
62
+ // An array of globs that describe where to look for source files
63
+ // relative to the location of the configuration file
64
+
65
+ sort: true,
66
+ // Whether or not to sort the catalog
67
+
68
+ useKeysAsDefaultValue: false,
69
+ // Whether to use the keys as the default value; ex. "Hello": "Hello", "World": "World"
70
+ // This option takes precedence over the `defaultValue` and `skipDefaultValues` options
71
+ // You may also specify a function accepting the locale and namespace as arguments
72
+
73
+ verbose: false,
74
+ // Display info about the parsing including some stats
75
+
76
+ failOnWarnings: false,
77
+ // Exit with an exit code of 1 on warnings
78
+
79
+ customValueTemplate: null,
80
+ // If you wish to customize the value output the value as an object, you can set your own format.
81
+ // ${defaultValue} is the default value you set in your translation function.
82
+ // Any other custom property will be automatically extracted.
83
+ //
84
+ // Example:
85
+ // {
86
+ // message: "${defaultValue}",
87
+ // description: "${maxLength}", // t('my-key', {maxLength: 150})
88
+ // }
89
+ };
package/jest.config.js ADDED
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ transform: {
3
+ "^.+\\.tsx?$": ["@swc/jest"],
4
+ },
5
+ transformIgnorePatterns: ["/node_modules/(?!@openmrs)"],
6
+ moduleNameMapper: {
7
+ "@openmrs/esm-framework": "@openmrs/esm-framework/mock",
8
+ "\\.(s?css)$": "identity-obj-proxy",
9
+ "^lodash-es/(.*)$": "lodash/$1",
10
+ },
11
+ setupFilesAfterEnv: ["<rootDir>/src/setup-tests.ts"],
12
+ testEnvironment: "jsdom",
13
+ testEnvironmentOptions: {
14
+ url: "http://localhost/",
15
+ },
16
+ };
package/package.json ADDED
@@ -0,0 +1,121 @@
1
+ {
2
+ "name": "@openmrs/esm-laboratory-app",
3
+ "version": "1.0.1-pre.106",
4
+ "license": "MPL-2.0",
5
+ "description": "Laboratory microfrontend for OpenMRS 3.x",
6
+ "browser": "dist/openmrs-esm-laboratory-app.js",
7
+ "main": "src/index.ts",
8
+ "source": true,
9
+ "scripts": {
10
+ "start": "openmrs develop",
11
+ "serve": "webpack serve --mode=development",
12
+ "build": "webpack --mode production",
13
+ "analyze": "webpack --mode=production --env analyze=true",
14
+ "lint": "TIMING=1 eslint src --ext js,jsx,ts,tsx",
15
+ "prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
16
+ "typescript": "tsc",
17
+ "test": "jest --config jest.config.js --passWithNoTests",
18
+ "verify": "turbo lint typescript test",
19
+ "extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js",
20
+ "coverage": "yarn test -- --coverage",
21
+ "prepare": "husky install"
22
+ },
23
+ "husky": {
24
+ "hooks": {
25
+ "pre-commit": "pretty-quick --staged && yarn verify"
26
+ }
27
+ },
28
+ "browserslist": [
29
+ "extends browserslist-config-openmrs"
30
+ ],
31
+ "keywords": [
32
+ "openmrs",
33
+ "microfrontends",
34
+ "laboratory"
35
+ ],
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/openmrs/openmrs-esm-laboratory.git"
39
+ },
40
+ "homepage": "https://github.com/openmrs/openmrs-esm-laboratory#readme",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/openmrs/openmrs-esm-laboratory/issues"
46
+ },
47
+ "dependencies": {
48
+ "@carbon/react": "^1.14.0",
49
+ "lodash-es": "^4.17.21",
50
+ "react-to-print": "^2.14.15"
51
+ },
52
+ "peerDependencies": {
53
+ "@openmrs/esm-framework": "*",
54
+ "dayjs": "1.x",
55
+ "react": "18.x",
56
+ "react-i18next": "11.x",
57
+ "react-router-dom": "6.x",
58
+ "rxjs": "6.x"
59
+ },
60
+ "devDependencies": {
61
+ "@ohri/openmrs-esm-ohri-commons-lib": "next",
62
+ "@openmrs/esm-extensions": "next",
63
+ "@openmrs/esm-framework": "next",
64
+ "@openmrs/esm-patient-common-lib": "next",
65
+ "@openmrs/esm-react-utils": "next",
66
+ "@openmrs/esm-styleguide": "next",
67
+ "@swc/cli": "^0.1.62",
68
+ "@swc/core": "^1.3.62",
69
+ "@swc/jest": "^0.2.26",
70
+ "@testing-library/dom": "^8.20.0",
71
+ "@testing-library/jest-dom": "^5.16.5",
72
+ "@testing-library/react": "^13.4.0",
73
+ "@testing-library/user-event": "^14.4.3",
74
+ "@types/jest": "^28.1.8",
75
+ "@types/react": "^18.2.8",
76
+ "@types/react-dom": "^18.2.4",
77
+ "@types/react-router": "^5.1.20",
78
+ "@types/react-router-dom": "^5.3.3",
79
+ "@types/webpack-env": "^1.18.1",
80
+ "@typescript-eslint/parser": "^5.59.9",
81
+ "carbon-components-react": "^8.34.0",
82
+ "concurrently": "^7.6.0",
83
+ "css-loader": "^6.8.1",
84
+ "dayjs": "^1.11.9",
85
+ "eslint": "^8.42.0",
86
+ "eslint-config-prettier": "^8.8.0",
87
+ "eslint-config-ts-react-important-stuff": "^3.0.0",
88
+ "eslint-plugin-prettier": "^4.2.1",
89
+ "file-saver": "^2.0.5",
90
+ "husky": "^8.0.0",
91
+ "identity-obj-proxy": "^3.0.0",
92
+ "jest": "^28.1.3",
93
+ "jest-cli": "^28.1.3",
94
+ "jest-environment-jsdom": "^28.1.3",
95
+ "lerna": "^5.6.1",
96
+ "openmrs": "next",
97
+ "plotly.js": "^2.24.3",
98
+ "prettier": "^2.8.8",
99
+ "pretty-quick": "^3.1.3",
100
+ "raw-loader": "^4.0.2",
101
+ "react": "^18.2.0",
102
+ "react-csv": "^2.2.2",
103
+ "react-dom": "^18.2.0",
104
+ "react-i18next": "^11.18.6",
105
+ "react-pivottable": "^0.11.0",
106
+ "react-plotly.js": "^2.0.0",
107
+ "react-router-dom": "^6.11.2",
108
+ "react-table": "^7.8.0",
109
+ "rxjs": "^6.6.7",
110
+ "swc-loader": "^0.2.3",
111
+ "turbo": "^1.10.12",
112
+ "typescript": "^4.9.5",
113
+ "webpack": "^5.88.1",
114
+ "webpack-cli": "^5.1.3"
115
+ },
116
+ "resolutions": {
117
+ "@carbon/react": "1.14.0"
118
+ },
119
+ "packageManager": "yarn@3.6.3",
120
+ "stableVersion": "1.0.0"
121
+ }
@@ -0,0 +1,242 @@
1
+ import React, { 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
+ usePagination,
9
+ isDesktop,
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
+ Tag,
32
+ Dropdown,
33
+ } from "@carbon/react";
34
+ import styles from "./completed-list.scss";
35
+ import { getStatusColor } from "../utils/functions";
36
+
37
+ interface CompletedlistProps {
38
+ fulfillerStatus: string;
39
+ }
40
+
41
+ const CompletedList: React.FC<CompletedlistProps> = ({ fulfillerStatus }) => {
42
+ const { t } = useTranslation();
43
+
44
+ const [activatedOnOrAfterDate, setActivatedOnOrAfterDate] = useState("");
45
+
46
+ const { workListEntries, isLoading } = useGetOrdersWorklist(
47
+ activatedOnOrAfterDate,
48
+ fulfillerStatus
49
+ );
50
+
51
+ const pageSizes = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50];
52
+ const [page, setPage] = useState(1);
53
+ const [currentPageSize, setPageSize] = useState(5);
54
+ const [nextOffSet, setNextOffSet] = useState(0);
55
+
56
+ const {
57
+ goTo,
58
+ results: paginatedWorkListEntries,
59
+ currentPage,
60
+ } = usePagination(workListEntries, currentPageSize);
61
+
62
+ // get picked orders
63
+ let columns = [
64
+ { id: 0, header: t("date", "Date"), key: "date" },
65
+
66
+ { id: 1, header: t("orderNumber", "Order Number"), key: "orderNumber" },
67
+ { id: 2, header: t("patient", "Patient"), key: "patient" },
68
+
69
+ {
70
+ id: 3,
71
+ header: t("accessionNumber", "Accession Number"),
72
+ key: "accessionNumber",
73
+ },
74
+ { id: 4, header: t("test", "Test"), key: "test" },
75
+ { id: 5, header: t("action", "Action"), key: "action" },
76
+ { id: 6, header: t("status", "Status"), key: "status" },
77
+ { id: 8, header: t("orderer", "Orderer"), key: "orderer" },
78
+ { id: 9, header: t("urgency", "Urgency"), key: "urgency" },
79
+ ];
80
+
81
+ const tableRows = useMemo(() => {
82
+ return paginatedWorkListEntries?.map((entry, index) => ({
83
+ ...entry,
84
+ id: entry.uuid,
85
+ date: {
86
+ content: (
87
+ <>
88
+ <span>{formatDate(parseDate(entry.dateActivated))}</span>
89
+ </>
90
+ ),
91
+ },
92
+ patient: {
93
+ content: (
94
+ <>
95
+ <span>{entry.patient.display.split("-")[1]}</span>
96
+ </>
97
+ ),
98
+ },
99
+ orderNumber: { content: <span>{entry.orderNumber}</span> },
100
+ accessionNumber: { content: <span>{entry.accessionNumber}</span> },
101
+ test: { content: <span>{entry.concept.display}</span> },
102
+ action: { content: <span>{entry.action}</span> },
103
+ status: {
104
+ content: (
105
+ <>
106
+ <Tag>
107
+ <span
108
+ className={styles.statusContainer}
109
+ style={{ color: `${getStatusColor(entry.fulfillerStatus)}` }}
110
+ >
111
+ <span>{entry.fulfillerStatus}</span>
112
+ </span>
113
+ </Tag>
114
+ </>
115
+ ),
116
+ },
117
+ orderer: { content: <span>{entry.orderer.display}</span> },
118
+ orderType: { content: <span>{entry.orderType.display}</span> },
119
+ urgency: { content: <span>{entry.urgency}</span> },
120
+ }));
121
+ }, [paginatedWorkListEntries]);
122
+
123
+ if (isLoading) {
124
+ return <DataTableSkeleton role="progressbar" />;
125
+ }
126
+
127
+ if (paginatedWorkListEntries?.length >= 0) {
128
+ return (
129
+ <div>
130
+ <div className={styles.headerBtnContainer}></div>
131
+ <DataTable rows={tableRows} headers={columns} useZebraStyles>
132
+ {({
133
+ rows,
134
+ headers,
135
+ getHeaderProps,
136
+ getTableProps,
137
+ getRowProps,
138
+ onInputChange,
139
+ }) => (
140
+ <TableContainer className={styles.tableContainer}>
141
+ <TableToolbar
142
+ style={{
143
+ position: "static",
144
+ height: "3rem",
145
+ overflow: "visible",
146
+ backgroundColor: "color",
147
+ }}
148
+ >
149
+ <TableToolbarContent className={styles.toolbar}>
150
+ <Layer style={{ margin: "5px" }}>
151
+ <DatePicker dateFormat="Y-m-d" datePickerType="single">
152
+ <DatePickerInput
153
+ labelText={""}
154
+ id="activatedOnOrAfterDate"
155
+ placeholder="YYYY-MM-DD"
156
+ onChange={(event) => {
157
+ setActivatedOnOrAfterDate(event.target.value);
158
+ }}
159
+ type="date"
160
+ value={activatedOnOrAfterDate}
161
+ />
162
+ </DatePicker>
163
+ </Layer>
164
+ <Layer style={{ margin: "5px" }}>
165
+ <TableToolbarSearch
166
+ onChange={onInputChange}
167
+ placeholder={t("searchThisList", "Search this list")}
168
+ size="sm"
169
+ />
170
+ </Layer>
171
+ </TableToolbarContent>
172
+ </TableToolbar>
173
+ <br />
174
+ <Table
175
+ {...getTableProps()}
176
+ className={styles.activePatientsTable}
177
+ >
178
+ <TableHead>
179
+ <TableRow>
180
+ {headers.map((header) => (
181
+ <TableHeader {...getHeaderProps({ header })}>
182
+ {header.header?.content ?? header.header}
183
+ </TableHeader>
184
+ ))}
185
+ </TableRow>
186
+ </TableHead>
187
+ <TableBody>
188
+ {rows.map((row, index) => {
189
+ return (
190
+ <React.Fragment key={row.id}>
191
+ <TableRow {...getRowProps({ row })} key={row.id}>
192
+ {row.cells.map((cell) => (
193
+ <TableCell key={cell.id}>
194
+ {cell.value?.content ?? cell.value}
195
+ </TableCell>
196
+ ))}
197
+ </TableRow>
198
+ </React.Fragment>
199
+ );
200
+ })}
201
+ </TableBody>
202
+ </Table>
203
+ {rows.length === 0 ? (
204
+ <div className={styles.tileContainer}>
205
+ <Tile className={styles.tile}>
206
+ <div className={styles.tileContent}>
207
+ <p className={styles.content}>
208
+ {t(
209
+ "noCompletedListToDisplay",
210
+ "No Completed List to display"
211
+ )}
212
+ </p>
213
+ </div>
214
+ </Tile>
215
+ </div>
216
+ ) : null}
217
+ <Pagination
218
+ forwardText="Next page"
219
+ backwardText="Previous page"
220
+ page={currentPage}
221
+ pageSize={currentPageSize}
222
+ pageSizes={pageSizes}
223
+ totalItems={workListEntries?.length}
224
+ className={styles.pagination}
225
+ onChange={({ pageSize, page }) => {
226
+ if (pageSize !== currentPageSize) {
227
+ setPageSize(pageSize);
228
+ }
229
+ if (page !== currentPage) {
230
+ goTo(page);
231
+ }
232
+ }}
233
+ />
234
+ </TableContainer>
235
+ )}
236
+ </DataTable>
237
+ </div>
238
+ );
239
+ }
240
+ };
241
+
242
+ export default CompletedList;
File without changes
@@ -0,0 +1,232 @@
1
+ @use '@carbon/styles/scss/spacing';
2
+ @use '@carbon/styles/scss/type';
3
+ @import "~@openmrs/esm-styleguide/src/vars";
4
+ @import '../root.scss';
5
+
6
+ title {
7
+ width: 6.938rem;
8
+ height: 1.75rem;
9
+ margin: 0.438rem 22.875rem 0.813rem 0;
10
+ font-family: IBMPlexSans;
11
+ font-size: 1.25rem;
12
+ font-weight: normal;
13
+ font-stretch: normal;
14
+ font-style: normal;
15
+ line-height: 1.4;
16
+ letter-spacing: normal;
17
+ }
18
+
19
+ .link {
20
+ text-decoration: none;
21
+ }
22
+
23
+ .breadcrumbsSlot {
24
+ grid-row: 1 / 2;
25
+ grid-column: 1 / 2;
26
+ }
27
+
28
+ .orderTabsContainer {
29
+ height: 100%;
30
+ width: 100%;
31
+
32
+ :global(.cds--tab-content) {
33
+ padding: 0 !important;
34
+ }
35
+ }
36
+
37
+ .orderTabs {
38
+ grid-column: 'span 2';
39
+ padding: 0 spacing.$spacing-05;
40
+ }
41
+
42
+ .newListButton {
43
+ width: fit-content;
44
+ justify-self: end;
45
+ align-self: center;
46
+ }
47
+
48
+ .tabsContainer {
49
+ background-color: $ui-02;
50
+
51
+ :global(.cds--tabs__nav-item--selected) {
52
+ box-shadow: inset 0 2px 0 0 var(--brand-03) !important;
53
+ }
54
+
55
+ :global(.cds--tab--list) button {
56
+ max-width: 12rem !important;
57
+ }
58
+ }
59
+
60
+ .hiddenTabsContent,
61
+ .tabs .hiddenTabsContent {
62
+ display: none;
63
+ }
64
+
65
+ .patientListTableContainer {
66
+ grid-row: 3 / 4;
67
+ grid-column: 1 / 2;
68
+ height: 100%;
69
+ margin: 0.5rem spacing.$spacing-05;
70
+ background-color: $ui-01;
71
+ border: 0.5px solid #e0e0e0;
72
+
73
+ :global(.cds--data-table-container) {
74
+ padding-top: 0 !important;
75
+ }
76
+
77
+ tbody>tr>:nth-child(2) {
78
+ white-space: nowrap;
79
+ }
80
+
81
+ :global(.cds--data-table td) {
82
+ height: unset !important;
83
+ }
84
+
85
+ :global(.cds--data-table--zebra) tbody tr[data-parent-row]:nth-child(4n + 1) td {
86
+ background-color: $ui-02;
87
+ border-bottom: 1px solid $ui-03;
88
+ border-top: 1px solid $ui-03;
89
+ }
90
+
91
+ :global(.cds--data-table--zebra) tbody tr[data-parent-row]:nth-child(4n + 3) td {
92
+ background-color: $ui-01;
93
+ border-bottom: 1px solid $ui-03;
94
+ }
95
+ }
96
+
97
+ .tableContainer {
98
+ background-color: $ui-01;
99
+ margin: 0 spacing.$spacing-05;
100
+ padding: 0;
101
+
102
+ a {
103
+ text-decoration: none;
104
+ }
105
+
106
+ th {
107
+ color: $text-02;
108
+ }
109
+
110
+ :global(.cds--data-table) {
111
+ background-color: $ui-03;
112
+ }
113
+
114
+ .toolbarContent {
115
+ height: spacing.$spacing-07;
116
+ margin-bottom: spacing.$spacing-02;
117
+ }
118
+ }
119
+
120
+ .activePatientsTable tr:last-of-type {
121
+ td {
122
+ border-bottom: none;
123
+ }
124
+ }
125
+
126
+ .headerBtnContainer {
127
+ background-color: $ui-background;
128
+ padding: spacing.$spacing-05;
129
+ text-align: right;
130
+ }
131
+
132
+ .searchContainer {
133
+ display: flex;
134
+ align-items: center;
135
+ flex-direction: row-reverse;
136
+ padding-top: 0.5rem;
137
+
138
+ :global(.cds--search-magnifier-icon) {
139
+ z-index: 0 !important;
140
+ }
141
+
142
+ input {
143
+ background-color: #fff;
144
+ }
145
+ }
146
+
147
+ .addOrderBtn {
148
+ width: 10rem !important;
149
+ padding: 0.5rem !important;
150
+ margin-left: 1rem;
151
+ margin-right: 1rem;
152
+ }
153
+
154
+ .patientSearch {
155
+ width: 25rem;
156
+ border-bottom-color: $ui-03;
157
+ }
158
+
159
+ .locationFilter {
160
+ width: 25rem;
161
+ }
162
+
163
+ .search {
164
+ width: 100%;
165
+ max-width: 16rem;
166
+ background-color: $ui-02;
167
+ border-bottom-color: $ui-03;
168
+ }
169
+
170
+ .container {
171
+ background-color: $ui-01;
172
+ }
173
+
174
+ .expandedLabQueueVisitRow {
175
+ :global(.cds--tab-content) {
176
+ padding: 0.5rem 0;
177
+ }
178
+
179
+ td {
180
+ padding: 0.5rem;
181
+
182
+ >div {
183
+ max-height: max-content !important;
184
+ background-color: $ui-02;
185
+ }
186
+ }
187
+
188
+ th[colspan] td[colspan]>div:first-child {
189
+ padding: 0 1rem;
190
+ }
191
+ }
192
+
193
+ .tableLayerSearch {
194
+ margin: 5px;
195
+ padding: 10px;
196
+
197
+ }
198
+
199
+ .dropDownContainer {
200
+ padding: 10px;
201
+ }
202
+
203
+ .toolbar {
204
+ display: flex;
205
+ align-items: center;
206
+ padding: 5px;
207
+ margin: 10px;
208
+ }
209
+
210
+
211
+ .tileContainer {
212
+ background-color: $ui-02;
213
+ border-top: 1px solid $ui-03;
214
+ padding: 5rem 0;
215
+ }
216
+
217
+ .tile {
218
+ margin: auto;
219
+ width: fit-content;
220
+ }
221
+
222
+ .tileContent {
223
+ display: flex;
224
+ flex-direction: column;
225
+ align-items: center;
226
+ }
227
+
228
+ .content {
229
+ @include type.type-style('heading-compact-02');
230
+ color: $text-02;
231
+ margin-bottom: 0.5rem;
232
+ }