@openmrs/esm-dispensing-app 1.9.2-pre.883 → 1.9.2-pre.885
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/cache/93c39a835dc53d99-meta.json +1 -0
- package/.turbo/cache/93c39a835dc53d99.tar.zst +0 -0
- package/.turbo/turbo-build.log +7 -7
- package/dist/1282.js +1 -0
- package/dist/1282.js.map +1 -0
- package/dist/4300.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-dispensing-app.js +1 -1
- package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +30 -30
- package/dist/routes.json +1 -1
- package/e2e/commands/encounter-operations.ts +1 -4
- package/e2e/specs/close-prescription.spec.ts +5 -0
- package/e2e/specs/dispense-medication.spec.ts +4 -0
- package/e2e/specs/pause-prescription.spec.ts +5 -0
- package/package.json +1 -1
- package/src/medication-request/medication-request.resource.test.tsx +3 -3
- package/src/medication-request/medication-request.resource.tsx +12 -9
- package/src/prescriptions/patient-search-tab-panel.component.tsx +58 -0
- package/src/prescriptions/patient-search-tab-panel.scss +26 -0
- package/src/prescriptions/prescription-tab-lists.component.tsx +18 -84
- package/src/prescriptions/prescription-tab-panel.component.tsx +45 -148
- package/src/prescriptions/prescriptions-table.component.tsx +164 -0
- package/translations/en.json +3 -0
- package/.turbo/cache/aa05468322fdf99e-meta.json +0 -1
- package/.turbo/cache/aa05468322fdf99e.tar.zst +0 -0
- package/dist/6411.js +0 -1
- package/dist/6411.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var _openmrs_esm_dispensing_app;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,u,p,f,d,c,h,m,v,g,b,y,w,_={35092:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2177),t.e(6741),t.e(67),t.e(6072),t.e(4024),t.e(
|
|
1
|
+
var _openmrs_esm_dispensing_app;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,u,p,f,d,c,h,m,v,g,b,y,w,_={35092:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2177),t.e(6741),t.e(67),t.e(6072),t.e(4024),t.e(1282)]).then((()=>()=>t(61282)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},P={};function j(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,exports:{}};return _[e].call(t.exports,t,t.exports,j),t.exports}j.m=_,j.c=P,j.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return j.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,j.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);j.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,j.d(o,a),o},j.d=(e,r)=>{for(var t in r)j.o(r,t)&&!j.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},j.f={},j.e=e=>Promise.all(Object.keys(j.f).reduce(((r,t)=>(j.f[t](e,r),r)),[])),j.u=e=>e+".js",j.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),j.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-dispensing-app:",j.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var p=l[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+o){i=p;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,j.nc&&i.setAttribute("nonce",j.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),s&&document.head.appendChild(i)}},j.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{j.S={};var e={},r={};j.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];j.o(j.S,t)||(j.S[t]={});var a=j.S[t],i="@openmrs/esm-dispensing-app",s=(e,r,t,n)=>{var o=a[e]=a[e]||{},s=o[r];(!s||!s.loaded&&(!n!=!s.eager?n:i>s.from))&&(o[r]={get:t,from:i,eager:!!n})},l=[];return"default"===t&&(s("@openmrs/esm-framework","8.0.1-pre.3331",(()=>Promise.all([j.e(2177),j.e(7268),j.e(6741),j.e(7935),j.e(6072),j.e(1997),j.e(4024)]).then((()=>()=>j(87935))))),s("@openmrs/esm-patient-common-lib","11.3.1-pre.8931",(()=>Promise.all([j.e(2177),j.e(7268),j.e(6741),j.e(7556),j.e(6072),j.e(1997),j.e(4024),j.e(8651)]).then((()=>()=>j(47556))))),s("dayjs","1.11.13",(()=>j.e(4353).then((()=>()=>j(74353))))),s("react-dom","18.2.0",(()=>Promise.all([j.e(961),j.e(6072)]).then((()=>()=>j(40961))))),s("react-i18next","11.18.6",(()=>Promise.all([j.e(6072),j.e(1033)]).then((()=>()=>j(93414))))),s("react","18.2.0",(()=>j.e(6540).then((()=>()=>j(96540))))),s("rxjs","6.6.7",(()=>j.e(3184).then((()=>()=>j(63184))))),s("swr/immutable","2.3.3",(()=>Promise.all([j.e(2177),j.e(6072),j.e(4225)]).then((()=>()=>j(54225))))),s("swr/infinite","2.3.3",(()=>Promise.all([j.e(2177),j.e(6072),j.e(3041)]).then((()=>()=>j(23041)))))),e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;j.g.importScripts&&(e=j.g.location+"");var r=j.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),j.p=e})(),o=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},a=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],a=(typeof n)[0];if(t>=r.length)return"u"==a;var i=r[t],s=(typeof i)[0];if(a!=s)return"o"==a&&"n"==s||"s"==s||"u"==a;if("o"!=a&&"u"!=a&&n!=i)return n<i;t++}},i=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(s=e[o]))[0]?"-":(n>0?".":"")+(n=2,s);return t}var a=[];for(o=1;o<e.length;o++){var s=e[o];a.push(0===s?"not("+l()+")":1===s?"("+l()+" || "+l()+")":2===s?a.pop()+" "+a.pop():i(s))}return l();function l(){return a.pop().replace(/^\((.+)\)$/,"$1")}},s=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var a=0,i=1,l=!0;;i++,a++){var u,p,f=i<e.length?(typeof e[i])[0]:"";if(a>=r.length||"o"==(p=(typeof(u=r[a]))[0]))return!l||("u"==f?i>t&&!n:""==f!=n);if("u"==p){if(!l||"u"!=f)return!1}else if(l)if(f==p)if(i<=t){if(u!=e[i])return!1}else{if(n?u>e[i]:u<e[i])return!1;u!=e[i]&&(l=!1)}else if("s"!=f&&"n"!=f){if(n||i<=t)return!1;l=!1,i--}else{if(i<=t||p<f!=n)return!1;l=!1}else"s"!=f&&"n"!=f&&(l=!1,i--)}}var d=[],c=d.pop.bind(d);for(a=1;a<e.length;a++){var h=e[a];d.push(1==h?c()|c():2==h?c()&c():h?s(h,r):!c())}return!!c()},l=(e,r)=>e&&j.o(e,r),u=e=>(e.loaded=1,e.get()),p=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),f=(e,r,t)=>{var n=t?p(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&a(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",c=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,o,a){var i=j.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,j.S[r],t,!1,o,a)):e(r,j.S[r],t,n,o,a)})(((e,r,t,n,o,a)=>{if(!l(r,t))return m(e,t,a);var i=f(r,t,n);return s(o,i)||h(d(r,t,i,o)),u(r[t][i])})),g={},b={16072:()=>v("default","react",!1,[1,18],(()=>j.e(6540).then((()=>()=>j(96540))))),44209:()=>v("default","swr/immutable",!1,[1,2],(()=>j.e(6606).then((()=>()=>j(54225))))),53083:()=>v("default","rxjs",!1,[1,6],(()=>j.e(3184).then((()=>()=>j(63184))))),56339:()=>v("default","swr/infinite",!1,[1,2],(()=>j.e(5422).then((()=>()=>j(23041))))),25987:()=>v("default","@openmrs/esm-framework",!1,[0],(()=>Promise.all([j.e(7268),j.e(7935),j.e(1997)]).then((()=>()=>j(87935))))),53941:()=>v("default","react-i18next",!1,[1,11],(()=>j.e(3414).then((()=>()=>j(93414))))),70231:()=>v("default","dayjs",!1,[1,1],(()=>j.e(4353).then((()=>()=>j(74353))))),92646:()=>v("default","react-dom",!1,[1,18],(()=>j.e(961).then((()=>()=>j(40961))))),51354:()=>v("default","@openmrs/esm-patient-common-lib",!1,[0],(()=>Promise.all([j.e(7268),j.e(7556),j.e(1997)]).then((()=>()=>j(47556)))))},y={1354:[51354],1997:[44209,53083,56339],4024:[25987,53941,70231,92646],6072:[16072]},w={},j.f.consumes=(e,r)=>{j.o(y,e)&&y[e].forEach((e=>{if(j.o(g,e))return r.push(g[e]);if(!w[e]){var t=r=>{g[e]=0,j.m[e]=t=>{delete j.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete g[e],j.m[e]=t=>{throw delete j.c[e],r}};try{var o=b[e]();o.then?r.push(g[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={9986:0};j.f.j=(r,t)=>{var n=j.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(1354|1997|4024|6072)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=j.p+j.u(r),i=new Error;j.l(a,(t=>{if(j.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,s]=t,l=0;if(a.some((r=>0!==e[r]))){for(n in i)j.o(i,n)&&(j.m[n]=i[n]);s&&s(j)}for(r&&r(t);l<a.length;l++)o=a[l],j.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_dispensing_app=globalThis.webpackChunk_openmrs_esm_dispensing_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var S=j(35092);_openmrs_esm_dispensing_app=S})();
|
|
@@ -258,6 +258,29 @@
|
|
|
258
258
|
"hash": "92b4dc3553190d24",
|
|
259
259
|
"childrenByOrder": {}
|
|
260
260
|
},
|
|
261
|
+
{
|
|
262
|
+
"rendered": true,
|
|
263
|
+
"initial": false,
|
|
264
|
+
"entry": false,
|
|
265
|
+
"recorded": false,
|
|
266
|
+
"size": 355516,
|
|
267
|
+
"sizes": {
|
|
268
|
+
"javascript": 355516
|
|
269
|
+
},
|
|
270
|
+
"names": [],
|
|
271
|
+
"idHints": [],
|
|
272
|
+
"runtime": [
|
|
273
|
+
"@openmrs/esm-dispensing-app"
|
|
274
|
+
],
|
|
275
|
+
"files": [
|
|
276
|
+
"1282.js"
|
|
277
|
+
],
|
|
278
|
+
"auxiliaryFiles": [
|
|
279
|
+
"1282.js.map"
|
|
280
|
+
],
|
|
281
|
+
"hash": "3e8aac5646c887a0",
|
|
282
|
+
"childrenByOrder": {}
|
|
283
|
+
},
|
|
261
284
|
{
|
|
262
285
|
"rendered": false,
|
|
263
286
|
"initial": false,
|
|
@@ -632,9 +655,9 @@
|
|
|
632
655
|
"initial": false,
|
|
633
656
|
"entry": false,
|
|
634
657
|
"recorded": false,
|
|
635
|
-
"size":
|
|
658
|
+
"size": 4582,
|
|
636
659
|
"sizes": {
|
|
637
|
-
"javascript":
|
|
660
|
+
"javascript": 4582
|
|
638
661
|
},
|
|
639
662
|
"names": [],
|
|
640
663
|
"idHints": [],
|
|
@@ -646,7 +669,7 @@
|
|
|
646
669
|
"4300.js"
|
|
647
670
|
],
|
|
648
671
|
"auxiliaryFiles": [],
|
|
649
|
-
"hash": "
|
|
672
|
+
"hash": "995802a5bc3040d8",
|
|
650
673
|
"childrenByOrder": {}
|
|
651
674
|
},
|
|
652
675
|
{
|
|
@@ -940,29 +963,6 @@
|
|
|
940
963
|
"hash": "3911c2f5b7141185",
|
|
941
964
|
"childrenByOrder": {}
|
|
942
965
|
},
|
|
943
|
-
{
|
|
944
|
-
"rendered": true,
|
|
945
|
-
"initial": false,
|
|
946
|
-
"entry": false,
|
|
947
|
-
"recorded": false,
|
|
948
|
-
"size": 341568,
|
|
949
|
-
"sizes": {
|
|
950
|
-
"javascript": 341568
|
|
951
|
-
},
|
|
952
|
-
"names": [],
|
|
953
|
-
"idHints": [],
|
|
954
|
-
"runtime": [
|
|
955
|
-
"@openmrs/esm-dispensing-app"
|
|
956
|
-
],
|
|
957
|
-
"files": [
|
|
958
|
-
"6411.js"
|
|
959
|
-
],
|
|
960
|
-
"auxiliaryFiles": [
|
|
961
|
-
"6411.js.map"
|
|
962
|
-
],
|
|
963
|
-
"hash": "f2e8f426d2fce4fd",
|
|
964
|
-
"childrenByOrder": {}
|
|
965
|
-
},
|
|
966
966
|
{
|
|
967
967
|
"rendered": true,
|
|
968
968
|
"initial": false,
|
|
@@ -1416,10 +1416,10 @@
|
|
|
1416
1416
|
"initial": true,
|
|
1417
1417
|
"entry": true,
|
|
1418
1418
|
"recorded": false,
|
|
1419
|
-
"size":
|
|
1419
|
+
"size": 3408134,
|
|
1420
1420
|
"sizes": {
|
|
1421
1421
|
"consume-shared": 210,
|
|
1422
|
-
"javascript":
|
|
1422
|
+
"javascript": 3385239,
|
|
1423
1423
|
"share-init": 378,
|
|
1424
1424
|
"runtime": 22307
|
|
1425
1425
|
},
|
|
@@ -1436,7 +1436,7 @@
|
|
|
1436
1436
|
"auxiliaryFiles": [
|
|
1437
1437
|
"main.js.map"
|
|
1438
1438
|
],
|
|
1439
|
-
"hash": "
|
|
1439
|
+
"hash": "086eb5a4c96bc43e",
|
|
1440
1440
|
"childrenByOrder": {}
|
|
1441
1441
|
},
|
|
1442
1442
|
{
|
|
@@ -1617,7 +1617,7 @@
|
|
|
1617
1617
|
"auxiliaryFiles": [
|
|
1618
1618
|
"openmrs-esm-dispensing-app.js.map"
|
|
1619
1619
|
],
|
|
1620
|
-
"hash": "
|
|
1620
|
+
"hash": "0868a72fca4b1c80",
|
|
1621
1621
|
"childrenByOrder": {}
|
|
1622
1622
|
}
|
|
1623
1623
|
]
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.2.0"},"pages":[{"component":"dispensing","route":"dispensing","online":true,"offline":true}],"extensions":[{"name":"dispensing-link","slot":"app-menu-slot","component":"dispensingLink","online":true,"offline":true},{"name":"patient-diagnoses","component":"patientDiagnoses","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"patient-conditions","component":"patientConditions","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"dispensing-dashboard","slot":"dispensing-dashboard-slot","component":"dispensingDashboard","online":true,"offline":true},{"name":"dispensing-dashboard-link","component":"dispensingDashboardLink","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Dispensing"}},{"name":"dispense-action-button","slot":"prescription-action-button-slot","component":"dispenseActionButton"},{"name":"pause-action-button","slot":"prescription-action-button-slot","component":"pauseActionButton"},{"name":"close-action-button","slot":"prescription-action-button-slot","component":"closeActionButton"}],"workspaces":[{"name":"close-dispense-workspace","component":"closeDispenseWorkspace","type":"dispense","title":"Close prescription"},{"name":"pause-dispense-workspace","component":"pauseDispenseWorkspace","type":"dispense","title":"Pause prescription"},{"name":"dispense-workspace","component":"dispenseWorkspace","type":"dispense","title":"Dispense prescription","width":"wider"}],"modals":[{"name":"prescription-print-preview-modal","component":"printPrescriptionPreviewModal"},{"name":"delete-confirm-modal","component":"deleteConfirmModal"}],"version":"1.9.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.2.0"},"pages":[{"component":"dispensing","route":"dispensing","online":true,"offline":true}],"extensions":[{"name":"dispensing-link","slot":"app-menu-slot","component":"dispensingLink","online":true,"offline":true},{"name":"patient-diagnoses","component":"patientDiagnoses","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"patient-conditions","component":"patientConditions","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"dispensing-dashboard","slot":"dispensing-dashboard-slot","component":"dispensingDashboard","online":true,"offline":true},{"name":"dispensing-dashboard-link","component":"dispensingDashboardLink","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Dispensing"}},{"name":"dispense-action-button","slot":"prescription-action-button-slot","component":"dispenseActionButton"},{"name":"pause-action-button","slot":"prescription-action-button-slot","component":"pauseActionButton"},{"name":"close-action-button","slot":"prescription-action-button-slot","component":"closeActionButton"}],"workspaces":[{"name":"close-dispense-workspace","component":"closeDispenseWorkspace","type":"dispense","title":"Close prescription"},{"name":"pause-dispense-workspace","component":"pauseDispenseWorkspace","type":"dispense","title":"Pause prescription"},{"name":"dispense-workspace","component":"dispenseWorkspace","type":"dispense","title":"Dispense prescription","width":"wider"}],"modals":[{"name":"prescription-print-preview-modal","component":"printPrescriptionPreviewModal"},{"name":"delete-confirm-modal","component":"deleteConfirmModal"}],"version":"1.9.2-pre.885"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { type APIRequestContext, expect } from '@playwright/test';
|
|
3
3
|
import { type Encounter } from './types';
|
|
4
4
|
import { type Visit } from '@openmrs/esm-framework';
|
|
5
|
-
import dayjs from 'dayjs';
|
|
6
5
|
|
|
7
6
|
export interface Observation {
|
|
8
7
|
uuid: string;
|
|
@@ -36,9 +35,7 @@ export const createEncounter = async (
|
|
|
36
35
|
providerId: string,
|
|
37
36
|
visit: Visit,
|
|
38
37
|
): Promise<Encounter> => {
|
|
39
|
-
const
|
|
40
|
-
const now = dayjs().subtract(1, 'second');
|
|
41
|
-
const encounterDatetime = encounterAfterVisit.isBefore(now) ? encounterAfterVisit.format() : now.format();
|
|
38
|
+
const encounterDatetime = visit.startDatetime;
|
|
42
39
|
const encounterRes = await api.post('encounter', {
|
|
43
40
|
data: {
|
|
44
41
|
encounterDatetime,
|
|
@@ -32,6 +32,11 @@ test('Close prescription', async ({ page, patient }) => {
|
|
|
32
32
|
await dispensingPage.goTo();
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
await test.step('And I click on the Active prescriptions tab', async () => {
|
|
36
|
+
await page.getByRole('tab', { name: 'Active prescriptions' }).click();
|
|
37
|
+
await expect(page.getByRole('tab', { name: 'Active prescriptions' })).toHaveAttribute('aria-selected', 'true');
|
|
38
|
+
});
|
|
39
|
+
|
|
35
40
|
await test.step('And I expand a table row in the prescriptions table corresponding to an active prescription', async () => {
|
|
36
41
|
const rowText = new RegExp(`Expand current row`);
|
|
37
42
|
await page.getByRole('row', { name: rowText }).getByLabel('Expand current row').nth(0).click();
|
|
@@ -33,6 +33,10 @@ test('Dispense prescription', async ({ page, patient }) => {
|
|
|
33
33
|
await expect(page).toHaveURL(process.env.E2E_BASE_URL + `/spa/dispensing`);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
await test.step('And I click on the Active prescriptions tab', async () => {
|
|
37
|
+
await page.getByRole('tab', { name: 'Active prescriptions' }).click();
|
|
38
|
+
});
|
|
39
|
+
|
|
36
40
|
await test.step('And I expand a table row in the Prescriptions table corresponding to an active prescription', async () => {
|
|
37
41
|
const rowText = new RegExp(`Expand current row`);
|
|
38
42
|
await page.getByRole('row', { name: rowText }).getByLabel('Expand current row').nth(0).click();
|
|
@@ -33,6 +33,11 @@ test('Pause prescription', async ({ page, patient }) => {
|
|
|
33
33
|
await dispensingPage.goTo();
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
await test.step('And I click on the Active prescriptions tab', async () => {
|
|
37
|
+
await page.getByRole('tab', { name: 'Active prescriptions' }).click();
|
|
38
|
+
await expect(page.getByRole('tab', { name: 'Active prescriptions' })).toHaveAttribute('aria-selected', 'true');
|
|
39
|
+
});
|
|
40
|
+
|
|
36
41
|
await test.step('And I expand a table row in the prescriptions table corresponding to an active prescription', async () => {
|
|
37
42
|
const rowText = new RegExp(`Expand current row`);
|
|
38
43
|
await page.getByRole('row', { name: rowText }).getByLabel('Expand current row').nth(0).click();
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ describe('Medication Request Resource Test', () => {
|
|
|
18
18
|
test('usePrescriptionsTable should call active endpoint and proper date based on expiration period if status parameter is active', () => {
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
useSWR.mockImplementation(() => ({ data: { data: 'mockedReturnData' } }));
|
|
21
|
-
usePrescriptionsTable(5, 5, 'bob', null, 'ACTIVE', 10, 10000);
|
|
21
|
+
usePrescriptionsTable(true, 5, 5, 'bob', null, 'ACTIVE', 10, 10000);
|
|
22
22
|
expect(useSWR).toHaveBeenCalledWith(
|
|
23
23
|
`/ws/fhir2/R4/Encounter?_query=encountersWithMedicationRequests&_getpagesoffset=5&_count=5&date=ge${dayjs()
|
|
24
24
|
.startOf('day')
|
|
@@ -32,7 +32,7 @@ describe('Medication Request Resource Test', () => {
|
|
|
32
32
|
test('usePrescriptionsTable should call all endpoint if status parameter is not active', () => {
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
useSWR.mockImplementation(() => ({ data: { data: 'mockedReturnData' } }));
|
|
35
|
-
usePrescriptionsTable(5, 5, 'bob', null, null, 10, 10000);
|
|
35
|
+
usePrescriptionsTable(true, 5, 5, 'bob', null, null, 10, 10000);
|
|
36
36
|
expect(useSWR).toHaveBeenCalledWith(
|
|
37
37
|
`/ws/fhir2/R4/Encounter?_query=encountersWithMedicationRequests&_getpagesoffset=5&_count=5&patientSearchTerm=bob`,
|
|
38
38
|
openmrsFetch,
|
|
@@ -587,7 +587,7 @@ describe('Medication Request Resource Test', () => {
|
|
|
587
587
|
|
|
588
588
|
// @ts-ignore
|
|
589
589
|
useSWR.mockImplementation(() => ({ data: { data: queryResultsBundle } }));
|
|
590
|
-
const { prescriptionsTableRows, totalOrders } = usePrescriptionsTable(2, 0, 'bob', 'ACTIVE', null, 90, 10000);
|
|
590
|
+
const { prescriptionsTableRows, totalOrders } = usePrescriptionsTable(true, 2, 0, 'bob', 'ACTIVE', null, 90, 10000);
|
|
591
591
|
expect(totalOrders).toBe(26);
|
|
592
592
|
expect(prescriptionsTableRows.length).toBe(2);
|
|
593
593
|
expect(prescriptionsTableRows[0].id).toBe('7aee7123-9e50-4f72-a636-895d77a63e98');
|
|
@@ -25,6 +25,7 @@ import dayjs from 'dayjs';
|
|
|
25
25
|
import { JSON_MERGE_PATH_MIME_TYPE, OPENMRS_FHIR_EXT_REQUEST_FULFILLER_STATUS } from '../constants';
|
|
26
26
|
|
|
27
27
|
export function usePrescriptionsTable(
|
|
28
|
+
loadData: boolean,
|
|
28
29
|
pageSize: number = 10,
|
|
29
30
|
pageOffset: number = 0,
|
|
30
31
|
patientSearchTerm: string = '',
|
|
@@ -34,15 +35,17 @@ export function usePrescriptionsTable(
|
|
|
34
35
|
refreshInterval: number,
|
|
35
36
|
) {
|
|
36
37
|
const { data, error } = useSWR<{ data: EncounterResponse }, Error>(
|
|
37
|
-
|
|
38
|
-
?
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
loadData
|
|
39
|
+
? status === 'ACTIVE'
|
|
40
|
+
? getPrescriptionTableActiveMedicationRequestsEndpoint(
|
|
41
|
+
pageOffset,
|
|
42
|
+
pageSize,
|
|
43
|
+
dayjs(new Date()).startOf('day').subtract(medicationRequestExpirationPeriodInDays, 'day').toISOString(),
|
|
44
|
+
patientSearchTerm,
|
|
45
|
+
location,
|
|
46
|
+
)
|
|
47
|
+
: getPrescriptionTableAllMedicationRequestsEndpoint(pageOffset, pageSize, patientSearchTerm, location)
|
|
48
|
+
: null,
|
|
46
49
|
openmrsFetch,
|
|
47
50
|
{ refreshInterval: refreshInterval },
|
|
48
51
|
);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button, Search, TabPanel } from '@carbon/react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { PatientSearchPictogram } from '@openmrs/esm-framework';
|
|
5
|
+
import PrescriptionsTable from './prescriptions-table.component';
|
|
6
|
+
import styles from './patient-search-tab-panel.scss';
|
|
7
|
+
|
|
8
|
+
const PatientSearchTabPanel: React.FC = () => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
11
|
+
const [submittedSearchTerm, setSubmittedSearchTerm] = useState('');
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<TabPanel>
|
|
15
|
+
<div className={styles.searchTabPanel}>
|
|
16
|
+
<form
|
|
17
|
+
className={styles.searchBar}
|
|
18
|
+
onSubmit={(e) => {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
setSubmittedSearchTerm(searchTerm);
|
|
21
|
+
}}>
|
|
22
|
+
<Search
|
|
23
|
+
closeButtonLabelText={t('clearSearchInput', 'Clear search input')}
|
|
24
|
+
defaultValue={searchTerm}
|
|
25
|
+
placeholder={t('searchForPatient', 'Search for a patient by name or identifier number')}
|
|
26
|
+
labelText={t('searchForPatient', 'Search for a patient by name or identifier number')}
|
|
27
|
+
onChange={(e) => {
|
|
28
|
+
setSearchTerm(e.target.value);
|
|
29
|
+
}}
|
|
30
|
+
onClear={() => setSubmittedSearchTerm('')}
|
|
31
|
+
size="lg"
|
|
32
|
+
/>
|
|
33
|
+
<Button kind="secondary" type="submit">
|
|
34
|
+
{t('search', 'Search')}
|
|
35
|
+
</Button>
|
|
36
|
+
</form>
|
|
37
|
+
{submittedSearchTerm ? (
|
|
38
|
+
<PrescriptionsTable
|
|
39
|
+
loadData={true}
|
|
40
|
+
status={'ACTIVE'}
|
|
41
|
+
debouncedSearchTerm={submittedSearchTerm}
|
|
42
|
+
location={''}
|
|
43
|
+
/>
|
|
44
|
+
) : (
|
|
45
|
+
<div className={styles.searchForPatientPlaceholder}>
|
|
46
|
+
<div>
|
|
47
|
+
<PatientSearchPictogram />
|
|
48
|
+
<h5>{t('searchForPatientHeader', 'Search for a patient')}</h5>
|
|
49
|
+
<div>{t('searchForPatient', 'Search for a patient by name or identifier number')}</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
</TabPanel>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default PatientSearchTabPanel;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '~@openmrs/esm-styleguide/src/vars' as *;
|
|
3
|
+
|
|
4
|
+
.searchTabPanel {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
margin: layout.$spacing-05 layout.$spacing-04;
|
|
8
|
+
gap: layout.$spacing-05;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.searchForPatientPlaceholder {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
text-align: center;
|
|
16
|
+
min-height: 400px;
|
|
17
|
+
flex: 1;
|
|
18
|
+
border: solid 1px $grey-2;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.searchBar {
|
|
22
|
+
input {
|
|
23
|
+
background-color: $ui-02;
|
|
24
|
+
}
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
@@ -1,45 +1,14 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Tab, Tabs, TabList, TabPanels } from '@carbon/react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
5
|
-
import { useLocationForFiltering } from '../location/location.resource';
|
|
6
|
-
import { type SimpleLocation } from '../types';
|
|
7
|
-
import { type PharmacyConfig } from '../config-schema';
|
|
8
4
|
import PrescriptionTabPanel from './prescription-tab-panel.component';
|
|
9
5
|
import styles from './prescriptions.scss';
|
|
6
|
+
import PatientSearchTabPanel from './patient-search-tab-panel.component';
|
|
10
7
|
|
|
11
8
|
const PrescriptionTabLists: React.FC = () => {
|
|
12
9
|
const { t } = useTranslation();
|
|
13
|
-
const config = useConfig<PharmacyConfig>();
|
|
14
|
-
const { filterLocations, isLoading: isFilterLocationsLoading } = useLocationForFiltering(config);
|
|
15
|
-
const [searchTermUserInput, setSearchTermUserInput] = useState(''); // we have a separate "searchTermUserInput" and "searchTerm" in order to debounce
|
|
16
|
-
const [searchTerm, setSearchTerm] = useState('');
|
|
17
|
-
const [location, setLocation] = useState('');
|
|
18
10
|
const [selectedTab, setSelectedTab] = useState(0);
|
|
19
11
|
|
|
20
|
-
const tabs = [
|
|
21
|
-
{
|
|
22
|
-
key: 'activePrescriptions',
|
|
23
|
-
header: t('activePrescriptions', 'Active Prescriptions'),
|
|
24
|
-
status: 'ACTIVE',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
key: 'allPrescriptions',
|
|
28
|
-
header: t('allPrescriptions', 'All Prescriptions'),
|
|
29
|
-
status: '',
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
// debounce: delay the search term update so that a search isn't triggered on every single keystroke
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const debounceFn = setTimeout(() => {
|
|
36
|
-
setSearchTerm(searchTermUserInput);
|
|
37
|
-
}, 500);
|
|
38
|
-
|
|
39
|
-
return () => clearTimeout(debounceFn);
|
|
40
|
-
}, [searchTermUserInput]);
|
|
41
|
-
|
|
42
|
-
// we use this to only render the tab panel that is currently selected, see O3-2777
|
|
43
12
|
const handleTabChange = (event) => {
|
|
44
13
|
setSelectedTab(event.selectedIndex);
|
|
45
14
|
};
|
|
@@ -49,58 +18,23 @@ const PrescriptionTabLists: React.FC = () => {
|
|
|
49
18
|
<section className={styles.prescriptionTabsContainer}>
|
|
50
19
|
<Tabs onChange={handleTabChange}>
|
|
51
20
|
<TabList aria-label={t('tabList', 'Tab List')} contained className={styles.tabsContainer}>
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
21
|
+
<Tab title={t('search', 'Search')} id={'tab-search'} className={styles.tab}>
|
|
22
|
+
{t('search', 'Search')}
|
|
23
|
+
</Tab>
|
|
24
|
+
<Tab
|
|
25
|
+
title={t('activePrescriptions', 'Active Prescriptions')}
|
|
26
|
+
id={'tab-active-prescription'}
|
|
27
|
+
className={styles.tab}>
|
|
28
|
+
{t('activePrescriptions', 'Active Prescriptions')}
|
|
29
|
+
</Tab>
|
|
30
|
+
<Tab title={t('allPrescriptions', 'All Prescriptions')} id={'tab-all-prescription'} className={styles.tab}>
|
|
31
|
+
{t('allPrescriptions', 'All Prescriptions')}
|
|
32
|
+
</Tab>
|
|
59
33
|
</TabList>
|
|
60
|
-
<div className={styles.searchContainer}>
|
|
61
|
-
{/* <Button
|
|
62
|
-
kind="primary"
|
|
63
|
-
renderIcon={(props) => <Add size={24} />}
|
|
64
|
-
className={styles.addPrescriptionBtn}
|
|
65
|
-
size="sm"
|
|
66
|
-
>
|
|
67
|
-
{t("fillPrescription", "Fill prescription")}
|
|
68
|
-
</Button>*/}
|
|
69
|
-
<Search
|
|
70
|
-
closeButtonLabelText={t('clearSearchInput', 'Clear search input')}
|
|
71
|
-
defaultValue={searchTermUserInput}
|
|
72
|
-
placeholder={t('searchByPatientIdOrName', 'Search by patient ID or name')}
|
|
73
|
-
labelText={t('searchByPatientIdOrName', 'Search by patient ID or name')}
|
|
74
|
-
onChange={(e) => {
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
setSearchTermUserInput(e.target.value);
|
|
77
|
-
}}
|
|
78
|
-
size="md"
|
|
79
|
-
className={styles.patientSearch}
|
|
80
|
-
/>
|
|
81
|
-
{config.locationBehavior?.locationFilter?.enabled &&
|
|
82
|
-
!isFilterLocationsLoading &&
|
|
83
|
-
filterLocations?.length > 1 && (
|
|
84
|
-
<ComboBox
|
|
85
|
-
id="locationFilter"
|
|
86
|
-
placeholder={t('filterByLocation', 'Filter by location')}
|
|
87
|
-
items={isFilterLocationsLoading ? [] : filterLocations}
|
|
88
|
-
itemToString={(item: SimpleLocation) => item?.name}
|
|
89
|
-
onChange={({ selectedItem }) => {
|
|
90
|
-
setLocation(selectedItem?.id);
|
|
91
|
-
}}
|
|
92
|
-
className={styles.locationFilter}
|
|
93
|
-
/>
|
|
94
|
-
)}
|
|
95
|
-
</div>
|
|
96
34
|
<TabPanels>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
) : (
|
|
101
|
-
<></>
|
|
102
|
-
);
|
|
103
|
-
})}
|
|
35
|
+
<PatientSearchTabPanel />
|
|
36
|
+
<PrescriptionTabPanel isTabActive={selectedTab === 1} status={'ACTIVE'} />
|
|
37
|
+
<PrescriptionTabPanel isTabActive={selectedTab === 2} status={''} />
|
|
104
38
|
</TabPanels>
|
|
105
39
|
</Tabs>
|
|
106
40
|
</section>
|