@openmrs/esm-patient-medications-app 11.3.1-pre.9212 → 11.3.1-pre.9219

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.3473",(()=>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.9212",(()=>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.3473",(()=>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.9219",(()=>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": "decd272df279d248",
51
+ "hash": "0c62e1e1e219df6c",
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": 8741,
147
+ "size": 9718,
148
148
  "sizes": {
149
- "javascript": 8741
149
+ "javascript": 9718
150
150
  },
151
151
  "names": [],
152
152
  "idHints": [],
@@ -160,7 +160,7 @@
160
160
  "auxiliaryFiles": [
161
161
  "1022.js.map"
162
162
  ],
163
- "hash": "c40409091b99125a",
163
+ "hash": "a7290b3aaf205135",
164
164
  "childrenByOrder": {}
165
165
  },
166
166
  {
@@ -593,9 +593,9 @@
593
593
  "initial": false,
594
594
  "entry": false,
595
595
  "recorded": false,
596
- "size": 4353,
596
+ "size": 4423,
597
597
  "sizes": {
598
- "javascript": 4353
598
+ "javascript": 4423
599
599
  },
600
600
  "names": [],
601
601
  "idHints": [],
@@ -607,7 +607,7 @@
607
607
  "4300.js"
608
608
  ],
609
609
  "auxiliaryFiles": [],
610
- "hash": "af13c923126caa38",
610
+ "hash": "9c78366b74f103a4",
611
611
  "childrenByOrder": {}
612
612
  },
613
613
  {
@@ -704,9 +704,9 @@
704
704
  "entry": false,
705
705
  "recorded": false,
706
706
  "reason": "split chunk (cache group: default)",
707
- "size": 137168,
707
+ "size": 139183,
708
708
  "sizes": {
709
- "javascript": 137168
709
+ "javascript": 139183
710
710
  },
711
711
  "names": [],
712
712
  "idHints": [],
@@ -720,7 +720,7 @@
720
720
  "auxiliaryFiles": [
721
721
  "4953.js.map"
722
722
  ],
723
- "hash": "77e0a9e2f52d1a40",
723
+ "hash": "1f233b008c61cc9f",
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": 122296,
1053
+ "size": 122412,
1054
1054
  "sizes": {
1055
- "javascript": 122296
1055
+ "javascript": 122412
1056
1056
  },
1057
1057
  "names": [],
1058
1058
  "idHints": [],
@@ -1066,7 +1066,7 @@
1066
1066
  "auxiliaryFiles": [
1067
1067
  "7151.js.map"
1068
1068
  ],
1069
- "hash": "c7f340ed97dbf7fc",
1069
+ "hash": "73a745d0eeedc94e",
1070
1070
  "childrenByOrder": {}
1071
1071
  },
1072
1072
  {
@@ -1202,7 +1202,7 @@
1202
1202
  "auxiliaryFiles": [
1203
1203
  "8437.js.map"
1204
1204
  ],
1205
- "hash": "3ea9b201ecbd2714",
1205
+ "hash": "8e8be77b125a12aa",
1206
1206
  "childrenByOrder": {}
1207
1207
  },
1208
1208
  {
@@ -1299,7 +1299,7 @@
1299
1299
  "auxiliaryFiles": [
1300
1300
  "main.js.map"
1301
1301
  ],
1302
- "hash": "48e42e58683d7aa8",
1302
+ "hash": "602f4bf5c1f22918",
1303
1303
  "childrenByOrder": {}
1304
1304
  },
1305
1305
  {
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.9212"}
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.9219"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-medications-app",
3
- "version": "11.3.1-pre.9212",
3
+ "version": "11.3.1-pre.9219",
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.9212",
55
+ "@openmrs/esm-patient-common-lib": "11.3.1-pre.9219",
56
56
  "webpack": "^5.99.9"
57
57
  },
58
58
  "stableVersion": "11.3.0"
@@ -31,12 +31,12 @@ export default function AddDrugOrderWorkspace({
31
31
  closeWorkspace,
32
32
  closeWorkspaceWithSavedChanges,
33
33
  promptBeforeClosing,
34
+ patient,
34
35
  }: AddDrugOrderWorkspace) {
35
36
  const { t } = useTranslation();
36
37
  const isTablet = useLayoutType() === 'tablet';
37
38
  const { orders, setOrders } = useOrderBasket<DrugOrderBasketItem>('medications', prepMedicationOrderPostData);
38
39
  const [currentOrder, setCurrentOrder] = useState(initialOrder);
39
- const { patient } = usePatientChartStore();
40
40
 
41
41
  const cancelDrugOrder = useCallback(() => {
42
42
  closeWorkspace({
@@ -30,12 +30,13 @@ import {
30
30
  getPatientName,
31
31
  OpenmrsDatePicker,
32
32
  parseDate,
33
+ showSnackbar,
33
34
  useConfig,
34
35
  useFeatureFlag,
35
36
  useLayoutType,
36
37
  useSession,
37
38
  } from '@openmrs/esm-framework';
38
- import { type Control, Controller, useController } from 'react-hook-form';
39
+ import { type Control, Controller, type FieldErrors, useController } from 'react-hook-form';
39
40
  import { type Drug } from '@openmrs/esm-patient-common-lib';
40
41
  import { useOrderConfig } from '../api/order-config';
41
42
  import { type ConfigObject } from '../config-schema';
@@ -48,7 +49,7 @@ import type {
48
49
  MedicationRoute,
49
50
  QuantityUnit,
50
51
  } from '../types';
51
- import { type Provider, useProviders } from '../api';
52
+ import { type Provider, useActivePatientOrders, useProviders } from '../api';
52
53
  import styles from './drug-order-form.scss';
53
54
  import {
54
55
  drugOrderBasketItemToFormValue,
@@ -208,6 +209,19 @@ export function DrugOrderForm({
208
209
  setIsSaving(false);
209
210
  };
210
211
 
212
+ const handleFormSubmissionError = (errors: FieldErrors<MedicationOrderFormData>) => {
213
+ if (errors) {
214
+ console.error('Error in drug order form', errors);
215
+ showSnackbar({
216
+ title: t('drugOrderValidationFailed', 'Validation failed'),
217
+ subtitle: t('drugOrderValidationFailedDescription', 'Please check the form for errors and try again.'),
218
+ kind: 'error',
219
+ timeoutInMs: 5000,
220
+ isLowContrast: true,
221
+ });
222
+ }
223
+ };
224
+
211
225
  const drugDosingUnits: Array<DosingUnit> = useMemo(
212
226
  () =>
213
227
  orderConfigObject?.drugDosingUnits ?? [
@@ -287,7 +301,17 @@ export function DrugOrderForm({
287
301
  },
288
302
  [setShowMedicationHeader],
289
303
  );
290
- const now = new Date();
304
+ const {
305
+ fieldState: { error: drugFieldError },
306
+ } = useController<MedicationOrderFormData>({ name: 'drug', control });
307
+
308
+ // TODO: use the backend instead of this to determine whether the drug formulation can be ordered
309
+ // See: https://openmrs.atlassian.net/browse/RESTWS-1003
310
+ const { data: activeOrders } = useActivePatientOrders(patient.id);
311
+ const drugAlreadyPrescribedForNewOrder = useMemo(
312
+ () => initialOrderBasketItem.action == 'NEW' && activeOrders?.some((order) => order?.drug?.uuid === drug?.uuid),
313
+ [activeOrders, drug, initialOrderBasketItem.action],
314
+ );
291
315
 
292
316
  return (
293
317
  <div className={styles.container}>
@@ -304,7 +328,11 @@ export function DrugOrderForm({
304
328
  </span>
305
329
  </div>
306
330
  <ExtensionSlot name="allergy-list-pills-slot" state={{ patientUuid: patient?.id }} />
307
- <Form className={styles.orderForm} onSubmit={handleSubmit(handleFormSubmission)} id="drugOrderForm">
331
+ <Form
332
+ className={styles.orderForm}
333
+ onSubmit={handleSubmit(handleFormSubmission, handleFormSubmissionError)}
334
+ id="drugOrderForm"
335
+ >
308
336
  <div>
309
337
  {errorFetchingOrderConfig && (
310
338
  <InlineNotification
@@ -329,6 +357,12 @@ export function DrugOrderForm({
329
357
  reset(drugOrderBasketItemToFormValue(item, startDate, currentProvider.uuid));
330
358
  }}
331
359
  />
360
+ {drugAlreadyPrescribedForNewOrder && (
361
+ <FormLabel className={styles.errorLabel}>
362
+ {t('activePrescriptionExists', 'Active prescription exists for this drug')}
363
+ </FormLabel>
364
+ )}
365
+ <FormLabel className={styles.errorLabel}>{drugFieldError?.message}</FormLabel>
332
366
  </InputWrapper>
333
367
  )}
334
368
  {allowAndSupportSelectingPrescribingClinician &&
@@ -678,7 +712,7 @@ export function DrugOrderForm({
678
712
  kind="primary"
679
713
  type="submit"
680
714
  size="xl"
681
- disabled={!!errorFetchingOrderConfig || isSaving}
715
+ disabled={!!errorFetchingOrderConfig || isSaving || drugAlreadyPrescribedForNewOrder}
682
716
  >
683
717
  {saveButtonText}
684
718
  </Button>
@@ -86,7 +86,8 @@ function useCreateMedicationOrderFormSchema() {
86
86
  .object({
87
87
  uuid: z.string(),
88
88
  })
89
- .passthrough(),
89
+ .passthrough()
90
+ .nullable(),
90
91
  strength: z.string().nullable(),
91
92
  display: z.string().nullable(),
92
93
  },
@@ -120,6 +120,8 @@ const DrugSearchResultItem: React.FC<DrugSearchResultItemProps> = ({ drug, openO
120
120
  () => orders?.some((order) => ordersEqual(order, getTemplateOrderBasketItem(drug))),
121
121
  [orders, drug],
122
122
  );
123
+ // TODO: use the backend instead of this to determine whether the drug formulation can be ordered
124
+ // See: https://openmrs.atlassian.net/browse/RESTWS-1003
123
125
  const drugAlreadyPrescribed = useMemo(
124
126
  () => activeOrders?.some((order) => order?.drug?.uuid === drug?.uuid),
125
127
  [activeOrders, drug],
@@ -3,6 +3,7 @@ import { type DrugOrderBasketItem } from '../types';
3
3
  import {
4
4
  type ConfigObject,
5
5
  type DefaultWorkspaceProps,
6
+ Encounter,
6
7
  showSnackbar,
7
8
  useConfig,
8
9
  useSession,
@@ -13,8 +14,9 @@ import { prepMedicationOrderPostData } from '../api';
13
14
  import DrugOrderForm from './drug-order-form.component';
14
15
  import { useTranslation } from 'react-i18next';
15
16
 
16
- export interface OrderBasketDrugOrderFormProps extends DefaultWorkspaceProps {
17
+ export interface FillPrescriptionFormProps extends DefaultWorkspaceProps {
17
18
  patient: fhir.Patient;
19
+ onAfterSave?(patient: fhir.Patient, encounterUuid: string);
18
20
  }
19
21
 
20
22
  /**
@@ -26,11 +28,12 @@ export interface OrderBasketDrugOrderFormProps extends DefaultWorkspaceProps {
26
28
  * This component is not used in the medications app itself, but is intended to be used in other apps
27
29
  * (like dispensing).
28
30
  */
29
- const FillPrescriptionForm: React.FC<OrderBasketDrugOrderFormProps> = ({
31
+ const FillPrescriptionForm: React.FC<FillPrescriptionFormProps> = ({
30
32
  patient,
31
33
  closeWorkspace,
32
34
  closeWorkspaceWithSavedChanges,
33
35
  promptBeforeClosing,
36
+ onAfterSave,
34
37
  }) => {
35
38
  const { sessionLocation } = useSession();
36
39
  const { t } = useTranslation();
@@ -51,7 +54,7 @@ const FillPrescriptionForm: React.FC<OrderBasketDrugOrderFormProps> = ({
51
54
  orders: [drugOrderPost],
52
55
  };
53
56
  try {
54
- await postEncounter(encounter);
57
+ const encounterUuid = await postEncounter(encounter);
55
58
  showSnackbar({
56
59
  isLowContrast: true,
57
60
  kind: 'success',
@@ -61,6 +64,7 @@ const FillPrescriptionForm: React.FC<OrderBasketDrugOrderFormProps> = ({
61
64
  }),
62
65
  });
63
66
  closeWorkspaceWithSavedChanges();
67
+ onAfterSave?.(patient, encounterUuid);
64
68
  } catch (e) {
65
69
  showSnackbar({
66
70
  isLowContrast: true,
@@ -68,11 +72,19 @@ const FillPrescriptionForm: React.FC<OrderBasketDrugOrderFormProps> = ({
68
72
  title: t('saveDrugOrderFailed', 'Error ordering {{orderName}}', {
69
73
  orderName: finalizedOrder.drug.display,
70
74
  }),
71
- subtitle: e?.message,
75
+ subtitle: e?.responseBody?.error?.translatedMessage ?? e?.responseBody?.error?.message,
72
76
  });
73
77
  }
74
78
  },
75
- [patientUuid, closeWorkspaceWithSavedChanges, sessionLocation.uuid, t, drugOrderEncounterType],
79
+ [
80
+ patientUuid,
81
+ closeWorkspaceWithSavedChanges,
82
+ sessionLocation.uuid,
83
+ t,
84
+ drugOrderEncounterType,
85
+ onAfterSave,
86
+ patient,
87
+ ],
76
88
  );
77
89
 
78
90
  if (!isLoadingVisit && !activeVisit) {
@@ -3,6 +3,7 @@
3
3
  "activeMedicationsDisplayText": "active medications",
4
4
  "activeMedicationsHeaderTitle": "Active medications",
5
5
  "activeMedicationsTableTitle": "Active Medications",
6
+ "activePrescriptionExists": "Active prescription exists for this drug",
6
7
  "add": "Add",
7
8
  "addDrugOrderWorkspaceTitle": "Add drug order",
8
9
  "backToOrderBasket": "Back to order basket",