@openmrs/esm-dispensing-app 1.9.2-pre.816 → 1.9.2-pre.821
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/2284f5222714e162-meta.json +1 -0
- package/.turbo/cache/2284f5222714e162.tar.zst +0 -0
- package/.turbo/turbo-build.log +5 -5
- package/dist/4099.js +1 -1
- package/dist/4099.js.map +1 -1
- package/dist/6411.js +1 -1
- package/dist/6411.js.map +1 -1
- package/dist/6841.js +1 -1
- package/dist/6841.js.map +1 -1
- package/dist/963.js +1 -1
- package/dist/963.js.map +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 +16 -16
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/components/action-buttons.component.tsx +8 -3
- package/src/components/action-buttons.test.tsx +3 -0
- package/src/components/prescription-actions/close-action-button.component.tsx +3 -1
- package/src/components/prescription-actions/dispense-action-button.component.tsx +3 -1
- package/src/components/prescription-actions/pause-action-button.component.tsx +3 -1
- package/src/forms/close-dispense-form.workspace.tsx +2 -1
- package/src/forms/dispense-form.workspace.tsx +2 -0
- package/src/forms/pause-dispense-form.workspace.tsx +2 -1
- package/src/history/history-and-comments.component.tsx +2 -0
- package/src/prescriptions/prescription-details.component.tsx +3 -1
- package/src/types.ts +9 -0
- package/src/utils.ts +31 -4
- package/.turbo/cache/93c9eaba094e1208-meta.json +0 -1
- package/.turbo/cache/93c9eaba094e1208.tar.zst +0 -0
|
@@ -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(6411)]).then((()=>()=>t(36411)))},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.3308",(()=>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.
|
|
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(6411)]).then((()=>()=>t(36411)))},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.3308",(()=>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.8803",(()=>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})();
|
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
"initial": false,
|
|
150
150
|
"entry": false,
|
|
151
151
|
"recorded": false,
|
|
152
|
-
"size":
|
|
152
|
+
"size": 12622,
|
|
153
153
|
"sizes": {
|
|
154
|
-
"javascript":
|
|
154
|
+
"javascript": 12622
|
|
155
155
|
},
|
|
156
156
|
"names": [],
|
|
157
157
|
"idHints": [],
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"auxiliaryFiles": [
|
|
166
166
|
"963.js.map"
|
|
167
167
|
],
|
|
168
|
-
"hash": "
|
|
168
|
+
"hash": "68bdd3f6d3d8f00b",
|
|
169
169
|
"childrenByOrder": {}
|
|
170
170
|
},
|
|
171
171
|
{
|
|
@@ -562,9 +562,9 @@
|
|
|
562
562
|
"initial": false,
|
|
563
563
|
"entry": false,
|
|
564
564
|
"recorded": false,
|
|
565
|
-
"size":
|
|
565
|
+
"size": 116430,
|
|
566
566
|
"sizes": {
|
|
567
|
-
"javascript":
|
|
567
|
+
"javascript": 116430
|
|
568
568
|
},
|
|
569
569
|
"names": [],
|
|
570
570
|
"idHints": [],
|
|
@@ -578,7 +578,7 @@
|
|
|
578
578
|
"auxiliaryFiles": [
|
|
579
579
|
"4099.js.map"
|
|
580
580
|
],
|
|
581
|
-
"hash": "
|
|
581
|
+
"hash": "87050966ab936f09",
|
|
582
582
|
"childrenByOrder": {}
|
|
583
583
|
},
|
|
584
584
|
{
|
|
@@ -945,9 +945,9 @@
|
|
|
945
945
|
"initial": false,
|
|
946
946
|
"entry": false,
|
|
947
947
|
"recorded": false,
|
|
948
|
-
"size":
|
|
948
|
+
"size": 341568,
|
|
949
949
|
"sizes": {
|
|
950
|
-
"javascript":
|
|
950
|
+
"javascript": 341568
|
|
951
951
|
},
|
|
952
952
|
"names": [],
|
|
953
953
|
"idHints": [],
|
|
@@ -960,7 +960,7 @@
|
|
|
960
960
|
"auxiliaryFiles": [
|
|
961
961
|
"6411.js.map"
|
|
962
962
|
],
|
|
963
|
-
"hash": "
|
|
963
|
+
"hash": "f2e8f426d2fce4fd",
|
|
964
964
|
"childrenByOrder": {}
|
|
965
965
|
},
|
|
966
966
|
{
|
|
@@ -1109,9 +1109,9 @@
|
|
|
1109
1109
|
"initial": false,
|
|
1110
1110
|
"entry": false,
|
|
1111
1111
|
"recorded": false,
|
|
1112
|
-
"size":
|
|
1112
|
+
"size": 12620,
|
|
1113
1113
|
"sizes": {
|
|
1114
|
-
"javascript":
|
|
1114
|
+
"javascript": 12620
|
|
1115
1115
|
},
|
|
1116
1116
|
"names": [],
|
|
1117
1117
|
"idHints": [],
|
|
@@ -1125,7 +1125,7 @@
|
|
|
1125
1125
|
"auxiliaryFiles": [
|
|
1126
1126
|
"6841.js.map"
|
|
1127
1127
|
],
|
|
1128
|
-
"hash": "
|
|
1128
|
+
"hash": "ce5c57e31808f71d",
|
|
1129
1129
|
"childrenByOrder": {}
|
|
1130
1130
|
},
|
|
1131
1131
|
{
|
|
@@ -1416,10 +1416,10 @@
|
|
|
1416
1416
|
"initial": true,
|
|
1417
1417
|
"entry": true,
|
|
1418
1418
|
"recorded": false,
|
|
1419
|
-
"size":
|
|
1419
|
+
"size": 3394186,
|
|
1420
1420
|
"sizes": {
|
|
1421
1421
|
"consume-shared": 210,
|
|
1422
|
-
"javascript":
|
|
1422
|
+
"javascript": 3371291,
|
|
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": "eca9a9d9692b6dd8",
|
|
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": "2f7a01e14df953a4",
|
|
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.821"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
2
|
import { ExtensionSlot, useConfig, useSession } from '@openmrs/esm-framework';
|
|
4
3
|
import { MedicationDispenseStatus, type MedicationRequestBundle, MedicationRequestStatus } from '../types';
|
|
5
4
|
import {
|
|
@@ -16,10 +15,15 @@ interface ActionButtonsProps {
|
|
|
16
15
|
medicationRequestBundle: MedicationRequestBundle;
|
|
17
16
|
patientUuid: string;
|
|
18
17
|
encounterUuid: string;
|
|
18
|
+
disabled: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const ActionButtons: React.FC<ActionButtonsProps> = ({
|
|
22
|
-
|
|
21
|
+
const ActionButtons: React.FC<ActionButtonsProps> = ({
|
|
22
|
+
medicationRequestBundle,
|
|
23
|
+
patientUuid,
|
|
24
|
+
encounterUuid,
|
|
25
|
+
disabled,
|
|
26
|
+
}) => {
|
|
23
27
|
const config = useConfig<PharmacyConfig>();
|
|
24
28
|
const session = useSession();
|
|
25
29
|
const providers = useProviders(config.dispenserProviderRoles);
|
|
@@ -66,6 +70,7 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({ medicationRequestBundle,
|
|
|
66
70
|
medicationRequestBundle,
|
|
67
71
|
session,
|
|
68
72
|
providers,
|
|
73
|
+
disabled,
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
return (
|
|
@@ -124,6 +124,7 @@ const prescriptionActionsState = {
|
|
|
124
124
|
medicationRequestBundle: { request: medicationRequest, dispenses: [] },
|
|
125
125
|
session: undefined,
|
|
126
126
|
providers: [],
|
|
127
|
+
disabled: false,
|
|
127
128
|
};
|
|
128
129
|
|
|
129
130
|
describe('Action Buttons Component tests', () => {
|
|
@@ -160,6 +161,7 @@ describe('Action Buttons Component tests', () => {
|
|
|
160
161
|
patientUuid={mockPatientUuid}
|
|
161
162
|
encounterUuid={mockEncounterUuid}
|
|
162
163
|
medicationRequestBundle={{ request: medicationRequest, dispenses: [] }}
|
|
164
|
+
disabled={false}
|
|
163
165
|
/>,
|
|
164
166
|
);
|
|
165
167
|
expect(getByText('Dispense')).toBeInTheDocument();
|
|
@@ -206,6 +208,7 @@ describe('Action Buttons Component tests', () => {
|
|
|
206
208
|
patientUuid={mockPatientUuid}
|
|
207
209
|
encounterUuid={mockEncounterUuid}
|
|
208
210
|
medicationRequestBundle={{ request: expiredMedicationRequest, dispenses: [] }}
|
|
211
|
+
disabled={false}
|
|
209
212
|
/>,
|
|
210
213
|
);
|
|
211
214
|
|
|
@@ -12,6 +12,7 @@ type CloseActionButtonProps = {
|
|
|
12
12
|
session: Session;
|
|
13
13
|
providers: Array<Provider>;
|
|
14
14
|
closeable: boolean;
|
|
15
|
+
disabled: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const CloseActionButton: React.FC<CloseActionButtonProps> = ({
|
|
@@ -21,6 +22,7 @@ const CloseActionButton: React.FC<CloseActionButtonProps> = ({
|
|
|
21
22
|
session,
|
|
22
23
|
providers,
|
|
23
24
|
closeable,
|
|
25
|
+
disabled,
|
|
24
26
|
}) => {
|
|
25
27
|
const { t } = useTranslation();
|
|
26
28
|
|
|
@@ -39,7 +41,7 @@ const CloseActionButton: React.FC<CloseActionButtonProps> = ({
|
|
|
39
41
|
return null;
|
|
40
42
|
}
|
|
41
43
|
return (
|
|
42
|
-
<Button kind="danger" onClick={handleLaunchWorkspace}>
|
|
44
|
+
<Button kind="danger" onClick={handleLaunchWorkspace} disabled={disabled}>
|
|
43
45
|
{t('close', 'Close')}
|
|
44
46
|
</Button>
|
|
45
47
|
);
|
|
@@ -14,6 +14,7 @@ type DispenseActionButtonProps = {
|
|
|
14
14
|
dispensable: boolean;
|
|
15
15
|
quantityRemaining: number;
|
|
16
16
|
quantityDispensed: number;
|
|
17
|
+
disabled: boolean;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const DispenseActionButton: React.FC<DispenseActionButtonProps> = ({
|
|
@@ -25,6 +26,7 @@ const DispenseActionButton: React.FC<DispenseActionButtonProps> = ({
|
|
|
25
26
|
dispensable,
|
|
26
27
|
quantityRemaining,
|
|
27
28
|
quantityDispensed,
|
|
29
|
+
disabled,
|
|
28
30
|
}) => {
|
|
29
31
|
const { t } = useTranslation();
|
|
30
32
|
const dispenseWorkspaceProps = {
|
|
@@ -46,7 +48,7 @@ const DispenseActionButton: React.FC<DispenseActionButtonProps> = ({
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
return (
|
|
49
|
-
<Button kind="primary" onClick={handleLaunchWorkspace}>
|
|
51
|
+
<Button kind="primary" onClick={handleLaunchWorkspace} disabled={disabled}>
|
|
50
52
|
{t('dispense', 'Dispense')}
|
|
51
53
|
</Button>
|
|
52
54
|
);
|
|
@@ -12,6 +12,7 @@ type PauseActionButtonProps = {
|
|
|
12
12
|
session: Session;
|
|
13
13
|
providers: Array<Provider>;
|
|
14
14
|
pauseable: boolean;
|
|
15
|
+
disabled: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const PauseActionButton: React.FC<PauseActionButtonProps> = ({
|
|
@@ -21,6 +22,7 @@ const PauseActionButton: React.FC<PauseActionButtonProps> = ({
|
|
|
21
22
|
session,
|
|
22
23
|
providers,
|
|
23
24
|
pauseable,
|
|
25
|
+
disabled,
|
|
24
26
|
}) => {
|
|
25
27
|
const { t } = useTranslation();
|
|
26
28
|
const pauseWorkspaceProps = {
|
|
@@ -38,7 +40,7 @@ const PauseActionButton: React.FC<PauseActionButtonProps> = ({
|
|
|
38
40
|
return null;
|
|
39
41
|
}
|
|
40
42
|
return (
|
|
41
|
-
<Button kind="secondary" onClick={handleLaunchWorkspace}>
|
|
43
|
+
<Button kind="secondary" onClick={handleLaunchWorkspace} disabled={disabled}>
|
|
42
44
|
{t('pause', 'Pause')}
|
|
43
45
|
</Button>
|
|
44
46
|
);
|
|
@@ -15,7 +15,7 @@ import { saveMedicationDispense, useReasonForCloseValueSet } from '../medication
|
|
|
15
15
|
import { updateMedicationRequestFulfillerStatus } from '../medication-request/medication-request.resource';
|
|
16
16
|
import { type MedicationDispense, MedicationDispenseStatus, MedicationRequestFulfillerStatus } from '../types';
|
|
17
17
|
import { type PharmacyConfig } from '../config-schema';
|
|
18
|
-
import { getUuidFromReference, revalidate } from '../utils';
|
|
18
|
+
import { getUuidFromReference, markEncounterAsStale, revalidate } from '../utils';
|
|
19
19
|
import styles from './forms.scss';
|
|
20
20
|
|
|
21
21
|
type CloseDispenseFormProps = DefaultWorkspaceProps & {
|
|
@@ -71,6 +71,7 @@ const CloseDispenseForm: React.FC<CloseDispenseFormProps> = ({
|
|
|
71
71
|
if (!isSubmitting) {
|
|
72
72
|
setIsSubmitting(true);
|
|
73
73
|
const abortController = new AbortController();
|
|
74
|
+
markEncounterAsStale(encounterUuid);
|
|
74
75
|
saveMedicationDispense(medicationDispensePayload, MedicationDispenseStatus.declined, abortController)
|
|
75
76
|
.then((response) => {
|
|
76
77
|
// only update request status when added a new dispense event, not updating
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
computeNewFulfillerStatusAfterDispenseEvent,
|
|
21
21
|
getFulfillerStatus,
|
|
22
22
|
getUuidFromReference,
|
|
23
|
+
markEncounterAsStale,
|
|
23
24
|
revalidate,
|
|
24
25
|
} from '../utils';
|
|
25
26
|
import { type PharmacyConfig } from '../config-schema';
|
|
@@ -74,6 +75,7 @@ const DispenseForm: React.FC<DispenseFormProps> = ({
|
|
|
74
75
|
if (!isSubmitting) {
|
|
75
76
|
setIsSubmitting(true);
|
|
76
77
|
const abortController = new AbortController();
|
|
78
|
+
markEncounterAsStale(encounterUuid);
|
|
77
79
|
saveMedicationDispense(medicationDispensePayload, MedicationDispenseStatus.completed, abortController)
|
|
78
80
|
.then((response) => {
|
|
79
81
|
if (response.ok) {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@openmrs/esm-framework';
|
|
14
14
|
import { saveMedicationDispense, useReasonForPauseValueSet } from '../medication-dispense/medication-dispense.resource';
|
|
15
15
|
import { updateMedicationRequestFulfillerStatus } from '../medication-request/medication-request.resource';
|
|
16
|
-
import { getUuidFromReference, revalidate } from '../utils';
|
|
16
|
+
import { getUuidFromReference, markEncounterAsStale, revalidate } from '../utils';
|
|
17
17
|
import { type MedicationDispense, MedicationDispenseStatus, MedicationRequestFulfillerStatus } from '../types';
|
|
18
18
|
import { type PharmacyConfig } from '../config-schema';
|
|
19
19
|
import styles from './forms.scss';
|
|
@@ -71,6 +71,7 @@ const PauseDispenseForm: React.FC<PauseDispenseFormProps> = ({
|
|
|
71
71
|
if (!isSubmitting) {
|
|
72
72
|
setIsSubmitting(true);
|
|
73
73
|
const abortController = new AbortController();
|
|
74
|
+
markEncounterAsStale(encounterUuid);
|
|
74
75
|
saveMedicationDispense(medicationDispensePayload, MedicationDispenseStatus.on_hold, abortController)
|
|
75
76
|
.then((response) => {
|
|
76
77
|
// only update request status when added a new dispense event, not updating
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
revalidate,
|
|
35
35
|
sortMedicationDispensesByWhenHandedOver,
|
|
36
36
|
computeTotalQuantityDispensed,
|
|
37
|
+
markEncounterAsStale,
|
|
37
38
|
} from '../utils';
|
|
38
39
|
import { type PharmacyConfig } from '../config-schema';
|
|
39
40
|
|
|
@@ -222,6 +223,7 @@ const HistoryAndComments: React.FC<{
|
|
|
222
223
|
config.dispenseBehavior.restrictTotalQuantityDispensed,
|
|
223
224
|
);
|
|
224
225
|
|
|
226
|
+
markEncounterAsStale(encounterUuid);
|
|
225
227
|
deleteMedicationDispense(medicationDispense.id)
|
|
226
228
|
.then(() => {
|
|
227
229
|
showSnackbar({
|
|
@@ -9,7 +9,7 @@ import { type PharmacyConfig } from '../config-schema';
|
|
|
9
9
|
import { PRIVILEGE_CREATE_DISPENSE } from '../constants';
|
|
10
10
|
import { usePatientAllergies, usePrescriptionDetails } from '../medication-request/medication-request.resource';
|
|
11
11
|
import { type AllergyIntolerance, type MedicationRequest, MedicationRequestCombinedStatus } from '../types';
|
|
12
|
-
import { computeMedicationRequestCombinedStatus, getConceptCodingDisplay } from '../utils';
|
|
12
|
+
import { computeMedicationRequestCombinedStatus, getConceptCodingDisplay, useStaleEncounterUuids } from '../utils';
|
|
13
13
|
import PrescriptionsActionsFooter from './prescription-actions.component';
|
|
14
14
|
import styles from './prescription-details.scss';
|
|
15
15
|
|
|
@@ -22,6 +22,7 @@ const PrescriptionDetails: React.FC<{
|
|
|
22
22
|
const [isAllergiesLoading, setAllergiesLoadingStatus] = useState(true);
|
|
23
23
|
const { allergies, totalAllergies } = usePatientAllergies(patientUuid, config.refreshInterval);
|
|
24
24
|
const { medicationRequestBundles, error, isLoading } = usePrescriptionDetails(encounterUuid, config.refreshInterval);
|
|
25
|
+
const { staleEncounterUuids } = useStaleEncounterUuids();
|
|
25
26
|
|
|
26
27
|
useEffect(() => {
|
|
27
28
|
if (typeof totalAllergies == 'number') {
|
|
@@ -99,6 +100,7 @@ const PrescriptionDetails: React.FC<{
|
|
|
99
100
|
patientUuid={patientUuid}
|
|
100
101
|
encounterUuid={encounterUuid}
|
|
101
102
|
medicationRequestBundle={bundle}
|
|
103
|
+
disabled={staleEncounterUuids.includes(encounterUuid)}
|
|
102
104
|
/>
|
|
103
105
|
</UserHasAccess>
|
|
104
106
|
<MedicationEvent
|
package/src/types.ts
CHANGED
|
@@ -523,3 +523,12 @@ export type StockDispenseRequest = {
|
|
|
523
523
|
stockItemPackagingUOM: string;
|
|
524
524
|
quantity: number;
|
|
525
525
|
};
|
|
526
|
+
|
|
527
|
+
export interface DispensingStore {
|
|
528
|
+
/**
|
|
529
|
+
* A list of encounterUuids with stale data due to
|
|
530
|
+
* updates (like pausing of dispensing medication) actions,
|
|
531
|
+
* and subsequent SWR revalidation has not yet completed
|
|
532
|
+
*/
|
|
533
|
+
staleEncounterUuids: string[];
|
|
534
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -2,6 +2,7 @@ import dayjs from 'dayjs';
|
|
|
2
2
|
import { mutate } from 'swr';
|
|
3
3
|
import {
|
|
4
4
|
type Coding,
|
|
5
|
+
type DispensingStore,
|
|
5
6
|
type DosageInstruction,
|
|
6
7
|
type Medication,
|
|
7
8
|
type MedicationDispense,
|
|
@@ -14,7 +15,12 @@ import {
|
|
|
14
15
|
MedicationRequestStatus,
|
|
15
16
|
type Quantity,
|
|
16
17
|
} from './types';
|
|
17
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
createGlobalStore,
|
|
20
|
+
fhirBaseUrl,
|
|
21
|
+
parseDate,
|
|
22
|
+
useStore,
|
|
23
|
+
} from '@openmrs/esm-framework';
|
|
18
24
|
import {
|
|
19
25
|
OPENMRS_FHIR_EXT_DISPENSE_RECORDED,
|
|
20
26
|
OPENMRS_FHIR_EXT_MEDICINE,
|
|
@@ -565,16 +571,29 @@ export function isMostRecentMedicationDispense(
|
|
|
565
571
|
|
|
566
572
|
/**
|
|
567
573
|
* Revalidated (reloads) both the prescription associated with the encounter uuid,
|
|
568
|
-
* and the entire
|
|
574
|
+
* and the entire prescription table
|
|
569
575
|
* @param encounterUuid
|
|
570
576
|
*/
|
|
571
|
-
export function revalidate(encounterUuid: string) {
|
|
572
|
-
mutate(
|
|
577
|
+
export async function revalidate(encounterUuid: string) {
|
|
578
|
+
await mutate(
|
|
573
579
|
(key) =>
|
|
574
580
|
typeof key === 'string' &&
|
|
575
581
|
(key.startsWith(`${fhirBaseUrl}/${PRESCRIPTIONS_TABLE_ENDPOINT}`) ||
|
|
576
582
|
key.startsWith(`${fhirBaseUrl}/${PRESCRIPTION_DETAILS_ENDPOINT}?encounter=${encounterUuid}`)),
|
|
577
583
|
);
|
|
584
|
+
dispensingStore.setState((state) => ({
|
|
585
|
+
staleEncounterUuids: state.staleEncounterUuids.filter((uuid) => uuid !== encounterUuid),
|
|
586
|
+
}));
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Mark the specified encounter as stale. The encounter will be unmarked on calling
|
|
591
|
+
* revalidate() to reload the data associated with the encounter.
|
|
592
|
+
*/
|
|
593
|
+
export function markEncounterAsStale(encounterUuid: string) {
|
|
594
|
+
dispensingStore.setState((state) => ({
|
|
595
|
+
staleEncounterUuids: [...state.staleEncounterUuids, encounterUuid],
|
|
596
|
+
}));
|
|
578
597
|
}
|
|
579
598
|
|
|
580
599
|
export function sortMedicationDispensesByWhenHandedOver(a: MedicationDispense, b: MedicationDispense): number {
|
|
@@ -590,3 +609,11 @@ export function sortMedicationDispensesByWhenHandedOver(a: MedicationDispense, b
|
|
|
590
609
|
return a.id.localeCompare(b.id); // just to enforce a standard order if two dates are equals
|
|
591
610
|
}
|
|
592
611
|
}
|
|
612
|
+
|
|
613
|
+
const dispensingStore = createGlobalStore<DispensingStore>('dispensing-store', {
|
|
614
|
+
staleEncounterUuids: [],
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
export function useStaleEncounterUuids() {
|
|
618
|
+
return useStore(dispensingStore);
|
|
619
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"93c9eaba094e1208","duration":42627}
|
|
Binary file
|