@openmrs/esm-patient-medications-app 11.3.1-pre.9294 → 11.3.1-pre.9304

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.
@@ -1 +1 @@
1
- var _openmrs_esm_patient_medications_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,_={94731:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(3338),t.e(8689),t.e(1343),t.e(5434),t.e(8716),t.e(8437)]).then((()=>()=>t(78437)))},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-patient-medications-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-patient-medications-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.3485",(()=>Promise.all([j.e(1268),j.e(3338),j.e(5670),j.e(1343),j.e(5434),j.e(2941),j.e(8716)]).then((()=>()=>j(55670))))),s("@openmrs/esm-patient-common-lib","11.3.1-pre.9294",(()=>Promise.all([j.e(1268),j.e(3338),j.e(1343),j.e(5434),j.e(2941),j.e(8716),j.e(8803)]).then((()=>()=>j(18803))))),s("dayjs","1.11.13",(()=>j.e(3464).then((()=>()=>j(23464))))),s("react-i18next","16.0.0",(()=>Promise.all([j.e(6336),j.e(1343)]).then((()=>()=>j(16336))))),s("react-router-dom","6.16.0",(()=>Promise.all([j.e(2913),j.e(1343)]).then((()=>()=>j(52913))))),s("react","18.3.1",(()=>j.e(4041).then((()=>()=>j(14041))))),s("rxjs","6.6.7",(()=>j.e(2457).then((()=>()=>j(82457))))),s("swr/_internal","2.2.5",(()=>Promise.all([j.e(2372),j.e(1343)]).then((()=>()=>j(42372))))),s("swr/immutable","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(7495)]).then((()=>()=>j(29876))))),s("swr/infinite","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(89)]).then((()=>()=>j(52470)))))),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={1343:()=>v("default","react",!1,[1,18],(()=>j.e(4041).then((()=>()=>j(14041))))),55434:()=>v("default","swr/_internal",!1,[1,2],(()=>j.e(2372).then((()=>()=>j(42372))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>j.e(2913).then((()=>()=>j(52913))))),24818:()=>v("default","rxjs",!1,[1,6],(()=>j.e(2457).then((()=>()=>j(82457))))),98394:()=>v("default","swr/infinite",!1,[1,2],(()=>j.e(2470).then((()=>()=>j(52470))))),46372:()=>v("default","dayjs",!1,[1,1],(()=>j.e(3464).then((()=>()=>j(23464))))),54440:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([j.e(1268),j.e(5670),j.e(2941)]).then((()=>()=>j(55670))))),72339:()=>v("default","react-i18next",!1,[1,16],(()=>j.e(6336).then((()=>()=>j(16336))))),88010:()=>v("default","swr/immutable",!1,[1,2],(()=>j.e(9876).then((()=>()=>j(29876))))),36274:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,11],(()=>Promise.all([j.e(1268),j.e(2941),j.e(8803)]).then((()=>()=>j(18803)))))},y={1343:[1343],2941:[8877,24818,98394],5434:[55434],8437:[36274],8716:[46372,54440,72339,88010]},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={282: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(/^(1343|2941|5434|8716)$/.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_patient_medications_app=globalThis.webpackChunk_openmrs_esm_patient_medications_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var S=j(94731);_openmrs_esm_patient_medications_app=S})();
1
+ var _openmrs_esm_patient_medications_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,_={94731:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(3338),t.e(8689),t.e(1343),t.e(5434),t.e(8716),t.e(8437)]).then((()=>()=>t(78437)))},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-patient-medications-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-patient-medications-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.3485",(()=>Promise.all([j.e(1268),j.e(3338),j.e(5670),j.e(1343),j.e(5434),j.e(2941),j.e(8716)]).then((()=>()=>j(55670))))),s("@openmrs/esm-patient-common-lib","11.3.1-pre.9304",(()=>Promise.all([j.e(1268),j.e(3338),j.e(1343),j.e(5434),j.e(2941),j.e(8716),j.e(8803)]).then((()=>()=>j(18803))))),s("dayjs","1.11.13",(()=>j.e(3464).then((()=>()=>j(23464))))),s("react-i18next","16.0.0",(()=>Promise.all([j.e(6336),j.e(1343)]).then((()=>()=>j(16336))))),s("react-router-dom","6.16.0",(()=>Promise.all([j.e(2913),j.e(1343)]).then((()=>()=>j(52913))))),s("react","18.3.1",(()=>j.e(4041).then((()=>()=>j(14041))))),s("rxjs","6.6.7",(()=>j.e(2457).then((()=>()=>j(82457))))),s("swr/_internal","2.2.5",(()=>Promise.all([j.e(2372),j.e(1343)]).then((()=>()=>j(42372))))),s("swr/immutable","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(7495)]).then((()=>()=>j(29876))))),s("swr/infinite","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(89)]).then((()=>()=>j(52470)))))),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={1343:()=>v("default","react",!1,[1,18],(()=>j.e(4041).then((()=>()=>j(14041))))),55434:()=>v("default","swr/_internal",!1,[1,2],(()=>j.e(2372).then((()=>()=>j(42372))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>j.e(2913).then((()=>()=>j(52913))))),24818:()=>v("default","rxjs",!1,[1,6],(()=>j.e(2457).then((()=>()=>j(82457))))),98394:()=>v("default","swr/infinite",!1,[1,2],(()=>j.e(2470).then((()=>()=>j(52470))))),46372:()=>v("default","dayjs",!1,[1,1],(()=>j.e(3464).then((()=>()=>j(23464))))),54440:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([j.e(1268),j.e(5670),j.e(2941)]).then((()=>()=>j(55670))))),72339:()=>v("default","react-i18next",!1,[1,16],(()=>j.e(6336).then((()=>()=>j(16336))))),88010:()=>v("default","swr/immutable",!1,[1,2],(()=>j.e(9876).then((()=>()=>j(29876))))),36274:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,11],(()=>Promise.all([j.e(1268),j.e(2941),j.e(8803)]).then((()=>()=>j(18803)))))},y={1343:[1343],2941:[8877,24818,98394],5434:[55434],8437:[36274],8716:[46372,54440,72339,88010]},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={282: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(/^(1343|2941|5434|8716)$/.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_patient_medications_app=globalThis.webpackChunk_openmrs_esm_patient_medications_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var S=j(94731);_openmrs_esm_patient_medications_app=S})();
@@ -48,7 +48,7 @@
48
48
  "auxiliaryFiles": [
49
49
  "openmrs-esm-patient-medications-app.js.map"
50
50
  ],
51
- "hash": "d4c552eddb5d870b",
51
+ "hash": "ac4f5cdc9763e3db",
52
52
  "childrenByOrder": {}
53
53
  },
54
54
  {
@@ -144,9 +144,9 @@
144
144
  "initial": false,
145
145
  "entry": false,
146
146
  "recorded": false,
147
- "size": 9718,
147
+ "size": 9752,
148
148
  "sizes": {
149
- "javascript": 9718
149
+ "javascript": 9752
150
150
  },
151
151
  "names": [],
152
152
  "idHints": [],
@@ -160,7 +160,7 @@
160
160
  "auxiliaryFiles": [
161
161
  "1022.js.map"
162
162
  ],
163
- "hash": "a7290b3aaf205135",
163
+ "hash": "aa96ac2bb0295614",
164
164
  "childrenByOrder": {}
165
165
  },
166
166
  {
@@ -720,7 +720,7 @@
720
720
  "auxiliaryFiles": [
721
721
  "4953.js.map"
722
722
  ],
723
- "hash": "ec42b9c802397cd5",
723
+ "hash": "94101529be332d0d",
724
724
  "childrenByOrder": {}
725
725
  },
726
726
  {
@@ -1050,9 +1050,9 @@
1050
1050
  "initial": false,
1051
1051
  "entry": false,
1052
1052
  "recorded": false,
1053
- "size": 122412,
1053
+ "size": 122582,
1054
1054
  "sizes": {
1055
- "javascript": 122412
1055
+ "javascript": 122582
1056
1056
  },
1057
1057
  "names": [],
1058
1058
  "idHints": [],
@@ -1066,7 +1066,7 @@
1066
1066
  "auxiliaryFiles": [
1067
1067
  "7151.js.map"
1068
1068
  ],
1069
- "hash": "73a745d0eeedc94e",
1069
+ "hash": "f34bc1148cf7f4b7",
1070
1070
  "childrenByOrder": {}
1071
1071
  },
1072
1072
  {
@@ -1186,10 +1186,10 @@
1186
1186
  "initial": false,
1187
1187
  "entry": false,
1188
1188
  "recorded": false,
1189
- "size": 152138,
1189
+ "size": 152195,
1190
1190
  "sizes": {
1191
1191
  "consume-shared": 42,
1192
- "javascript": 152096
1192
+ "javascript": 152153
1193
1193
  },
1194
1194
  "names": [],
1195
1195
  "idHints": [],
@@ -1202,7 +1202,7 @@
1202
1202
  "auxiliaryFiles": [
1203
1203
  "8437.js.map"
1204
1204
  ],
1205
- "hash": "deefd6bb0db12e50",
1205
+ "hash": "4ed24bc6f0820d0e",
1206
1206
  "childrenByOrder": {}
1207
1207
  },
1208
1208
  {
@@ -1279,10 +1279,10 @@
1279
1279
  "initial": true,
1280
1280
  "entry": true,
1281
1281
  "recorded": false,
1282
- "size": 3124913,
1282
+ "size": 3124970,
1283
1283
  "sizes": {
1284
1284
  "consume-shared": 294,
1285
- "javascript": 3101517,
1285
+ "javascript": 3101574,
1286
1286
  "share-init": 420,
1287
1287
  "runtime": 22682
1288
1288
  },
@@ -1299,7 +1299,7 @@
1299
1299
  "auxiliaryFiles": [
1300
1300
  "main.js.map"
1301
1301
  ],
1302
- "hash": "db6e3179cd808aff",
1302
+ "hash": "ba06a9708c03e9c8",
1303
1303
  "childrenByOrder": {}
1304
1304
  },
1305
1305
  {
@@ -1308,9 +1308,9 @@
1308
1308
  "entry": false,
1309
1309
  "recorded": false,
1310
1310
  "reason": "reused as split chunk (cache group: default)",
1311
- "size": 249838,
1311
+ "size": 252018,
1312
1312
  "sizes": {
1313
- "javascript": 249838
1313
+ "javascript": 252018
1314
1314
  },
1315
1315
  "names": [],
1316
1316
  "idHints": [],
@@ -1324,7 +1324,7 @@
1324
1324
  "auxiliaryFiles": [
1325
1325
  "8803.js.map"
1326
1326
  ],
1327
- "hash": "770748b6212ce46b",
1327
+ "hash": "d9d802254b83cb57",
1328
1328
  "childrenByOrder": {}
1329
1329
  },
1330
1330
  {
@@ -1332,9 +1332,9 @@
1332
1332
  "initial": false,
1333
1333
  "entry": false,
1334
1334
  "recorded": false,
1335
- "size": 110770,
1335
+ "size": 110900,
1336
1336
  "sizes": {
1337
- "javascript": 110770
1337
+ "javascript": 110900
1338
1338
  },
1339
1339
  "names": [],
1340
1340
  "idHints": [],
@@ -1348,7 +1348,7 @@
1348
1348
  "auxiliaryFiles": [
1349
1349
  "8812.js.map"
1350
1350
  ],
1351
- "hash": "f21b907af93cde70",
1351
+ "hash": "7a82f09ccf3ecd2d",
1352
1352
  "childrenByOrder": {}
1353
1353
  },
1354
1354
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"optionalBackendDependencies":{"providermanagement":{"version":"^2.16.0","feature":{"flagName":"providermanagement-module","label":"Prescribing Clinician Roles","description":"Enable support for configuring prescribing clinicians roles when ordering drugs. Requires the backend providermanagement module."}},"ordertemplates":{"version":"^1.0.2","feature":{"flagName":"ordertemplates-module","label":"Order Templates","description":"Enable support for order templates when ordering drugs. Requires the backend ordertemplates module."}}},"extensions":[{"name":"medications-details-widget","component":"medicationsSummary","slot":"patient-chart-medications-dashboard-slot","meta":{"fullWidth":false}},{"name":"active-medications-widget","component":"activeMedications","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":false},"order":4},{"name":"past-medications-widget","component":"pastMedications","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":false},"order":5},{"name":"medications-summary-dashboard","component":"medicationsDashboardLink","slot":"patient-chart-dashboard-slot","order":3,"meta":{"slot":"patient-chart-medications-dashboard-slot","path":"Medications"}},{"name":"drug-order-panel","component":"drugOrderPanel","slot":"order-basket-slot","order":1},{"name":"drug-order-form","component":"drugOrderForm"},{"name":"drug-search-combobox","component":"drugSearchComboBox"}],"workspaces":[{"name":"add-drug-order","title":"addDrugOrderWorkspaceTitle","component":"addDrugOrderWorkspace","type":"order"},{"name":"fill-prescription-form","title":"fillPrescription","component":"fillPrescriptionFormWorkspace","type":"order"}],"version":"11.3.1-pre.9294"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"optionalBackendDependencies":{"providermanagement":{"version":"^2.16.0","feature":{"flagName":"providermanagement-module","label":"Prescribing Clinician Roles","description":"Enable support for configuring prescribing clinicians roles when ordering drugs. Requires the backend providermanagement module."}},"ordertemplates":{"version":"^1.0.2","feature":{"flagName":"ordertemplates-module","label":"Order Templates","description":"Enable support for order templates when ordering drugs. Requires the backend ordertemplates module."}}},"extensions":[{"name":"medications-details-widget","component":"medicationsSummary","slot":"patient-chart-medications-dashboard-slot","meta":{"fullWidth":false}},{"name":"active-medications-widget","component":"activeMedications","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":false},"order":4},{"name":"past-medications-widget","component":"pastMedications","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":false},"order":5},{"name":"medications-summary-dashboard","component":"medicationsDashboardLink","slot":"patient-chart-dashboard-slot","order":3,"meta":{"slot":"patient-chart-medications-dashboard-slot","path":"Medications"}},{"name":"drug-order-panel","component":"drugOrderPanel","slot":"order-basket-slot","order":1},{"name":"drug-order-form","component":"drugOrderForm"},{"name":"drug-search-combobox","component":"drugSearchComboBox"}],"workspaces":[{"name":"add-drug-order","title":"addDrugOrderWorkspaceTitle","component":"addDrugOrderWorkspace","type":"order"},{"name":"fill-prescription-form","title":"fillPrescription","component":"fillPrescriptionFormWorkspace","type":"order"}],"version":"11.3.1-pre.9304"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-medications-app",
3
- "version": "11.3.1-pre.9294",
3
+ "version": "11.3.1-pre.9304",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Patient medications microfrontend for the OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-patient-medications-app.js",
@@ -52,7 +52,7 @@
52
52
  "swr": "2.x"
53
53
  },
54
54
  "devDependencies": {
55
- "@openmrs/esm-patient-common-lib": "11.3.1-pre.9294",
55
+ "@openmrs/esm-patient-common-lib": "11.3.1-pre.9304",
56
56
  "webpack": "^5.99.9"
57
57
  },
58
58
  "stableVersion": "11.3.0"
@@ -16,7 +16,7 @@ const ActiveMedications: React.FC<ActiveMedicationsProps> = ({ patient }) => {
16
16
 
17
17
  const { data: activePatientOrders, error, isLoading, isValidating } = useActivePatientOrders(patient?.id);
18
18
 
19
- const launchAddDrugWorkspace = useLaunchWorkspaceRequiringVisit('add-drug-order');
19
+ const launchAddDrugWorkspace = useLaunchWorkspaceRequiringVisit(patient.id, 'add-drug-order');
20
20
 
21
21
  if (isLoading) {
22
22
  return <DataTableSkeleton role="progressbar" />;
@@ -9,7 +9,7 @@ import ActiveMedications from './active-medications.component';
9
9
  const mockUseSession = jest.mocked(useSession);
10
10
  const mockOpenmrsFetch = openmrsFetch as jest.Mock;
11
11
  const mockLaunchWorkspace = launchWorkspace as jest.Mock;
12
- const mockUseLaunchWorkspaceRequiringVisit = jest.fn().mockImplementation((name) => {
12
+ const mockUseLaunchWorkspaceRequiringVisit = jest.fn().mockImplementation((patientId, name) => {
13
13
  return () => mockLaunchWorkspace(name);
14
14
  });
15
15
  mockUseSession.mockReturnValue(mockSessionDataResponse.data);
@@ -23,11 +23,6 @@ jest.mock('@openmrs/esm-patient-common-lib', () => {
23
23
  useWorkspaces: jest.fn(() => {
24
24
  return { workspaces: [{ name: 'order-basket' }] };
25
25
  }),
26
- useVisitOrOfflineVisit: jest.fn(() => ({
27
- currentVisit: {
28
- uuid: '8ef90c91-14be-42dd-a1c0-e67fbf904470',
29
- },
30
- })),
31
26
  };
32
27
  });
33
28
 
@@ -115,7 +115,7 @@ describe('AddDrugOrderWorkspace drug search', () => {
115
115
 
116
116
  await user.type(screen.getByRole('searchbox'), 'Aspirin');
117
117
  const { result: hookResult } = renderHook(() =>
118
- useOrderBasket('medications', ((x) => x) as unknown as PostDataPrepFunction),
118
+ useOrderBasket(mockPatient, 'medications', ((x) => x) as unknown as PostDataPrepFunction),
119
119
  );
120
120
 
121
121
  const aspirin325Div = getByTextWithMarkup(/Aspirin 325mg/i).closest('div').parentElement;
@@ -139,7 +139,7 @@ describe('AddDrugOrderWorkspace drug search', () => {
139
139
 
140
140
  await user.type(screen.getByRole('searchbox'), 'Aspirin');
141
141
  const { result: hookResult } = renderHook(() =>
142
- useOrderBasket('medications', ((x) => x) as unknown as PostDataPrepFunction),
142
+ useOrderBasket(mockPatient, 'medications', ((x) => x) as unknown as PostDataPrepFunction),
143
143
  );
144
144
  const aspirin81Div = getByTextWithMarkup(/Aspirin 81mg/i).closest('div').parentElement;
145
145
  const aspirin81OpenFormButton = within(aspirin81Div).getByText(/Order form/i);
@@ -154,7 +154,7 @@ describe('AddDrugOrderWorkspace drug search', () => {
154
154
  renderAddDrugOrderWorkspace();
155
155
 
156
156
  const { result: hookResult } = renderHook(() =>
157
- useOrderBasket('medications', ((x) => x) as unknown as PostDataPrepFunction),
157
+ useOrderBasket(mockPatient, 'medications', ((x) => x) as unknown as PostDataPrepFunction),
158
158
  );
159
159
  await user.type(screen.getByRole('searchbox'), 'Aspirin');
160
160
  const aspirin81Div = getByTextWithMarkup(/Aspirin 81mg/i).closest('div').parentElement;
@@ -195,6 +195,8 @@ function renderAddDrugOrderWorkspace() {
195
195
  patientUuid={mockPatient.id}
196
196
  patient={mockPatient}
197
197
  setTitle={jest.fn()}
198
+ visitContext={null}
199
+ mutateVisitContext={null}
198
200
  />,
199
201
  );
200
202
  }
@@ -1,19 +1,14 @@
1
1
  import React, { type ComponentProps, useCallback, useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button } from '@carbon/react';
4
- import { ArrowLeftIcon, launchWorkspace, useConfig, useLayoutType } from '@openmrs/esm-framework';
5
- import {
6
- type DefaultPatientWorkspaceProps,
7
- useOrderBasket,
8
- usePatientChartStore,
9
- } from '@openmrs/esm-patient-common-lib';
4
+ import { ArrowLeftIcon, launchWorkspace, useLayoutType } from '@openmrs/esm-framework';
5
+ import { type DefaultPatientWorkspaceProps, useOrderBasket } from '@openmrs/esm-patient-common-lib';
10
6
  import { prepMedicationOrderPostData } from '../api/api';
11
7
  import { ordersEqual } from './drug-search/helpers';
12
8
  import type { DrugOrderBasketItem } from '../types';
13
9
  import { DrugOrderForm } from './drug-order-form.component';
14
10
  import DrugSearch from './drug-search/drug-search.component';
15
11
  import styles from './add-drug-order.scss';
16
- import { type ConfigObject } from '../config-schema';
17
12
 
18
13
  export interface AddDrugOrderWorkspaceAdditionalProps {
19
14
  order: DrugOrderBasketItem;
@@ -35,7 +30,11 @@ export default function AddDrugOrderWorkspace({
35
30
  }: AddDrugOrderWorkspace) {
36
31
  const { t } = useTranslation();
37
32
  const isTablet = useLayoutType() === 'tablet';
38
- const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>('medications', prepMedicationOrderPostData);
33
+ const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>(
34
+ patient,
35
+ 'medications',
36
+ prepMedicationOrderPostData,
37
+ );
39
38
  const [currentOrder, setCurrentOrder] = useState(initialOrder);
40
39
 
41
40
  const cancelDrugOrder = useCallback(() => {
@@ -94,7 +93,7 @@ export default function AddDrugOrderWorkspace({
94
93
  </Button>
95
94
  </div>
96
95
  )}
97
- <DrugSearch openOrderForm={openOrderForm} />
96
+ <DrugSearch patient={patient} openOrderForm={openOrderForm} />
98
97
  </>
99
98
  );
100
99
  } else {
@@ -114,6 +113,7 @@ export default function AddDrugOrderWorkspace({
114
113
  </div>
115
114
  )}
116
115
  <DrugOrderForm
116
+ patientUuid={patient.id}
117
117
  initialOrderBasketItem={currentOrder}
118
118
  patient={patient}
119
119
  onSave={saveDrugOrder}
@@ -59,6 +59,7 @@ import DrugSearchComboBox from './drug-search/drug-search-combobox.component';
59
59
  import styles from './drug-order-form.scss';
60
60
 
61
61
  export interface DrugOrderFormProps {
62
+ patientUuid: string;
62
63
  initialOrderBasketItem: DrugOrderBasketItem;
63
64
  patient: fhir.Patient;
64
65
  onSave: (finalizedOrder: DrugOrderBasketItem) => Promise<void>;
@@ -16,9 +16,10 @@ import styles from './order-basket-search.scss';
16
16
 
17
17
  export interface DrugSearchProps {
18
18
  openOrderForm: (searchResult: DrugOrderBasketItem) => void;
19
+ patient: fhir.Patient;
19
20
  }
20
21
 
21
- export default function DrugSearch({ openOrderForm }: DrugSearchProps) {
22
+ export default function DrugSearch({ openOrderForm, patient }: DrugSearchProps) {
22
23
  const { t } = useTranslation();
23
24
  const isTablet = useLayoutType() === 'tablet';
24
25
  const [searchTerm, setSearchTerm] = useState('');
@@ -60,6 +61,7 @@ export default function DrugSearch({ openOrderForm }: DrugSearchProps) {
60
61
  searchTerm={debouncedSearchTerm}
61
62
  openOrderForm={openOrderForm}
62
63
  focusAndClearSearchInput={focusAndClearSearchInput}
64
+ patient={patient}
63
65
  />
64
66
  {isTablet && (
65
67
  <div className={styles.separatorContainer}>
@@ -3,7 +3,7 @@ import classNames from 'classnames';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { Button, ButtonSkeleton, SkeletonText, Tile } from '@carbon/react';
5
5
  import { ShoppingCartArrowUp } from '@carbon/react/icons';
6
- import { useOrderBasket, usePatientChartStore } from '@openmrs/esm-patient-common-lib';
6
+ import { useOrderBasket } from '@openmrs/esm-patient-common-lib';
7
7
  import {
8
8
  ArrowRightIcon,
9
9
  closeWorkspace,
@@ -26,12 +26,14 @@ import type { DrugOrderBasketItem } from '../../types';
26
26
  import styles from './order-basket-search-results.scss';
27
27
 
28
28
  export interface OrderBasketSearchResultsProps {
29
+ patient: fhir.Patient;
29
30
  searchTerm: string;
30
31
  openOrderForm: (searchResult: DrugOrderBasketItem) => void;
31
32
  focusAndClearSearchInput: () => void;
32
33
  }
33
34
 
34
35
  interface DrugSearchResultItemProps {
36
+ patient: fhir.Patient;
35
37
  drug: DrugSearchResult;
36
38
  openOrderForm: (searchResult: DrugOrderBasketItem) => void;
37
39
  }
@@ -40,6 +42,7 @@ export default function OrderBasketSearchResults({
40
42
  searchTerm,
41
43
  openOrderForm,
42
44
  focusAndClearSearchInput,
45
+ patient,
43
46
  }: OrderBasketSearchResultsProps) {
44
47
  const { t } = useTranslation();
45
48
  const isTablet = useLayoutType() === 'tablet';
@@ -105,16 +108,22 @@ export default function OrderBasketSearchResults({
105
108
  </Button>
106
109
  </div>
107
110
  <div className={styles.resultsContainer}>
108
- {drugs?.map((drug) => <DrugSearchResultItem key={drug.uuid} drug={drug} openOrderForm={openOrderForm} />)}
111
+ {drugs?.map((drug) => (
112
+ <DrugSearchResultItem patient={patient} key={drug.uuid} drug={drug} openOrderForm={openOrderForm} />
113
+ ))}
109
114
  </div>
110
115
  </div>
111
116
  );
112
117
  }
113
118
 
114
- const DrugSearchResultItem: React.FC<DrugSearchResultItemProps> = ({ drug, openOrderForm }) => {
119
+ const DrugSearchResultItem: React.FC<DrugSearchResultItemProps> = ({ patient, drug, openOrderForm }) => {
115
120
  const isTablet = useLayoutType() === 'tablet';
116
- const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>('medications', prepMedicationOrderPostData);
117
- const { patientUuid } = usePatientChartStore();
121
+ const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>(
122
+ patient,
123
+ 'medications',
124
+ prepMedicationOrderPostData,
125
+ );
126
+ const patientUuid = patient.id;
118
127
  const { data: activeOrders, isLoading: isLoadingActiveOrders } = useActivePatientOrders(patientUuid);
119
128
  const drugAlreadyInBasket = useMemo(
120
129
  () => orders?.some((order) => ordersEqual(order, getTemplateOrderBasketItem(drug))),
@@ -1,18 +1,17 @@
1
1
  import React, { useCallback } from 'react';
2
- import { type DrugOrderBasketItem } from '../types';
2
+ import { useTranslation } from 'react-i18next';
3
3
  import {
4
4
  type ConfigObject,
5
5
  type DefaultWorkspaceProps,
6
- Encounter,
7
6
  showSnackbar,
8
7
  useConfig,
9
8
  useSession,
10
9
  useVisit,
11
10
  } from '@openmrs/esm-framework';
12
11
  import { type EncounterPost, postEncounter } from '@openmrs/esm-patient-common-lib';
12
+ import { type DrugOrderBasketItem } from '../types';
13
13
  import { prepMedicationOrderPostData } from '../api';
14
14
  import DrugOrderForm from './drug-order-form.component';
15
- import { useTranslation } from 'react-i18next';
16
15
 
17
16
  export interface FillPrescriptionFormProps extends DefaultWorkspaceProps {
18
17
  patient: fhir.Patient;
@@ -96,6 +95,7 @@ const FillPrescriptionForm: React.FC<FillPrescriptionFormProps> = ({
96
95
  }
97
96
  return (
98
97
  <DrugOrderForm
98
+ patientUuid={patientUuid}
99
99
  initialOrderBasketItem={{ action: 'NEW' } as DrugOrderBasketItem}
100
100
  patient={patient}
101
101
  onSave={submitDrugOrder}
@@ -68,15 +68,15 @@ const MedicationsDetailsTable: React.FC<MedicationsDetailsTableProps> = ({
68
68
  }) => {
69
69
  const pageSize = 5;
70
70
  const { t } = useTranslation();
71
- const launchOrderBasket = useLaunchWorkspaceRequiringVisit('order-basket');
72
- const launchAddDrugOrder = useLaunchWorkspaceRequiringVisit('add-drug-order');
71
+ const launchOrderBasket = useLaunchWorkspaceRequiringVisit(patient.id, 'order-basket');
72
+ const launchAddDrugOrder = useLaunchWorkspaceRequiringVisit(patient.id, 'add-drug-order');
73
73
  const config = useConfig<ConfigObject>();
74
74
  const showPrintButton = config.showPrintButton;
75
75
  const contentToPrintRef = useRef(null);
76
76
  const { excludePatientIdentifierCodeTypes } = useConfig();
77
77
  const [isPrinting, setIsPrinting] = useState(false);
78
78
 
79
- const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>('medications');
79
+ const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>(patient, 'medications');
80
80
  const { results, goTo, currentPage } = usePagination(medications, pageSize);
81
81
 
82
82
  const tableHeaders = [
@@ -9,6 +9,7 @@ import {
9
9
  closeWorkspace,
10
10
  launchWorkspace,
11
11
  useLayoutType,
12
+ type Visit,
12
13
  } from '@openmrs/esm-framework';
13
14
  import { useOrderBasket } from '@openmrs/esm-patient-common-lib';
14
15
  import { prepMedicationOrderPostData } from '../api/api';
@@ -17,13 +18,25 @@ import OrderBasketItemTile from './order-basket-item-tile.component';
17
18
  import RxIcon from './rx-icon.component';
18
19
  import styles from './drug-order-basket-panel.scss';
19
20
 
21
+ interface OrderBasketSlotProps {
22
+ patientUuid: string;
23
+ patient: fhir.Patient;
24
+ visitContext: Visit;
25
+ mutateVisitContext: () => void;
26
+ }
27
+
20
28
  /**
21
29
  * Designs: https://app.zeplin.io/project/60d59321e8100b0324762e05/screen/62c6bb9500e7671a618efa56
30
+ * Slotted into order-basket-slot by default
22
31
  */
23
- export default function DrugOrderBasketPanelExtension() {
32
+ const DrugOrderBasketPanelExtension: React.FC<OrderBasketSlotProps> = ({ patient }) => {
24
33
  const { t } = useTranslation();
25
34
  const isTablet = useLayoutType() === 'tablet';
26
- const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>('medications', prepMedicationOrderPostData);
35
+ const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>(
36
+ patient,
37
+ 'medications',
38
+ prepMedicationOrderPostData,
39
+ );
27
40
  const [isExpanded, setIsExpanded] = useState(orders.length > 0);
28
41
  const {
29
42
  incompleteOrderBasketItems,
@@ -194,4 +207,6 @@ export default function DrugOrderBasketPanelExtension() {
194
207
  )}
195
208
  </Tile>
196
209
  );
197
- }
210
+ };
211
+
212
+ export default DrugOrderBasketPanelExtension;
@@ -3,7 +3,7 @@ import { screen, render } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import { getByTextWithMarkup } from 'tools';
5
5
  import { type DrugOrderBasketItem } from '../types';
6
- import { mockDrugSearchResultApiData, mockPatientDrugOrdersApiData } from '__mocks__';
6
+ import { mockDrugSearchResultApiData, mockFhirPatient, mockPatientDrugOrdersApiData } from '__mocks__';
7
7
  import { getTemplateOrderBasketItem } from '../add-drug-order/drug-search/drug-search.resource';
8
8
  import DrugOrderBasketPanel from './drug-order-basket-panel.extension';
9
9
 
@@ -14,10 +14,17 @@ jest.mock('@openmrs/esm-patient-common-lib', () => ({
14
14
  useOrderBasket: () => mockUseOrderBasket(),
15
15
  }));
16
16
 
17
+ const testProps = {
18
+ patient: mockFhirPatient,
19
+ patientUuid: mockFhirPatient.id,
20
+ visitContext: null,
21
+ mutateVisitContext: null,
22
+ };
23
+
17
24
  describe('OrderBasketPanel', () => {
18
25
  test('renders an empty state when no items are selected in the order basket', () => {
19
26
  mockUseOrderBasket.mockReturnValue({ orders: [] });
20
- render(<DrugOrderBasketPanel />);
27
+ render(<DrugOrderBasketPanel {...testProps} />);
21
28
  expect(screen.getByRole('heading', { name: /Drug orders \(0\)/i })).toBeInTheDocument();
22
29
  expect(screen.getByRole('button', { name: /Add/i })).toBeInTheDocument();
23
30
  });
@@ -39,7 +46,7 @@ describe('OrderBasketPanel', () => {
39
46
  orders: orders,
40
47
  setOrders: mockSetOrders,
41
48
  }));
42
- const { rerender } = render(<DrugOrderBasketPanel />);
49
+ const { rerender } = render(<DrugOrderBasketPanel {...testProps} />);
43
50
  expect(screen.getByText(/Drug orders \(4\)/i)).toBeInTheDocument();
44
51
  expect(getByTextWithMarkup(/New\s*Aspirin 81mg — 81mg — Tablet/i)).toBeVisible();
45
52
  expect(getByTextWithMarkup(/DOSE\s*Tablet/i)).toBeVisible();
@@ -49,7 +56,7 @@ describe('OrderBasketPanel', () => {
49
56
  const removeAspirin81Button = screen.getAllByRole('button', { name: /remove from basket/i })[0];
50
57
  expect(removeAspirin81Button).toBeVisible();
51
58
  await user.click(removeAspirin81Button);
52
- rerender(<DrugOrderBasketPanel />); // re-render because the mocked hook does not trigger a render
59
+ rerender(<DrugOrderBasketPanel {...testProps} />); // re-render because the mocked hook does not trigger a render
53
60
  await expect(screen.getByText(/Drug Orders \(3\)/i)).toBeInTheDocument();
54
61
  });
55
62
  });
@@ -12,8 +12,10 @@ export interface MedicationsSummaryProps {
12
12
 
13
13
  export default function MedicationsSummary({ patient }: MedicationsSummaryProps) {
14
14
  const { t } = useTranslation();
15
- const launchAddDrugWorkspace =
16
- useLaunchWorkspaceRequiringVisit<AddDrugOrderWorkspaceAdditionalProps>('add-drug-order');
15
+ const launchAddDrugWorkspace = useLaunchWorkspaceRequiringVisit<AddDrugOrderWorkspaceAdditionalProps>(
16
+ patient.id,
17
+ 'add-drug-order',
18
+ );
17
19
 
18
20
  const {
19
21
  data: activeOrders,