@pih/esm-referrals-queue-app 1.0.5-pre.7

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 (46) hide show
  1. package/.babelrc +10 -0
  2. package/.editorconfig +11 -0
  3. package/.eslintignore +1 -0
  4. package/.eslintrc +5 -0
  5. package/.gitattributes +1 -0
  6. package/.github/workflows/node.js.yml +80 -0
  7. package/.husky/pre-commit +6 -0
  8. package/.prettierignore +4 -0
  9. package/.tx/config +10 -0
  10. package/.vscode/launch.json +35 -0
  11. package/LICENSE +401 -0
  12. package/README.md +43 -0
  13. package/__mocks__/openmrs-esm-framework.mock.tsx +64 -0
  14. package/design-mockup.png +0 -0
  15. package/dist/264.pih-esm-referrals-queue-app.js +2 -0
  16. package/dist/264.pih-esm-referrals-queue-app.js.map +1 -0
  17. package/dist/319.pih-esm-referrals-queue-app.js +1 -0
  18. package/dist/574.pih-esm-referrals-queue-app.js +1 -0
  19. package/dist/757.pih-esm-referrals-queue-app.js +1 -0
  20. package/dist/874.pih-esm-referrals-queue-app.js +3 -0
  21. package/dist/874.pih-esm-referrals-queue-app.js.LICENSE.txt +27 -0
  22. package/dist/874.pih-esm-referrals-queue-app.js.map +1 -0
  23. package/dist/pih-esm-referrals-queue-app.js +2 -0
  24. package/dist/pih-esm-referrals-queue-app.js.buildmanifest.json +142 -0
  25. package/dist/pih-esm-referrals-queue-app.js.map +1 -0
  26. package/jest.config.js +12 -0
  27. package/package.json +87 -0
  28. package/src/declarations.d.tsx +20 -0
  29. package/src/index.ts +78 -0
  30. package/src/referrals-queue/react-dates-overrides.css +39 -0
  31. package/src/referrals-queue/referrals-queue.component.tsx +185 -0
  32. package/src/referrals-queue/referrals-queue.css +63 -0
  33. package/src/referrals-queue/referrals-queue.resource.ts +12 -0
  34. package/src/referrals-queue/referrals-queue.test.tsx +198 -0
  35. package/src/root.component.test.tsx +9 -0
  36. package/src/root.component.tsx +14 -0
  37. package/src/root.css +3 -0
  38. package/src/setup-tests.js +13 -0
  39. package/src/table/table.component.tsx +95 -0
  40. package/src/table/table.css +16 -0
  41. package/src/util.ts +20 -0
  42. package/translations/en.json +13 -0
  43. package/translations/es.json +13 -0
  44. package/translations/fr.json +13 -0
  45. package/tsconfig.json +23 -0
  46. package/webpack.config.js +1 -0
@@ -0,0 +1,2 @@
1
+ System.register(["@openmrs/esm-framework","react","react-i18next","react-dom"],(function(e,r){var t={},i={},n={},a={};return Object.defineProperty(i,"__esModule",{value:!0}),{setters:[function(e){t.ConfigurableLink=e.ConfigurableLink,t.Type=e.Type,t.createErrorHandler=e.createErrorHandler,t.defineConfigSchema=e.defineConfigSchema,t.getAsyncLifecycle=e.getAsyncLifecycle,t.interpolateString=e.interpolateString,t.openmrsObservableFetch=e.openmrsObservableFetch,t.registerBreadcrumbs=e.registerBreadcrumbs,t.useConfig=e.useConfig,t.validators=e.validators},function(e){Object.keys(e).forEach((function(r){i[r]=e[r]}))},function(e){n.Trans=e.Trans,n.useTranslation=e.useTranslation},function(e){a.default=e.default}],execute:function(){e((()=>{var e,o,s={2722:(e,r,t)=>{const i=t(3905).R;r.s=function(e){if(e||(e=1),!t.y.meta||!t.y.meta.url)throw console.error("__system_context__",t.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");t.p=i(t.y.meta.url,e)}},3905:(e,r,t)=>{r.R=function(e,r){var t=document.createElement("a");t.href=e;for(var i="/"===t.pathname[0]?t.pathname:"/"+t.pathname,n=0,a=i.length;n!==r&&a>=0;)"/"===i[--a]&&n++;if(n!==r)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+r+") is greater than the number of directories ("+n+") in the URL path "+e);var o=i.slice(0,a+1);return t.protocol+"//"+t.host+o};Number.isInteger},3979:(e,r,t)=>{var i={"./en.json":[3574,574],"./es.json":[8319,319],"./fr.json":[2757,757]};function n(e){if(!t.o(i,e))return Promise.resolve().then((()=>{var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}));var r=i[e],n=r[0];return t.e(r[1]).then((()=>t(n)))}n.keys=()=>Object.keys(i),n.id=3979,e.exports=n},1489:e=>{"use strict";e.exports=t},5954:e=>{"use strict";e.exports=i},493:e=>{"use strict";e.exports=a},4281:e=>{"use strict";e.exports=n}},u={};function l(e){var r=u[e];if(void 0!==r)return r.exports;var t=u[e]={id:e,loaded:!1,exports:{}};return s[e].call(t.exports,t,t.exports,l),t.loaded=!0,t.exports}l.m=s,l.y=r,l.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return l.d(r,{a:r}),r},l.d=(e,r)=>{for(var t in r)l.o(r,t)&&!l.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((r,t)=>(l.f[t](e,r),r)),[])),l.u=e=>e+".pih-esm-referrals-queue-app.js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o="@pih/esm-referrals-queue-app:",l.l=(r,t,i,n)=>{if(e[r])e[r].push(t);else{var a,s;if(void 0!==i)for(var u=document.getElementsByTagName("script"),p=0;p<u.length;p++){var c=u[p];if(c.getAttribute("src")==r||c.getAttribute("data-webpack")==o+i){a=c;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+i),a.src=r),e[r]=[t];var d=(t,i)=>{a.onerror=a.onload=null,clearTimeout(f);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(i))),t)return t(i)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.p="",(()=>{var e={179:0};l.f.j=(r,t)=>{var i=l.o(e,r)?e[r]:void 0;if(0!==i)if(i)t.push(i[2]);else{var n=new Promise(((t,n)=>i=e[r]=[t,n]));t.push(i[2]=n);var a=l.p+l.u(r),o=new Error;l.l(a,(t=>{if(l.o(e,r)&&(0!==(i=e[r])&&(e[r]=void 0),i)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;o.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,i[1](o)}}),"chunk-"+r,r)}};var r=(r,t)=>{var i,n,[a,o,s]=t,u=0;if(a.some((r=>0!==e[r]))){for(i in o)l.o(o,i)&&(l.m[i]=o[i]);s&&s(l)}for(r&&r(t);u<a.length;u++)n=a[u],l.o(e,n)&&e[n]&&e[n][0](),e[a[u]]=0},t=self.webpackChunk_pih_esm_referrals_queue_app=self.webpackChunk_pih_esm_referrals_queue_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var p={};return(0,l(2722).s)(1),(()=>{"use strict";l.r(p),l.d(p,{backendDependencies:()=>r,importTranslation:()=>t,setupOpenMRS:()=>i});var e=l(1489);const r={},t=l(3979);function i(){(0,e.defineConfigSchema)("@pih/esm-referrals-queue-app",{links:{patientDash:{_type:e.Type.String,_default:"${openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&app=pih.app.clinicianDashboard",_validators:[e.validators.isUrlWithTemplateParameters(["patientUuid"])]},visitPage:{_type:e.Type.String,_default:"${openmrsBase}/pihcore/visit/visit.page?patient=${patientUuid}&visit=${visitUuid}&suppressActions=true#/overview",_validators:[e.validators.isUrlWithTemplateParameters(["patientUuid","visitUuid"])]},homeVisitForm:{_type:e.Type.String,_default:"${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",_validators:[e.validators.isUrlWithTemplateParameters(["patientUuid","visitUuid","encounterUuid"])]}},pendingStatuses:{_type:e.Type.Array,_default:["Pending status","Referral unmet"],_elements:{_type:e.Type.String}}});const r="referrals-queue",t={featureName:r,moduleName:"@pih/esm-referrals-queue-app"};return(0,e.registerBreadcrumbs)([{path:`${window.spaBase}/${r}`,title:"Referrals Queue"}]),{lifecycle:(0,e.getAsyncLifecycle)((()=>Promise.all([l.e(874),l.e(264)]).then(l.bind(l,8973))),t),activate:r}}})(),p})())}}}));
2
+ //# sourceMappingURL=pih-esm-referrals-queue-app.js.map
@@ -0,0 +1,142 @@
1
+ {
2
+ "chunks": [
3
+ {
4
+ "rendered": true,
5
+ "initial": true,
6
+ "entry": true,
7
+ "recorded": false,
8
+ "size": 12169,
9
+ "sizes": {
10
+ "javascript": 5639,
11
+ "runtime": 6530
12
+ },
13
+ "names": [
14
+ "main"
15
+ ],
16
+ "idHints": [],
17
+ "runtime": [
18
+ "main"
19
+ ],
20
+ "files": [
21
+ "pih-esm-referrals-queue-app.js"
22
+ ],
23
+ "auxiliaryFiles": [
24
+ "pih-esm-referrals-queue-app.js.map"
25
+ ],
26
+ "hash": "f494a8bf74212dd5cab9",
27
+ "childrenByOrder": {}
28
+ },
29
+ {
30
+ "rendered": true,
31
+ "initial": false,
32
+ "entry": false,
33
+ "recorded": false,
34
+ "size": 26117,
35
+ "sizes": {
36
+ "javascript": 26117
37
+ },
38
+ "names": [],
39
+ "idHints": [],
40
+ "runtime": [
41
+ "main"
42
+ ],
43
+ "files": [
44
+ "264.pih-esm-referrals-queue-app.js"
45
+ ],
46
+ "auxiliaryFiles": [
47
+ "264.pih-esm-referrals-queue-app.js.map"
48
+ ],
49
+ "hash": "803121acc31c5e4cc4f6",
50
+ "childrenByOrder": {}
51
+ },
52
+ {
53
+ "rendered": true,
54
+ "initial": false,
55
+ "entry": false,
56
+ "recorded": false,
57
+ "size": 282,
58
+ "sizes": {
59
+ "javascript": 282
60
+ },
61
+ "names": [],
62
+ "idHints": [],
63
+ "runtime": [
64
+ "main"
65
+ ],
66
+ "files": [
67
+ "319.pih-esm-referrals-queue-app.js"
68
+ ],
69
+ "auxiliaryFiles": [],
70
+ "hash": "b956dd4aaa687b8b2f57",
71
+ "childrenByOrder": {}
72
+ },
73
+ {
74
+ "rendered": true,
75
+ "initial": false,
76
+ "entry": false,
77
+ "recorded": false,
78
+ "size": 257,
79
+ "sizes": {
80
+ "javascript": 257
81
+ },
82
+ "names": [],
83
+ "idHints": [],
84
+ "runtime": [
85
+ "main"
86
+ ],
87
+ "files": [
88
+ "574.pih-esm-referrals-queue-app.js"
89
+ ],
90
+ "auxiliaryFiles": [],
91
+ "hash": "b5b94ce5c88fa28bbf00",
92
+ "childrenByOrder": {}
93
+ },
94
+ {
95
+ "rendered": true,
96
+ "initial": false,
97
+ "entry": false,
98
+ "recorded": false,
99
+ "size": 253,
100
+ "sizes": {
101
+ "javascript": 253
102
+ },
103
+ "names": [],
104
+ "idHints": [],
105
+ "runtime": [
106
+ "main"
107
+ ],
108
+ "files": [
109
+ "757.pih-esm-referrals-queue-app.js"
110
+ ],
111
+ "auxiliaryFiles": [],
112
+ "hash": "582445df8ff8b307dc18",
113
+ "childrenByOrder": {}
114
+ },
115
+ {
116
+ "rendered": true,
117
+ "initial": false,
118
+ "entry": false,
119
+ "recorded": false,
120
+ "reason": "split chunk (cache group: defaultVendors)",
121
+ "size": 1498949,
122
+ "sizes": {
123
+ "javascript": 1498949
124
+ },
125
+ "names": [],
126
+ "idHints": [
127
+ "vendors"
128
+ ],
129
+ "runtime": [
130
+ "main"
131
+ ],
132
+ "files": [
133
+ "874.pih-esm-referrals-queue-app.js"
134
+ ],
135
+ "auxiliaryFiles": [
136
+ "874.pih-esm-referrals-queue-app.js.map"
137
+ ],
138
+ "hash": "95c5bd3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EAAW,kBAEXC,EAAU,CACdC,YAAaF,EACbG,WALiB,gCAenB,OAPAC,EAAAA,EAAAA,qBAAoB,CAClB,CACEC,KAAO,GAAEtF,OAAOuF,WAAWN,IAC3BO,MAAO,qBAIJ,CACLC,WAAWC,EAAAA,EAAAA,oBAAkB,IAAM,uDAA4BR,GAC/DS,SAAUV,K","sources":["webpack://@pih/esm-referrals-queue-app/webpack/runtime/load script","webpack://@pih/esm-referrals-queue-app/./node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@pih/esm-referrals-queue-app/./node_modules/systemjs-webpack-interop/public-path.js","webpack://@pih/esm-referrals-queue-app//home/runner/work/pih-esm-referrals-queue/pih-esm-referrals-queue/translations|lazy|nonrecursive|/.json$/","webpack://@pih/esm-referrals-queue-app/external system \"@openmrs/esm-framework\"","webpack://@pih/esm-referrals-queue-app/external system \"react\"","webpack://@pih/esm-referrals-queue-app/external system \"react-dom\"","webpack://@pih/esm-referrals-queue-app/external system \"react-i18next\"","webpack://@pih/esm-referrals-queue-app/webpack/bootstrap","webpack://@pih/esm-referrals-queue-app/webpack/runtime/__system_context__","webpack://@pih/esm-referrals-queue-app/webpack/runtime/compat get default export","webpack://@pih/esm-referrals-queue-app/webpack/runtime/define property getters","webpack://@pih/esm-referrals-queue-app/webpack/runtime/ensure chunk","webpack://@pih/esm-referrals-queue-app/webpack/runtime/get javascript chunk filename","webpack://@pih/esm-referrals-queue-app/webpack/runtime/global","webpack://@pih/esm-referrals-queue-app/webpack/runtime/hasOwnProperty shorthand","webpack://@pih/esm-referrals-queue-app/webpack/runtime/make namespace object","webpack://@pih/esm-referrals-queue-app/webpack/runtime/node module decorator","webpack://@pih/esm-referrals-queue-app/webpack/runtime/publicPath","webpack://@pih/esm-referrals-queue-app/webpack/runtime/jsonp chunk loading","webpack://@pih/esm-referrals-queue-app/./node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@pih/esm-referrals-queue-app/./src/index.ts"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"@pih/esm-referrals-queue-app:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","var map = {\n\t\"./en.json\": [\n\t\t3574,\n\t\t574\n\t],\n\t\"./es.json\": [\n\t\t8319,\n\t\t319\n\t],\n\t\"./fr.json\": [\n\t\t2757,\n\t\t757\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(() => {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = () => (Object.keys(map));\nwebpackAsyncContext.id = 3979;\nmodule.exports = webpackAsyncContext;","module.exports = __WEBPACK_EXTERNAL_MODULE__1489__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5954__;","module.exports = __WEBPACK_EXTERNAL_MODULE__493__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4281__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.y = __system_context__;","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".pih-esm-referrals-queue-app.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk_pih_esm_referrals_queue_app\"] = self[\"webpackChunk_pih_esm_referrals_queue_app\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","import {\n defineConfigSchema,\n Type,\n validators,\n registerBreadcrumbs,\n getAsyncLifecycle,\n} from \"@openmrs/esm-framework\";\n\nconst backendDependencies = {};\n\nconst importTranslation = require.context(\n \"../translations\",\n false,\n /.json$/,\n \"lazy\"\n);\n\nfunction setupOpenMRS() {\n defineConfigSchema(\"@pih/esm-referrals-queue-app\", {\n links: {\n patientDash: {\n _type: Type.String,\n _default:\n \"${openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&app=pih.app.clinicianDashboard\",\n _validators: [validators.isUrlWithTemplateParameters([\"patientUuid\"])],\n },\n visitPage: {\n _type: Type.String,\n _default:\n \"${openmrsBase}/pihcore/visit/visit.page?patient=${patientUuid}&visit=${visitUuid}&suppressActions=true#/overview\",\n _validators: [\n validators.isUrlWithTemplateParameters([\"patientUuid\", \"visitUuid\"]),\n ],\n },\n homeVisitForm: {\n _type: Type.String,\n _default:\n \"${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\",\n _validators: [\n validators.isUrlWithTemplateParameters([\n \"patientUuid\",\n \"visitUuid\",\n \"encounterUuid\",\n ]),\n ],\n },\n },\n pendingStatuses: {\n _type: Type.Array,\n _default: [\"Pending status\", \"Referral unmet\"],\n _elements: {\n _type: Type.String,\n },\n },\n });\n\n const moduleName = \"@pih/esm-referrals-queue-app\";\n const pageName = \"referrals-queue\";\n\n const options = {\n featureName: pageName,\n moduleName,\n };\n\n registerBreadcrumbs([\n {\n path: `${window.spaBase}/${pageName}`,\n title: \"Referrals Queue\",\n },\n ]);\n\n return {\n lifecycle: getAsyncLifecycle(() => import(\"./root.component\"), options),\n activate: pageName,\n };\n}\n\nexport { backendDependencies, importTranslation, setupOpenMRS };\n"],"names":["inProgress","dataWebpackPrefix","resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","code","ids","id","keys","Object","module","__WEBPACK_EXTERNAL_MODULE__1489__","__WEBPACK_EXTERNAL_MODULE__5954__","__WEBPACK_EXTERNAL_MODULE__493__","__WEBPACK_EXTERNAL_MODULE__4281__","__webpack_module_cache__","moduleId","cachedModule","undefined","loaded","__webpack_modules__","call","m","y","__system_context__","n","getter","__esModule","d","definition","key","defineProperty","enumerable","get","f","chunkId","all","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","l","done","push","script","needAttach","scripts","getElementsByTagName","i","s","getAttribute","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","nmd","paths","children","p","installedChunks","j","installedChunkData","promise","reject","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self","autoPublicPath","backendDependencies","importTranslation","require","setupOpenMRS","defineConfigSchema","links","patientDash","_type","Type","_default","_validators","validators","visitPage","homeVisitForm","pendingStatuses","_elements","pageName","options","featureName","moduleName","registerBreadcrumbs","path","spaBase","title","lifecycle","getAsyncLifecycle","activate"],"sourceRoot":""}
package/jest.config.js ADDED
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ testEnvironment: "jsdom",
3
+ transform: {
4
+ "^.+\\.(j|t)sx?$": "babel-jest"
5
+ },
6
+ moduleNameMapper: {
7
+ "@openmrs/esm-framework":
8
+ "<rootDir>/__mocks__/openmrs-esm-framework.mock.tsx",
9
+ "\\.(css)$": "identity-obj-proxy"
10
+ },
11
+ setupFiles: ["<rootDir>/src/setup-tests.js"]
12
+ };
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@pih/esm-referrals-queue-app",
3
+ "version": "1.0.5-pre.7",
4
+ "description": "A page for viewing the J9 Home Visits from CommCare",
5
+ "browser": "dist/pih-esm-referrals-queue-app.js",
6
+ "main": "src/index.ts",
7
+ "license": "MPL-2.0",
8
+ "homepage": "https://pihemr.atlassian.net/wiki/spaces/DSS/pages/538116104/PIH+EMR+Referrals+Queue",
9
+ "scripts": {
10
+ "start": "openmrs develop --backend https://humci.pih-emr.org/ --api-url /mirebalais/",
11
+ "serve": "webpack serve --mode development",
12
+ "build": "webpack --mode production",
13
+ "analyze": "webpack --mode=production --env.analyze=true",
14
+ "lint": "eslint src --ext tsx",
15
+ "prettier": "prettier 'src/**/*' --write",
16
+ "typescript": "tsc",
17
+ "prepublishOnly": "npm run build",
18
+ "test": "jest",
19
+ "coverage": "npm test -- --coverage",
20
+ "update-translations": "tx pull",
21
+ "prepare": "husky install"
22
+ },
23
+ "browserslist": [
24
+ "extends browserslist-config-openmrs"
25
+ ],
26
+ "keywords": [
27
+ "openmrs"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/pih/esm-referrals-queue.git"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/pih/esm-referrals-queue/issues"
38
+ },
39
+ "peerDependencies": {
40
+ "@openmrs/esm-framework": "3.x",
41
+ "dayjs": "^1.x",
42
+ "react": "16.x",
43
+ "react-dom": "16.x",
44
+ "react-i18next": "^11.x"
45
+ },
46
+ "devDependencies": {
47
+ "@babel/core": "^7.15.5",
48
+ "@babel/plugin-proposal-class-properties": "^7.14.5",
49
+ "@babel/plugin-transform-runtime": "^7.15.0",
50
+ "@babel/preset-env": "^7.15.6",
51
+ "@babel/preset-react": "^7.14.5",
52
+ "@babel/preset-typescript": "^7.15.0",
53
+ "@openmrs/esm-framework": "next",
54
+ "@testing-library/jest-dom": "^5.14.1",
55
+ "@testing-library/react": "^12.1.1",
56
+ "@types/jest": "^27.0.2",
57
+ "@types/react": "^16.9.19",
58
+ "@types/react-dates": "^21.8.3",
59
+ "@types/react-dom": "^16.9.5",
60
+ "@types/webpack-env": "^1.16.2",
61
+ "@typescript-eslint/parser": "^4.32.0",
62
+ "babel-eslint": "^10.1.0",
63
+ "babel-jest": "^27.2.3",
64
+ "concurrently": "^6.2.2",
65
+ "coveralls": "^3.1.1",
66
+ "eslint": "^7.32.0",
67
+ "eslint-config-prettier": "^8.3.0",
68
+ "eslint-config-ts-react-important-stuff": "^3.0.0",
69
+ "eslint-plugin-prettier": "^4.0.0",
70
+ "husky": "^6.0.0",
71
+ "i18next": "^21.1.1",
72
+ "identity-obj-proxy": "^3.0.0",
73
+ "jest": "^27.2.3",
74
+ "lint-staged": "^11.1.2",
75
+ "mockdate": "^3.0.5",
76
+ "moment": "^2.29.1",
77
+ "openmrs": "next",
78
+ "prettier": "^2.4.1",
79
+ "pretty-quick": "^3.1.1",
80
+ "react-dates": "^21.8.0",
81
+ "react-i18next": "^11.3.1",
82
+ "react-router": "^5.2.1",
83
+ "react-router-dom": "^5.3.0",
84
+ "rxjs": "^7.3.0",
85
+ "typescript": "^4.4.3"
86
+ }
87
+ }
@@ -0,0 +1,20 @@
1
+ declare type Observable<T> = import("rxjs").Observable<T>;
2
+
3
+ declare module "uuid"; // Hack to fix a problem with @openmrs/esm-offline -- Sep 28, 2021
4
+
5
+ declare module "*.css";
6
+
7
+ type Referral = {
8
+ details: string;
9
+ encounter_uuid: string;
10
+ encounter_id: number;
11
+ patient_name: string;
12
+ referral_date: string;
13
+ referral_type: string;
14
+ status: string;
15
+ visit_uuid: string;
16
+ zl_emr_id: string;
17
+ fulfillment_status: string;
18
+ patient_uuid?: string;
19
+ person_uuid?: string;
20
+ };
package/src/index.ts ADDED
@@ -0,0 +1,78 @@
1
+ import {
2
+ defineConfigSchema,
3
+ Type,
4
+ validators,
5
+ registerBreadcrumbs,
6
+ getAsyncLifecycle,
7
+ } from "@openmrs/esm-framework";
8
+
9
+ const backendDependencies = {};
10
+
11
+ const importTranslation = require.context(
12
+ "../translations",
13
+ false,
14
+ /.json$/,
15
+ "lazy"
16
+ );
17
+
18
+ function setupOpenMRS() {
19
+ defineConfigSchema("@pih/esm-referrals-queue-app", {
20
+ links: {
21
+ patientDash: {
22
+ _type: Type.String,
23
+ _default:
24
+ "${openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&app=pih.app.clinicianDashboard",
25
+ _validators: [validators.isUrlWithTemplateParameters(["patientUuid"])],
26
+ },
27
+ visitPage: {
28
+ _type: Type.String,
29
+ _default:
30
+ "${openmrsBase}/pihcore/visit/visit.page?patient=${patientUuid}&visit=${visitUuid}&suppressActions=true#/overview",
31
+ _validators: [
32
+ validators.isUrlWithTemplateParameters(["patientUuid", "visitUuid"]),
33
+ ],
34
+ },
35
+ homeVisitForm: {
36
+ _type: Type.String,
37
+ _default:
38
+ "${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",
39
+ _validators: [
40
+ validators.isUrlWithTemplateParameters([
41
+ "patientUuid",
42
+ "visitUuid",
43
+ "encounterUuid",
44
+ ]),
45
+ ],
46
+ },
47
+ },
48
+ pendingStatuses: {
49
+ _type: Type.Array,
50
+ _default: ["Pending status", "Referral unmet"],
51
+ _elements: {
52
+ _type: Type.String,
53
+ },
54
+ },
55
+ });
56
+
57
+ const moduleName = "@pih/esm-referrals-queue-app";
58
+ const pageName = "referrals-queue";
59
+
60
+ const options = {
61
+ featureName: pageName,
62
+ moduleName,
63
+ };
64
+
65
+ registerBreadcrumbs([
66
+ {
67
+ path: `${window.spaBase}/${pageName}`,
68
+ title: "Referrals Queue",
69
+ },
70
+ ]);
71
+
72
+ return {
73
+ lifecycle: getAsyncLifecycle(() => import("./root.component"), options),
74
+ activate: pageName,
75
+ };
76
+ }
77
+
78
+ export { backendDependencies, importTranslation, setupOpenMRS };
@@ -0,0 +1,39 @@
1
+ /* This is based on https://github.com/airbnb/react-dates#overriding-styles */
2
+
3
+ /* NOTE: the order of these styles DO matter */
4
+
5
+ /* Will edit everything selected including everything between a range of dates */
6
+ .CalendarDay__selected_span {
7
+ background: var(--omrs-color-interaction-minus-one);
8
+ border: 1px solid var(--omrs-color-interaction);
9
+ }
10
+
11
+ /* Will edit selected date or the endpoints of a range of dates */
12
+ .CalendarDay__selected {
13
+ background: var(--omrs-color-interaction-plus-one);
14
+ border: 1px solid var(--omrs-color-interaction-plus-two);
15
+ }
16
+
17
+ /* Will edit when hovered over. _span style also has this property */
18
+ .CalendarDay__selected:hover {
19
+ background: var(--omrs-color-interaction-plus-two);
20
+ border: 1px solid var(--omrs-color-interaction);
21
+ }
22
+
23
+ /* Will edit when hovered over. _span style also has this property */
24
+ .CalendarDay__selected_span:hover {
25
+ background: var(--omrs-color-interaction);
26
+ border: 1px solid var(--omrs-color-interaction-plus-one);
27
+ }
28
+
29
+ /* Will edit the underline in the focused input box */
30
+ .DateInput_input__focused {
31
+ border-bottom: 2px solid var(--omrs-color-interaction);
32
+ }
33
+
34
+ /* Will edit when the second date (end date) in a range of dates */
35
+ /* is not yet selected. Edits the dates between your mouse and said date */
36
+ /* .CalendarDay__hovered_span:hover,
37
+ .CalendarDay__hovered_span {
38
+ background: var(--omrs-color-interaction-minus-two);
39
+ } */
@@ -0,0 +1,185 @@
1
+ import React from "react";
2
+ import { Trans, useTranslation } from "react-i18next";
3
+ import "react-dates/initialize";
4
+ import { SingleDatePicker } from "react-dates";
5
+ import moment, { Moment } from "moment";
6
+ import "moment/locale/fr";
7
+ import { createErrorHandler } from "@openmrs/esm-framework";
8
+ import Table from "../table/table.component";
9
+ import styles from "./referrals-queue.css";
10
+ import { getReferrals } from "./referrals-queue.resource";
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";
16
+
17
+ export default function ReferralsQueue(props: ReferralsQueueProps) {
18
+ const [referrals, setReferrals]: [Referral[], Function] = React.useState([]);
19
+ const [referralTypeFilter, setReferralTypeFilter] = React.useState("");
20
+ const [statusFilter, setStatusFilter] = React.useState("");
21
+ const today = moment();
22
+ const [fromDate, setFromDate] = React.useState(moment().subtract(1, "month"));
23
+ 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);
27
+ const { t, i18n } = useTranslation();
28
+
29
+ const languageMatches = i18n.language.match(/^(en|fr|ht).*/);
30
+ const language = (languageMatches && languageMatches[1]) || "en";
31
+
32
+ React.useEffect(() => {
33
+ moment.locale(language === "ht" ? "fr" : language);
34
+ }, [language]);
35
+
36
+ React.useEffect(() => {
37
+ if (fromDate && toDate) {
38
+ const sub = getReferrals({
39
+ fromDate: fromDate.format("YYYY-MM-DD"),
40
+ toDate: toDate.format("YYYY-MM-DD"),
41
+ locale: language,
42
+ }).subscribe(
43
+ (referrals) => setReferrals(referrals),
44
+ createErrorHandler()
45
+ );
46
+ return () => sub.unsubscribe();
47
+ }
48
+ }, [fromDate, toDate, language]);
49
+
50
+ // console.log(referrals);
51
+ const filteredReferrals = referrals
52
+ .filter((r) => !referralTypeFilter || r.referral_type == referralTypeFilter)
53
+ .filter((r) => !statusFilter || r.fulfillment_status == statusFilter)
54
+ .filter((r) => matchQuery(r, ptQuery));
55
+ const referralTypes = [...new Set(referrals.map((r) => r.referral_type))];
56
+ const statuses = [
57
+ ...new Set(
58
+ referrals.map((r) => r.fulfillment_status).filter((r) => r != null)
59
+ ),
60
+ ];
61
+ return (
62
+ <div className={styles.container}>
63
+ <div className="omrs-card omrs-margin-top-16 omrs-padding-16">
64
+ <div className="omrs-type-title-2">
65
+ <Trans i18nKey="referrals-queue">Referrals Queue</Trans>
66
+ </div>
67
+ <div className={styles.controlsContainer}>
68
+ <div className={styles.inputContainer}>
69
+ <div className={styles.dateInputContainer}>
70
+ <label htmlFor="from-date">
71
+ <Trans i18nKey="from">From</Trans>
72
+ </label>
73
+ <SingleDatePicker
74
+ id="from-date"
75
+ date={fromDate}
76
+ onDateChange={(date) => setFromDate(date)}
77
+ focused={fromDateFocused}
78
+ onFocusChange={({ focused }) => setFromDateFocused(focused)}
79
+ isOutsideRange={(date: Moment) => date.isAfter(today)}
80
+ displayFormat="DD MMM YYYY"
81
+ numberOfMonths={1}
82
+ />
83
+ </div>
84
+ <div className={styles.dateInputContainer}>
85
+ <label htmlFor="to-date">
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>
99
+ </div>
100
+ <div className={styles.inputContainer}>
101
+ <div className="omrs-input-group">
102
+ <label htmlFor="referral-type">
103
+ <Trans i18nKey="referral-type">Referral Type</Trans>
104
+ </label>
105
+ <select
106
+ id="referral-type"
107
+ value={referralTypeFilter}
108
+ onChange={(e) => setReferralTypeFilter(e.target.value)}
109
+ className={styles.dropdown}
110
+ >
111
+ <option value="">{t("any", "Any")}</option>
112
+ {referralTypes.map((t) => (
113
+ <option key={t} value={t}>
114
+ {t}
115
+ </option>
116
+ ))}
117
+ </select>
118
+ </div>
119
+ </div>
120
+ <div className={styles.inputContainer}>
121
+ <div className="omrs-input-group">
122
+ <label htmlFor="query-input">
123
+ <Trans i18nKey="filter-by-patient">Filter by patient</Trans>
124
+ </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
+ />
132
+ </div>
133
+ </div>
134
+ <div className={styles.inputContainer}>
135
+ <div className="omrs-input-group">
136
+ <label htmlFor="status">
137
+ <Trans i18nKey="status">Status</Trans>
138
+ </label>
139
+ <select
140
+ id="status"
141
+ value={statusFilter}
142
+ onChange={(e) => setStatusFilter(e.target.value)}
143
+ className={styles.dropdown}
144
+ >
145
+ <option value="">{t("any", "Any")}</option>
146
+ {statuses.map((t) => (
147
+ <option key={t} value={t}>
148
+ {t}
149
+ </option>
150
+ ))}
151
+ </select>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ <div className={styles.tableContainer}>
156
+ <Table referrals={filteredReferrals} />
157
+ </div>
158
+ </div>
159
+ </div>
160
+ );
161
+ }
162
+
163
+ function matchQuery(referral: Referral, query: string): boolean {
164
+ return (
165
+ !query ||
166
+ prepareQuery(query).every((regexp) =>
167
+ regexp.test(removeDiacritics(referral.patient_name))
168
+ ) ||
169
+ new RegExp(query, "i").test(referral.zl_emr_id)
170
+ );
171
+ }
172
+
173
+ function prepareQuery(query: string): RegExp[] {
174
+ return query.split(/\s/).map((token) => {
175
+ const tokenCleaned = removeDiacritics(token);
176
+ return new RegExp("\\b" + tokenCleaned, "i");
177
+ });
178
+ }
179
+
180
+ function removeDiacritics(str: string) {
181
+ // From https://stackoverflow.com/a/37511463/1464495
182
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
183
+ }
184
+
185
+ type ReferralsQueueProps = {};