@pih/esm-referrals-queue-app 2.0.0-pre.9 → 2.1.1-pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +39 -0
- package/dist/023bd53d342b7463.woff +0 -0
- package/dist/02acc4469a2fe2e4.woff2 +0 -0
- package/dist/033e03f8663ab9b1.woff +0 -0
- package/dist/052607e67da262ec.woff +0 -0
- package/dist/081587ca0db8e63f.woff2 +0 -0
- package/dist/08cf53c4e5e71cf1.woff2 +0 -0
- package/dist/090b2bc014d24ea4.woff2 +0 -0
- package/dist/0a28cd0b47497b71.woff +0 -0
- package/dist/0a9765a89ff0437d.woff +0 -0
- package/dist/0ae92bcea615e948.woff2 +0 -0
- package/dist/0be8520d8945b3b7.woff2 +0 -0
- package/dist/0bf6b66a8b86b014.woff +0 -0
- package/dist/0e7dd073cd8bb0ad.woff2 +0 -0
- package/dist/144.js +2 -0
- package/dist/144.js.LICENSE.txt +19 -0
- package/dist/144.js.map +1 -0
- package/dist/14869ac5d1830304.woff2 +0 -0
- package/dist/14aaceff85fc8b28.woff2 +0 -0
- package/dist/1590052e1cf8f28d.woff +0 -0
- package/dist/16f443eed01776ca.woff2 +0 -0
- package/dist/173.js +1 -0
- package/dist/173.js.map +1 -0
- package/dist/183bae0e53a22182.woff2 +0 -0
- package/dist/19b239a0bb74b27e.woff +0 -0
- package/dist/19c8f94ccd6289f5.woff2 +0 -0
- package/dist/1ae86565eab7451c.woff2 +0 -0
- package/dist/1c7bf8797e0a9be6.woff2 +0 -0
- package/dist/1d9aff9a93a3bb66.woff +0 -0
- package/dist/1f266d3619b30f16.woff2 +0 -0
- package/dist/1f8c5a4087a524fd.woff2 +0 -0
- package/dist/20ba2b23c5c0cd0b.woff2 +0 -0
- package/dist/2269d45733c5cf8f.woff +0 -0
- package/dist/258ecbd235953099.woff +0 -0
- package/dist/295dd01a1fbfee6d.woff2 +0 -0
- package/dist/2d7f835ab7c7c764.woff +0 -0
- package/dist/2f66cca99eeead63.woff +0 -0
- package/dist/2f686985e26e7107.woff2 +0 -0
- package/dist/300.js +1 -0
- package/dist/315eff729e4ccbd9.woff2 +0 -0
- package/dist/32f1e5aadf845e08.woff +0 -0
- package/dist/338484e1c850669c.woff +0 -0
- package/dist/33b7a82f1e295190.woff +0 -0
- package/dist/3674d98ec4a9173d.woff +0 -0
- package/dist/368d16e3259bf207.woff2 +0 -0
- package/dist/36c49aa341a7079a.woff2 +0 -0
- package/dist/36e1e0430475edee.woff2 +0 -0
- package/dist/3bc19662b8630ee9.woff2 +0 -0
- package/dist/3f645f473b3f8fba.woff2 +0 -0
- package/dist/4095df88acae9e98.woff +0 -0
- package/dist/41.js +2 -0
- package/dist/41.js.map +1 -0
- package/dist/4218ac9901b9d36d.woff2 +0 -0
- package/dist/4680ba68412e4da9.woff2 +0 -0
- package/dist/47d7a8698d562a0e.woff +0 -0
- package/dist/47ec6c9dffe776a0.woff +0 -0
- package/dist/48e37bd7ebf85a1f.woff2 +0 -0
- package/dist/48edfdf51dfb3160.woff +0 -0
- package/dist/4a35a2746c8ad7a5.woff +0 -0
- package/dist/4e11b8a7c445255f.woff2 +0 -0
- package/dist/4ea1f5c3baf89fe3.woff +0 -0
- package/dist/4ea99f41c896bf9d.woff +0 -0
- package/dist/5005db1d1caf70c7.woff +0 -0
- package/dist/528a8e7c1c141a31.woff +0 -0
- package/dist/52ca12f5b516d4ea.woff +0 -0
- package/dist/534.js +2 -0
- package/dist/534.js.LICENSE.txt +30 -0
- package/dist/534.js.map +1 -0
- package/dist/537ddd61c5c1fce2.woff2 +0 -0
- package/dist/5432f7541ec25c34.woff +0 -0
- package/dist/54a95d73a9454ba3.woff +0 -0
- package/dist/55.js +1 -0
- package/dist/56c4118c0907f151.woff2 +0 -0
- package/dist/5938bc2ae7ec60c0.woff2 +0 -0
- package/dist/594306657c4e44e8.woff +0 -0
- package/dist/5a538aa477a66067.woff +0 -0
- package/dist/5c6586155f0d278a.woff2 +0 -0
- package/dist/60.js +1 -0
- package/dist/60.js.map +1 -0
- package/dist/60ec587649ba812a.woff2 +0 -0
- package/dist/616567cd947eb9dd.woff +0 -0
- package/dist/65168b59f44caab4.woff +0 -0
- package/dist/65c0982f98374864.woff +0 -0
- package/dist/65e6511e035870e1.woff2 +0 -0
- package/dist/661425f6798cd16a.woff2 +0 -0
- package/dist/66b864fe213caf46.woff2 +0 -0
- package/dist/6775fee945132ef9.woff +0 -0
- package/dist/68bbd362c8e4983b.woff +0 -0
- package/dist/68d6deec87b6b604.woff +0 -0
- package/dist/69a7e6d31d390296.woff +0 -0
- package/dist/69d087d970ee9455.woff2 +0 -0
- package/dist/69fa3fc7363bbc04.woff +0 -0
- package/dist/6a1f0178b45b2e9e.woff +0 -0
- package/dist/6c6c45e66ff54281.woff2 +0 -0
- package/dist/6ffb9ed97b21fdc0.woff +0 -0
- package/dist/7073a7323e92bd11.woff2 +0 -0
- package/dist/718c6cc31274ab1a.woff2 +0 -0
- package/dist/726.js +1 -0
- package/dist/726.js.map +1 -0
- package/dist/72cdbedfe04be9f9.woff2 +0 -0
- package/dist/746.js +2 -0
- package/dist/{147.js.LICENSE.txt → 746.js.LICENSE.txt} +9 -16
- package/dist/746.js.map +1 -0
- package/dist/7509c9f56fe9e532.woff2 +0 -0
- package/dist/75dc5c5b04adc8bf.woff2 +0 -0
- package/dist/76a7c256fc8b3490.woff +0 -0
- package/dist/77b48bc05299ecca.woff2 +0 -0
- package/dist/787f56efa306ddbc.woff +0 -0
- package/dist/7a0a0215c248c73d.woff2 +0 -0
- package/dist/7c4463d9c84f263a.woff +0 -0
- package/dist/7d112a556b7670d2.woff +0 -0
- package/dist/7d52d6014b5f2bbc.woff +0 -0
- package/dist/7f00bebb24e40167.woff2 +0 -0
- package/dist/7f2c6ea3e740417e.woff +0 -0
- package/dist/802c6176541eeed7.woff2 +0 -0
- package/dist/8080081b3379c637.woff2 +0 -0
- package/dist/8274cc1afc7619f1.woff +0 -0
- package/dist/831.js +2 -0
- package/dist/831.js.LICENSE.txt +3 -0
- package/dist/831.js.map +1 -0
- package/dist/8605507b7a8487c4.woff2 +0 -0
- package/dist/8a83d654702f6534.woff2 +0 -0
- package/dist/8ccee65f6cf254ee.woff +0 -0
- package/dist/8d82a082a4aba439.woff +0 -0
- package/dist/8de04ae985937b56.woff +0 -0
- package/dist/8fe71173a13fe571.woff2 +0 -0
- package/dist/90edccb224a51cee.woff +0 -0
- package/dist/94b292fe87831a8b.woff +0 -0
- package/dist/95dc66c1b88745f8.woff +0 -0
- package/dist/95fb698be77c85ef.woff +0 -0
- package/dist/9624cec0f9bdd81e.woff2 +0 -0
- package/dist/9662331fa31e3f20.woff +0 -0
- package/dist/98a3af55a1698171.woff2 +0 -0
- package/dist/99.js +1 -0
- package/dist/9ba85996af74c5ce.woff2 +0 -0
- package/dist/9bc133b1df25cb74.woff +0 -0
- package/dist/9ddb22faa35006e7.woff2 +0 -0
- package/dist/9e97352380611b95.woff +0 -0
- package/dist/a167fb2799dd741b.woff2 +0 -0
- package/dist/a2045a5cc4fdf94f.woff2 +0 -0
- package/dist/a246c73905a31c93.woff2 +0 -0
- package/dist/a401aa7939cb6e6f.woff2 +0 -0
- package/dist/a41a71258c38684d.woff +0 -0
- package/dist/a60d94a72d615a8e.woff +0 -0
- package/dist/a66764dd0c1fa213.woff +0 -0
- package/dist/a6ed036f17a1ea29.woff2 +0 -0
- package/dist/a8f635129d660202.woff +0 -0
- package/dist/a9f25ca430709a1a.woff2 +0 -0
- package/dist/ae14d98ad8a1212c.woff +0 -0
- package/dist/aeec4f78084adf7f.woff +0 -0
- package/dist/af11e94b0644eba5.woff +0 -0
- package/dist/afa9121a49e95351.woff2 +0 -0
- package/dist/afcda12d9f805543.woff2 +0 -0
- package/dist/b09ded85a7da77f1.woff2 +0 -0
- package/dist/b2f4e9d1e821b71c.woff2 +0 -0
- package/dist/b30b06698dc369b2.woff +0 -0
- package/dist/b4a074bf828bb757.woff2 +0 -0
- package/dist/b7f447da43f6e596.woff2 +0 -0
- package/dist/b7f633b871b84820.woff +0 -0
- package/dist/bcca84a524572d10.woff2 +0 -0
- package/dist/be4d1f97b11d087c.woff2 +0 -0
- package/dist/be91def2232f6776.woff +0 -0
- package/dist/bec14780d81164de.woff2 +0 -0
- package/dist/c285f4b15d11f172.woff +0 -0
- package/dist/c4673617b80801f3.woff +0 -0
- package/dist/c553f7e0199c5084.woff2 +0 -0
- package/dist/c8470ed2c145ace7.woff +0 -0
- package/dist/c9d9ce9f465df4fe.woff2 +0 -0
- package/dist/ccb2870475da9fe8.woff +0 -0
- package/dist/d04134fa33c2606d.woff +0 -0
- package/dist/d11f9c5cd7d9ea16.woff +0 -0
- package/dist/d188f7f036ac5779.woff2 +0 -0
- package/dist/d265d81c58525ae4.woff2 +0 -0
- package/dist/d5942cd81663e136.woff2 +0 -0
- package/dist/d6097a5c452acf6d.woff +0 -0
- package/dist/d66b8ff73d95cabb.woff2 +0 -0
- package/dist/d77f5bf95de8edaa.woff +0 -0
- package/dist/d8829a685af4f372.woff +0 -0
- package/dist/d88899ef0fd16719.woff2 +0 -0
- package/dist/d9a5d958e69e058d.woff2 +0 -0
- package/dist/da65d9a514c628c8.woff +0 -0
- package/dist/dac90d495be353a0.woff2 +0 -0
- package/dist/dd7071bc6306585c.woff +0 -0
- package/dist/dd8ce598529c3fab.woff2 +0 -0
- package/dist/ddef6f2dd566c2b9.woff +0 -0
- package/dist/de013f1be25103fa.woff2 +0 -0
- package/dist/dee2ff599db31e5b.woff +0 -0
- package/dist/dee7c6b5dd954d9b.woff +0 -0
- package/dist/df222fceeffca849.woff2 +0 -0
- package/dist/e0d2e5b12f028b5d.woff +0 -0
- package/dist/e33e3db8e4f7559f.woff +0 -0
- package/dist/e62b00b9199c1ac9.woff2 +0 -0
- package/dist/e696cef1407b2610.woff2 +0 -0
- package/dist/e89ca83b24959664.woff +0 -0
- package/dist/eb8c0ae77ad55249.woff +0 -0
- package/dist/ed0997bd7d221b8e.woff +0 -0
- package/dist/eed48feba743e21c.woff2 +0 -0
- package/dist/f280bda8a6e535a6.woff +0 -0
- package/dist/f543c88feb236d11.woff2 +0 -0
- package/dist/f591b0079faa93fe.woff2 +0 -0
- package/dist/f6ed27923769ad1d.woff2 +0 -0
- package/dist/f8803bebe640d99a.woff +0 -0
- package/dist/fbebeb4336e67012.woff2 +0 -0
- package/dist/fd522cd7a5c646fe.woff +0 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -0
- package/dist/pih-esm-referrals-queue-app.js +1 -1
- package/dist/pih-esm-referrals-queue-app.js.buildmanifest.json +364 -73
- package/dist/pih-esm-referrals-queue-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +3 -0
- package/package.json +23 -42
- package/src/config-schema.ts +8 -16
- package/src/declarations.d.tsx +4 -4
- package/src/index.ts +11 -65
- package/src/referrals-queue/referrals-queue.component.tsx +71 -120
- package/src/referrals-queue/referrals-queue.resource.tsx +6 -9
- package/src/referrals-queue/referrals-queue.scss +26 -0
- package/src/referrals-queue/referrals-queue.test.tsx +127 -115
- package/src/root.component.test.tsx +3 -3
- package/src/root.component.tsx +6 -6
- package/src/routes.json +9 -0
- package/src/setup-tests.ts +8 -8
- package/src/table/referrals-table.component.tsx +83 -0
- package/src/util.ts +5 -9
- package/translations/en.json +13 -2
- package/translations/es.json +15 -0
- package/translations/fr.json +15 -0
- package/tsconfig.json +4 -22
- package/.editorconfig +0 -12
- package/.eslintignore +0 -2
- package/.eslintrc +0 -4
- package/.github/workflows/node.js.yml +0 -79
- package/.husky/pre-commit +0 -6
- package/.husky/pre-push +0 -6
- package/.prettierignore +0 -14
- package/LICENSE +0 -401
- package/dist/132.js +0 -1
- package/dist/147.js +0 -2
- package/dist/281.js +0 -1
- package/dist/294.js +0 -2
- package/dist/574.js +0 -1
- package/dist/595.js +0 -2
- package/dist/595.js.LICENSE.txt +0 -1
- package/dist/879.js +0 -2
- package/dist/879.js.LICENSE.txt +0 -21
- package/dist/90.js +0 -1
- package/dist/pih-esm-referrals-queue-app.old +0 -1
- package/jest.config.json +0 -19
- package/src/referrals-queue/react-dates-overrides.css +0 -39
- package/src/referrals-queue/referrals-queue.css +0 -63
- package/src/table/table.component.tsx +0 -95
- package/src/table/table.css +0 -16
- /package/dist/{294.js.LICENSE.txt → 41.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pih/esm-referrals-queue-app",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"license": "MPL-2.0",
|
|
3
|
+
"version": "2.1.1-pre.2",
|
|
5
4
|
"description": "A page for viewing the J9 Home Visits from CommCare",
|
|
6
5
|
"browser": "dist/pih-esm-referrals-queue-app.js",
|
|
7
6
|
"main": "src/index.ts",
|
|
8
7
|
"source": true,
|
|
8
|
+
"license": "MPL-2.0",
|
|
9
|
+
"homepage": "https://github.com/PIH/openmrs-esm-pihemr#readme",
|
|
9
10
|
"scripts": {
|
|
10
11
|
"start": "openmrs develop",
|
|
11
12
|
"serve": "webpack serve --mode=development",
|
|
@@ -14,50 +15,40 @@
|
|
|
14
15
|
"lint": "eslint src --ext js,jsx,ts,tsx",
|
|
15
16
|
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
16
17
|
"typescript": "tsc",
|
|
17
|
-
"
|
|
18
|
-
"verify": "concurrently 'yarn:lint' 'yarn:test' 'yarn:typescript'",
|
|
18
|
+
"verify": "turbo lint typescript test --color --concurrency=2",
|
|
19
19
|
"coverage": "yarn test -- --coverage",
|
|
20
20
|
"prepare": "husky install"
|
|
21
21
|
},
|
|
22
|
-
"husky": {
|
|
23
|
-
"hooks": {
|
|
24
|
-
"pre-commit": "pretty-quick --staged && yarn verify"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
22
|
"browserslist": [
|
|
28
23
|
"extends browserslist-config-openmrs"
|
|
29
24
|
],
|
|
30
25
|
"keywords": [
|
|
31
|
-
"openmrs"
|
|
32
|
-
"microfrontends"
|
|
26
|
+
"openmrs"
|
|
33
27
|
],
|
|
34
|
-
"repository": {
|
|
35
|
-
"type": "git",
|
|
36
|
-
"url": "git+https://github.com/pih/pih-esm-referrals-queue.git"
|
|
37
|
-
},
|
|
38
|
-
"homepage": "https://github.com/pih/pih-esm-referrals-queue#readme",
|
|
39
28
|
"publishConfig": {
|
|
40
29
|
"access": "public"
|
|
41
30
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/PIH/openmrs-esm-pihemr.git"
|
|
44
34
|
},
|
|
45
|
-
"
|
|
46
|
-
"
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/PIH/openmrs-esm-pihemr/issues"
|
|
47
37
|
},
|
|
48
38
|
"peerDependencies": {
|
|
49
39
|
"@carbon/react": "^1.9.0",
|
|
50
|
-
"@openmrs/esm-framework": "
|
|
40
|
+
"@openmrs/esm-framework": "^5.4.0",
|
|
51
41
|
"dayjs": "1.x",
|
|
42
|
+
"i18next": "^21.10.0",
|
|
52
43
|
"react": "18.x",
|
|
44
|
+
"react-dom": "18.x",
|
|
53
45
|
"react-i18next": "11.x",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
46
|
+
"rxjs": "6.x",
|
|
47
|
+
"single-spa": "^6.x",
|
|
48
|
+
"swr": "^2.2.2"
|
|
56
49
|
},
|
|
57
50
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@carbon/icons-react": "^10.18.0",
|
|
60
|
-
"@openmrs/esm-framework": "next",
|
|
51
|
+
"@openmrs/esm-framework": "^5.4.0",
|
|
61
52
|
"@swc/core": "^1.2.203",
|
|
62
53
|
"@swc/jest": "^0.2.21",
|
|
63
54
|
"@testing-library/dom": "^7.20.0",
|
|
@@ -71,30 +62,20 @@
|
|
|
71
62
|
"@types/react-router": "^5.1.14",
|
|
72
63
|
"@types/react-router-dom": "^5.1.7",
|
|
73
64
|
"@types/webpack-env": "^1.16.0",
|
|
74
|
-
"@typescript-eslint/parser": "^5.28.0",
|
|
75
|
-
"concurrently": "^6.2.0",
|
|
76
65
|
"css-loader": "^6.7.1",
|
|
77
|
-
"eslint": "^7.27.0",
|
|
78
|
-
"eslint-config-prettier": "^8.3.0",
|
|
79
|
-
"eslint-config-ts-react-important-stuff": "^3.0.0",
|
|
80
|
-
"eslint-plugin-prettier": "^3.4.0",
|
|
81
|
-
"husky": "^6.0.0",
|
|
82
66
|
"identity-obj-proxy": "^3.0.0",
|
|
83
67
|
"jest": "^27.0.4",
|
|
84
68
|
"jest-cli": "^27.0.4",
|
|
85
69
|
"mockdate": "^3.0.5",
|
|
86
|
-
"openmrs": "next",
|
|
87
|
-
"prettier": "^2.3.0",
|
|
88
|
-
"pretty-quick": "^3.1.0",
|
|
89
70
|
"react": "^18.2.0",
|
|
90
71
|
"react-dates": "^21.8.0",
|
|
91
72
|
"react-dom": "^18.2.0",
|
|
92
73
|
"react-i18next": "^11.7.0",
|
|
93
74
|
"react-router-dom": "^6.3.0",
|
|
94
|
-
"rxjs": "^6.
|
|
95
|
-
"
|
|
75
|
+
"rxjs": "^6.6.7",
|
|
76
|
+
"swc-loader": "^0.2.6",
|
|
77
|
+
"webpack": "^5.90.3",
|
|
78
|
+
"webpack-cli": "^4.10.0"
|
|
96
79
|
},
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
}
|
|
80
|
+
"stableVersion": "2.1.0"
|
|
81
|
+
}
|
package/src/config-schema.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type, validators } from
|
|
1
|
+
import { Type, validators } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This is the config schema. It expects a configuration object which
|
|
@@ -25,33 +25,25 @@ export const configSchema = {
|
|
|
25
25
|
patientDash: {
|
|
26
26
|
_type: Type.String,
|
|
27
27
|
_default:
|
|
28
|
-
|
|
29
|
-
_validators: [validators.isUrlWithTemplateParameters([
|
|
28
|
+
'${openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&app=pih.app.clinicianDashboard',
|
|
29
|
+
_validators: [validators.isUrlWithTemplateParameters(['patientUuid'])],
|
|
30
30
|
},
|
|
31
31
|
visitPage: {
|
|
32
32
|
_type: Type.String,
|
|
33
33
|
_default:
|
|
34
|
-
|
|
35
|
-
_validators: [
|
|
36
|
-
validators.isUrlWithTemplateParameters(["patientUuid", "visitUuid"]),
|
|
37
|
-
],
|
|
34
|
+
'${openmrsBase}/pihcore/visit/visit.page?patient=${patientUuid}&visit=${visitUuid}&suppressActions=true#/overview',
|
|
35
|
+
_validators: [validators.isUrlWithTemplateParameters(['patientUuid', 'visitUuid'])],
|
|
38
36
|
},
|
|
39
37
|
homeVisitForm: {
|
|
40
38
|
_type: Type.String,
|
|
41
39
|
_default:
|
|
42
|
-
|
|
43
|
-
_validators: [
|
|
44
|
-
validators.isUrlWithTemplateParameters([
|
|
45
|
-
"patientUuid",
|
|
46
|
-
"visitUuid",
|
|
47
|
-
"encounterUuid",
|
|
48
|
-
]),
|
|
49
|
-
],
|
|
40
|
+
'${openmrsBase}/htmlformentryui/htmlform/editHtmlFormWithStandardUi.page?patientId=${patientUuid}&visitId=${visitUuid}&encounterId=${encounterUuid}&definitionUiResource=file:configuration/pih/htmlforms/section-mch-referral.xml&returnUrl=/mirebalais/spa/referrals-queue',
|
|
41
|
+
_validators: [validators.isUrlWithTemplateParameters(['patientUuid', 'visitUuid', 'encounterUuid'])],
|
|
50
42
|
},
|
|
51
43
|
},
|
|
52
44
|
pendingStatuses: {
|
|
53
45
|
_type: Type.Array,
|
|
54
|
-
_default: [
|
|
46
|
+
_default: ['Pending status', 'Referral unmet'],
|
|
55
47
|
_elements: {
|
|
56
48
|
_type: Type.String,
|
|
57
49
|
},
|
package/src/declarations.d.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
declare module
|
|
4
|
-
declare
|
|
1
|
+
declare module '*.css';
|
|
2
|
+
declare module '*.scss';
|
|
3
|
+
declare module '@carbon/react';
|
|
4
|
+
declare type SideNavProps = {};
|
|
5
5
|
|
|
6
6
|
type Referral = {
|
|
7
7
|
details: string;
|
package/src/index.ts
CHANGED
|
@@ -5,79 +5,25 @@
|
|
|
5
5
|
* microfrontend.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
defineConfigSchema,
|
|
11
|
-
registerBreadcrumbs,
|
|
12
|
-
} from "@openmrs/esm-framework";
|
|
13
|
-
import { configSchema } from "./config-schema";
|
|
8
|
+
import { getAsyncLifecycle, defineConfigSchema, registerBreadcrumbs } from '@openmrs/esm-framework';
|
|
9
|
+
import { configSchema } from './config-schema';
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* package.json
|
|
21
|
-
*/
|
|
22
|
-
declare var __VERSION__: string;
|
|
23
|
-
const version = __VERSION__;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* This tells the app shell how to obtain translation files: that they
|
|
27
|
-
* are JSON files in the directory `../translations` (which you should
|
|
28
|
-
* see in the directory structure).
|
|
29
|
-
*/
|
|
30
|
-
const importTranslation = require.context(
|
|
31
|
-
"../translations",
|
|
32
|
-
false,
|
|
33
|
-
/.json$/,
|
|
34
|
-
"lazy"
|
|
35
|
-
);
|
|
11
|
+
const moduleName = '@pih/esm-referrals-queue-app';
|
|
12
|
+
const options = {
|
|
13
|
+
featureName: 'referrals-queue',
|
|
14
|
+
moduleName,
|
|
15
|
+
};
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
* This tells the app shell what versions of what OpenMRS backend modules
|
|
39
|
-
* are expected. Warnings will appear if suitable modules are not
|
|
40
|
-
* installed. The keys are the part of the module name after
|
|
41
|
-
* `openmrs-module-`; e.g., `openmrs-module-fhir2` becomes `fhir2`.
|
|
42
|
-
*/
|
|
43
|
-
const backendDependencies = {};
|
|
17
|
+
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
44
18
|
|
|
45
|
-
|
|
46
|
-
* This function performs any setup that should happen at microfrontend
|
|
47
|
-
* load-time (such as defining the config schema) and then returns an
|
|
48
|
-
* object which describes how the React application(s) should be
|
|
49
|
-
* rendered.
|
|
50
|
-
*
|
|
51
|
-
* In this example, our return object contains a single page definition.
|
|
52
|
-
* It tells the app shell that the default export of `greeter.tsx`
|
|
53
|
-
* should be rendered when the route matches `hello`. The full route
|
|
54
|
-
* will be `openmrsSpaBase() + 'hello'`, which is usually
|
|
55
|
-
* `/openmrs/spa/hello`.
|
|
56
|
-
*/
|
|
57
|
-
function setupOpenMRS() {
|
|
58
|
-
const moduleName = "@pih/esm-referrals-queue-app";
|
|
59
|
-
const options = {
|
|
60
|
-
featureName: "referrals-queue",
|
|
61
|
-
moduleName,
|
|
62
|
-
};
|
|
19
|
+
export const root = getAsyncLifecycle(() => import('./root.component'), options);
|
|
63
20
|
|
|
21
|
+
export function startupApp() {
|
|
64
22
|
defineConfigSchema(moduleName, configSchema);
|
|
65
|
-
|
|
66
23
|
registerBreadcrumbs([
|
|
67
24
|
{
|
|
68
25
|
path: `${window.spaBase}/referrals-queue`,
|
|
69
|
-
title:
|
|
26
|
+
title: 'Referrals Queue',
|
|
70
27
|
},
|
|
71
28
|
]);
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
pages: [
|
|
75
|
-
{
|
|
76
|
-
load: getAsyncLifecycle(() => import("./root.component"), options),
|
|
77
|
-
route: "referrals-queue",
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
};
|
|
81
29
|
}
|
|
82
|
-
|
|
83
|
-
export { backendDependencies, importTranslation, setupOpenMRS, version };
|
|
@@ -1,185 +1,136 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Trans, useTranslation } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { createErrorHandler } from
|
|
8
|
-
import Table from
|
|
9
|
-
import styles from
|
|
10
|
-
import { getReferrals } from
|
|
11
|
-
|
|
12
|
-
// Override the webpack CSS loader config in order to load react-dates styles.
|
|
13
|
-
// See thread: https://github.com/webpack-contrib/css-loader/issues/295
|
|
14
|
-
import "!style-loader!css-loader!react-dates/lib/css/_datepicker.css";
|
|
15
|
-
import "!style-loader!css-loader!./react-dates-overrides.css";
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
3
|
+
import 'react-dates/initialize';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import { Content, Tile, Heading, Search, Dropdown, DatePicker, DatePickerInput } from '@carbon/react';
|
|
6
|
+
import 'moment/locale/fr';
|
|
7
|
+
import { createErrorHandler } from '@openmrs/esm-framework';
|
|
8
|
+
import Table from '../table/referrals-table.component';
|
|
9
|
+
import styles from './referrals-queue.scss';
|
|
10
|
+
import { getReferrals } from './referrals-queue.resource';
|
|
16
11
|
|
|
17
12
|
export default function ReferralsQueue(props: ReferralsQueueProps) {
|
|
18
13
|
const [referrals, setReferrals]: [Referral[], Function] = React.useState([]);
|
|
19
|
-
const [referralTypeFilter, setReferralTypeFilter] = React.useState(
|
|
20
|
-
const [statusFilter, setStatusFilter] = React.useState(
|
|
14
|
+
const [referralTypeFilter, setReferralTypeFilter] = React.useState('');
|
|
15
|
+
const [statusFilter, setStatusFilter] = React.useState('');
|
|
21
16
|
const today = moment();
|
|
22
|
-
const [fromDate, setFromDate] = React.useState(moment().subtract(1,
|
|
17
|
+
const [fromDate, setFromDate] = React.useState(moment().subtract(1, 'month'));
|
|
23
18
|
const [toDate, setToDate] = React.useState(today);
|
|
24
|
-
const [ptQuery, setPtQuery] = React.useState(
|
|
25
|
-
const [fromDateFocused, setFromDateFocused] = React.useState(false);
|
|
26
|
-
const [toDateFocused, setToDateFocused] = React.useState(false);
|
|
19
|
+
const [ptQuery, setPtQuery] = React.useState('');
|
|
27
20
|
const { t, i18n } = useTranslation();
|
|
28
21
|
|
|
29
22
|
const languageMatches = i18n.language?.match(/^(en|fr|ht).*/);
|
|
30
|
-
const language = (languageMatches && languageMatches[1]) ||
|
|
23
|
+
const language = (languageMatches && languageMatches[1]) || 'en';
|
|
31
24
|
|
|
32
25
|
React.useEffect(() => {
|
|
33
|
-
moment.locale(language ===
|
|
26
|
+
moment.locale(language === 'ht' ? 'fr' : language);
|
|
34
27
|
}, [language]);
|
|
35
28
|
|
|
36
29
|
React.useEffect(() => {
|
|
37
30
|
if (fromDate && toDate) {
|
|
38
31
|
const sub = getReferrals({
|
|
39
|
-
fromDate: fromDate.format(
|
|
40
|
-
toDate: toDate.format(
|
|
32
|
+
fromDate: fromDate.format('YYYY-MM-DD'),
|
|
33
|
+
toDate: toDate.format('YYYY-MM-DD'),
|
|
41
34
|
locale: language,
|
|
42
|
-
}).subscribe(
|
|
43
|
-
(referrals) => setReferrals(referrals),
|
|
44
|
-
createErrorHandler()
|
|
45
|
-
);
|
|
35
|
+
}).subscribe((referrals) => setReferrals(referrals), createErrorHandler());
|
|
46
36
|
return () => sub.unsubscribe();
|
|
47
37
|
}
|
|
48
38
|
}, [fromDate, toDate, language]);
|
|
49
39
|
|
|
50
|
-
// console.log(referrals);
|
|
51
40
|
const filteredReferrals = referrals
|
|
52
|
-
.filter(
|
|
53
|
-
|
|
41
|
+
.filter(
|
|
42
|
+
(r) => !referralTypeFilter || referralTypeFilter == t('any', 'Any') || r.referral_type == referralTypeFilter,
|
|
43
|
+
)
|
|
44
|
+
.filter((r) => !statusFilter || statusFilter == t('any', 'Any') || r.fulfillment_status == statusFilter)
|
|
54
45
|
.filter((r) => matchQuery(r, ptQuery));
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
];
|
|
46
|
+
|
|
47
|
+
const referralTypes = [t('any', 'Any'), ...new Set(referrals.map((r) => r.referral_type).filter((r) => r != null))];
|
|
48
|
+
|
|
49
|
+
const statuses = [t('any', 'Any'), ...new Set(referrals.map((r) => r.fulfillment_status).filter((r) => r != null))];
|
|
50
|
+
|
|
61
51
|
return (
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
<
|
|
52
|
+
<Content className={styles.container}>
|
|
53
|
+
<Tile>
|
|
54
|
+
<Heading>
|
|
65
55
|
<Trans i18nKey="referrals-queue">Referrals Queue</Trans>
|
|
66
|
-
</
|
|
56
|
+
</Heading>
|
|
67
57
|
<div className={styles.controlsContainer}>
|
|
68
58
|
<div className={styles.inputContainer}>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
date
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<Trans i18nKey="to">To</Trans>
|
|
87
|
-
</label>
|
|
88
|
-
<SingleDatePicker
|
|
89
|
-
id="to-date"
|
|
90
|
-
date={toDate}
|
|
91
|
-
onDateChange={(date) => setToDate(date)}
|
|
92
|
-
focused={toDateFocused}
|
|
93
|
-
onFocusChange={({ focused }) => setToDateFocused(focused)}
|
|
94
|
-
isOutsideRange={(date: Moment) => date.isAfter(today)}
|
|
95
|
-
displayFormat="DD MMM YYYY"
|
|
96
|
-
numberOfMonths={1}
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
59
|
+
<DatePicker
|
|
60
|
+
dateFormat="d/M/Y"
|
|
61
|
+
datePickerType="range"
|
|
62
|
+
locale={language === 'ht' ? 'fr' : language}
|
|
63
|
+
maxDate={new Date().toISOString()}
|
|
64
|
+
onChange={(date) => {
|
|
65
|
+
if (date && date.length > 0) {
|
|
66
|
+
setFromDate(date ? moment(date[0]) : null);
|
|
67
|
+
if (date.length > 1) {
|
|
68
|
+
setToDate(date ? moment(date[1]) : null);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}}
|
|
72
|
+
value={[fromDate.toISOString(), toDate.toISOString()]}>
|
|
73
|
+
<DatePickerInput id="from-date" labelText={t('from', 'From')} />
|
|
74
|
+
<DatePickerInput id="to-date" labelText={t('to', 'To')} />
|
|
75
|
+
</DatePicker>
|
|
99
76
|
</div>
|
|
100
77
|
<div className={styles.inputContainer}>
|
|
101
|
-
<div
|
|
102
|
-
<
|
|
103
|
-
<Trans i18nKey="referral-type">Referral Type</Trans>
|
|
104
|
-
</label>
|
|
105
|
-
<select
|
|
78
|
+
<div style={{ width: 400 }}>
|
|
79
|
+
<Dropdown
|
|
106
80
|
id="referral-type"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{referralTypes.map((t) => (
|
|
113
|
-
<option key={t} value={t}>
|
|
114
|
-
{t}
|
|
115
|
-
</option>
|
|
116
|
-
))}
|
|
117
|
-
</select>
|
|
81
|
+
label={t('select-referral-type', 'Select Referral Type')}
|
|
82
|
+
titleText={t('referral-type', 'Referral Type')}
|
|
83
|
+
items={referralTypes}
|
|
84
|
+
onChange={(e) => setReferralTypeFilter(e.selectedItem)}
|
|
85
|
+
/>
|
|
118
86
|
</div>
|
|
119
87
|
</div>
|
|
120
88
|
<div className={styles.inputContainer}>
|
|
121
|
-
<div
|
|
89
|
+
<div style={{ width: 400 }}>
|
|
122
90
|
<label htmlFor="query-input">
|
|
123
91
|
<Trans i18nKey="filter-by-patient">Filter by patient</Trans>
|
|
124
92
|
</label>
|
|
125
|
-
<input
|
|
126
|
-
id="query-input"
|
|
127
|
-
type="text"
|
|
128
|
-
value={ptQuery}
|
|
129
|
-
onChange={(e) => setPtQuery(e.target.value)}
|
|
130
|
-
className="omrs-input-outlined"
|
|
131
|
-
/>
|
|
93
|
+
<Search id="query-input" labelText="" onChange={(e) => setPtQuery(e.target.value)} />
|
|
132
94
|
</div>
|
|
133
95
|
</div>
|
|
134
96
|
<div className={styles.inputContainer}>
|
|
135
|
-
<div
|
|
136
|
-
<
|
|
137
|
-
<Trans i18nKey="status">Status</Trans>
|
|
138
|
-
</label>
|
|
139
|
-
<select
|
|
97
|
+
<div style={{ width: 400 }}>
|
|
98
|
+
<Dropdown
|
|
140
99
|
id="status"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
{statuses.map((t) => (
|
|
147
|
-
<option key={t} value={t}>
|
|
148
|
-
{t}
|
|
149
|
-
</option>
|
|
150
|
-
))}
|
|
151
|
-
</select>
|
|
100
|
+
label={t('select-status', 'Select Status')}
|
|
101
|
+
titleText={t('status', 'Status')}
|
|
102
|
+
items={statuses}
|
|
103
|
+
onChange={(e) => setStatusFilter(e.selectedItem)}
|
|
104
|
+
/>
|
|
152
105
|
</div>
|
|
153
106
|
</div>
|
|
154
107
|
</div>
|
|
155
108
|
<div className={styles.tableContainer}>
|
|
156
109
|
<Table referrals={filteredReferrals} />
|
|
157
110
|
</div>
|
|
158
|
-
</
|
|
159
|
-
</
|
|
111
|
+
</Tile>
|
|
112
|
+
</Content>
|
|
160
113
|
);
|
|
161
114
|
}
|
|
162
115
|
|
|
163
116
|
function matchQuery(referral: Referral, query: string): boolean {
|
|
164
117
|
return (
|
|
165
118
|
!query ||
|
|
166
|
-
prepareQuery(query).every((regexp) =>
|
|
167
|
-
|
|
168
|
-
) ||
|
|
169
|
-
new RegExp(query, "i").test(referral.zl_emr_id)
|
|
119
|
+
prepareQuery(query).every((regexp) => regexp.test(removeDiacritics(referral.patient_name))) ||
|
|
120
|
+
new RegExp(query, 'i').test(referral.zl_emr_id)
|
|
170
121
|
);
|
|
171
122
|
}
|
|
172
123
|
|
|
173
124
|
function prepareQuery(query: string): RegExp[] {
|
|
174
125
|
return query.split(/\s/).map((token) => {
|
|
175
126
|
const tokenCleaned = removeDiacritics(token);
|
|
176
|
-
return new RegExp(
|
|
127
|
+
return new RegExp('\\b' + tokenCleaned, 'i');
|
|
177
128
|
});
|
|
178
129
|
}
|
|
179
130
|
|
|
180
131
|
function removeDiacritics(str: string) {
|
|
181
132
|
// From https://stackoverflow.com/a/37511463/1464495
|
|
182
|
-
return str.normalize(
|
|
133
|
+
return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
183
134
|
}
|
|
184
135
|
|
|
185
136
|
type ReferralsQueueProps = {};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { openmrsObservableFetch } from
|
|
2
|
-
import {
|
|
1
|
+
import { openmrsObservableFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { type Observable } from 'rxjs';
|
|
3
|
+
import { map } from 'rxjs/operators';
|
|
3
4
|
|
|
4
|
-
export function getReferrals({
|
|
5
|
-
fromDate,
|
|
6
|
-
toDate,
|
|
7
|
-
locale,
|
|
8
|
-
}): Observable<Object[]> {
|
|
5
|
+
export function getReferrals({ fromDate, toDate, locale }): Observable<Object[]> {
|
|
9
6
|
return openmrsObservableFetch(
|
|
10
|
-
`/ws/rest/v1/reportingrest/reportdata/cd7dfde7-764a-4da6-81c2-d5887ed1df51?startDate=${fromDate}&endDate=${toDate}&locale=${locale}
|
|
11
|
-
).pipe(map(({ data }) => data[
|
|
7
|
+
`/ws/rest/v1/reportingrest/reportdata/cd7dfde7-764a-4da6-81c2-d5887ed1df51?startDate=${fromDate}&endDate=${toDate}&locale=${locale}`,
|
|
8
|
+
).pipe(map(({ data }) => data['dataSets'][0]['rows']));
|
|
12
9
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use '@carbon/react';
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
margin-right: auto;
|
|
5
|
+
margin-left: auto;
|
|
6
|
+
max-width: 1500px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tableContainer {
|
|
10
|
+
height: 500px;
|
|
11
|
+
overflow-x: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.controlsContainer {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.inputContainer {
|
|
20
|
+
display: flex;
|
|
21
|
+
width: 50%;
|
|
22
|
+
min-width: 300px;
|
|
23
|
+
text-align: left;
|
|
24
|
+
padding: 0.5rem;
|
|
25
|
+
align-items: flex-end;
|
|
26
|
+
}
|