@openmrs/esm-patient-orders-app 11.3.1-pre.9283 → 11.3.1-pre.9296
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/turbo-build.log +3 -3
- package/dist/4300.js +1 -1
- package/dist/7202.js +1 -1
- package/dist/7202.js.map +1 -1
- package/dist/8625.js +1 -1
- package/dist/8625.js.map +1 -1
- package/dist/8803.js +1 -1
- package/dist/8803.js.map +1 -1
- package/dist/8960.js +1 -1
- package/dist/8960.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-orders-app.js +1 -1
- package/dist/openmrs-esm-patient-orders-app.js.buildmanifest.json +19 -19
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/api/api.ts +16 -9
- package/src/components/order-details-table.component.tsx +16 -6
- package/src/lab-results/lab-results-form.test.tsx +2 -0
- package/src/order-basket/general-order-type/general-order-form/general-order-form.component.tsx +2 -1
- package/src/order-basket/general-order-type/general-order-type.component.tsx +3 -2
- package/src/order-basket/general-order-type/orderable-concept-search/orderable-concept-search.workspace.tsx +19 -5
- package/src/order-basket/general-order-type/orderable-concept-search/search-results.component.tsx +6 -1
- package/src/order-basket/order-basket.workspace.tsx +37 -16
- package/src/order-basket-action-button/order-basket-action-button.extension.tsx +11 -3
- package/src/order-basket-action-button/order-basket-action-button.test.tsx +6 -30
- package/translations/en.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var _openmrs_esm_patient_orders_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,_={63200:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(7657),t.e(6654),t.e(1343),t.e(5434),t.e(8716),t.e(8625)]).then((()=>()=>t(38625)))},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-orders-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-orders-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(7657),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.
|
|
1
|
+
var _openmrs_esm_patient_orders_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,_={63200:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(7657),t.e(6654),t.e(1343),t.e(5434),t.e(8716),t.e(8625)]).then((()=>()=>t(38625)))},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-orders-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-orders-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(7657),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.9296",(()=>Promise.all([j.e(1268),j.e(7657),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],8625:[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={113: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_orders_app=globalThis.webpackChunk_openmrs_esm_patient_orders_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var S=j(63200);_openmrs_esm_patient_orders_app=S})();
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"auxiliaryFiles": [
|
|
49
49
|
"openmrs-esm-patient-orders-app.js.map"
|
|
50
50
|
],
|
|
51
|
-
"hash": "
|
|
51
|
+
"hash": "15dc0123f498b2e3",
|
|
52
52
|
"childrenByOrder": {}
|
|
53
53
|
},
|
|
54
54
|
{
|
|
@@ -590,9 +590,9 @@
|
|
|
590
590
|
"initial": false,
|
|
591
591
|
"entry": false,
|
|
592
592
|
"recorded": false,
|
|
593
|
-
"size":
|
|
593
|
+
"size": 4909,
|
|
594
594
|
"sizes": {
|
|
595
|
-
"javascript":
|
|
595
|
+
"javascript": 4909
|
|
596
596
|
},
|
|
597
597
|
"names": [],
|
|
598
598
|
"idHints": [],
|
|
@@ -604,7 +604,7 @@
|
|
|
604
604
|
"4300.js"
|
|
605
605
|
],
|
|
606
606
|
"auxiliaryFiles": [],
|
|
607
|
-
"hash": "
|
|
607
|
+
"hash": "5da514f552c9bf05",
|
|
608
608
|
"childrenByOrder": {}
|
|
609
609
|
},
|
|
610
610
|
{
|
|
@@ -1142,9 +1142,9 @@
|
|
|
1142
1142
|
"initial": false,
|
|
1143
1143
|
"entry": false,
|
|
1144
1144
|
"recorded": false,
|
|
1145
|
-
"size":
|
|
1145
|
+
"size": 138371,
|
|
1146
1146
|
"sizes": {
|
|
1147
|
-
"javascript":
|
|
1147
|
+
"javascript": 138371
|
|
1148
1148
|
},
|
|
1149
1149
|
"names": [],
|
|
1150
1150
|
"idHints": [],
|
|
@@ -1158,7 +1158,7 @@
|
|
|
1158
1158
|
"auxiliaryFiles": [
|
|
1159
1159
|
"7202.js.map"
|
|
1160
1160
|
],
|
|
1161
|
-
"hash": "
|
|
1161
|
+
"hash": "e9b7b095c9b65bea",
|
|
1162
1162
|
"childrenByOrder": {}
|
|
1163
1163
|
},
|
|
1164
1164
|
{
|
|
@@ -1329,9 +1329,9 @@
|
|
|
1329
1329
|
"initial": false,
|
|
1330
1330
|
"entry": false,
|
|
1331
1331
|
"recorded": false,
|
|
1332
|
-
"size":
|
|
1332
|
+
"size": 278507,
|
|
1333
1333
|
"sizes": {
|
|
1334
|
-
"javascript":
|
|
1334
|
+
"javascript": 278465,
|
|
1335
1335
|
"consume-shared": 42
|
|
1336
1336
|
},
|
|
1337
1337
|
"names": [],
|
|
@@ -1345,7 +1345,7 @@
|
|
|
1345
1345
|
"auxiliaryFiles": [
|
|
1346
1346
|
"8625.js.map"
|
|
1347
1347
|
],
|
|
1348
|
-
"hash": "
|
|
1348
|
+
"hash": "819a22cac02b679b",
|
|
1349
1349
|
"childrenByOrder": {}
|
|
1350
1350
|
},
|
|
1351
1351
|
{
|
|
@@ -1374,10 +1374,10 @@
|
|
|
1374
1374
|
"initial": true,
|
|
1375
1375
|
"entry": true,
|
|
1376
1376
|
"recorded": false,
|
|
1377
|
-
"size":
|
|
1377
|
+
"size": 3242284,
|
|
1378
1378
|
"sizes": {
|
|
1379
1379
|
"consume-shared": 294,
|
|
1380
|
-
"javascript":
|
|
1380
|
+
"javascript": 3218908,
|
|
1381
1381
|
"share-init": 420,
|
|
1382
1382
|
"runtime": 22662
|
|
1383
1383
|
},
|
|
@@ -1394,7 +1394,7 @@
|
|
|
1394
1394
|
"auxiliaryFiles": [
|
|
1395
1395
|
"main.js.map"
|
|
1396
1396
|
],
|
|
1397
|
-
"hash": "
|
|
1397
|
+
"hash": "d682dca46399e475",
|
|
1398
1398
|
"childrenByOrder": {}
|
|
1399
1399
|
},
|
|
1400
1400
|
{
|
|
@@ -1403,9 +1403,9 @@
|
|
|
1403
1403
|
"entry": false,
|
|
1404
1404
|
"recorded": false,
|
|
1405
1405
|
"reason": "reused as split chunk (cache group: default)",
|
|
1406
|
-
"size":
|
|
1406
|
+
"size": 251708,
|
|
1407
1407
|
"sizes": {
|
|
1408
|
-
"javascript":
|
|
1408
|
+
"javascript": 251708
|
|
1409
1409
|
},
|
|
1410
1410
|
"names": [],
|
|
1411
1411
|
"idHints": [],
|
|
@@ -1419,7 +1419,7 @@
|
|
|
1419
1419
|
"auxiliaryFiles": [
|
|
1420
1420
|
"8803.js.map"
|
|
1421
1421
|
],
|
|
1422
|
-
"hash": "
|
|
1422
|
+
"hash": "4a5948fa3e832fdd",
|
|
1423
1423
|
"childrenByOrder": {}
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
|
@@ -1427,9 +1427,9 @@
|
|
|
1427
1427
|
"initial": false,
|
|
1428
1428
|
"entry": false,
|
|
1429
1429
|
"recorded": false,
|
|
1430
|
-
"size":
|
|
1430
|
+
"size": 133613,
|
|
1431
1431
|
"sizes": {
|
|
1432
|
-
"javascript":
|
|
1432
|
+
"javascript": 133613
|
|
1433
1433
|
},
|
|
1434
1434
|
"names": [],
|
|
1435
1435
|
"idHints": [],
|
|
@@ -1443,7 +1443,7 @@
|
|
|
1443
1443
|
"auxiliaryFiles": [
|
|
1444
1444
|
"8960.js.map"
|
|
1445
1445
|
],
|
|
1446
|
-
"hash": "
|
|
1446
|
+
"hash": "f3834308bb58e1a4",
|
|
1447
1447
|
"childrenByOrder": {}
|
|
1448
1448
|
},
|
|
1449
1449
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"optionalBackendDependencies":{"fhirproxy":"^1.0.0-SNAPSHOT","stockmanagement":"^1.4.0 || ^2.0.0 || >=3.0.0-0","billing":"^1.2.0-SNAPSHOT"},"extensions":[{"name":"order-price-details","component":"orderPriceDetailsExtension","slot":"order-item-additional-info-slot","order":0},{"name":"order-stock-details","component":"orderStockDetailsExtension","slot":"order-item-additional-info-slot","order":1},{"name":"order-basket-action-menu","component":"orderBasketActionMenu","slots":["action-menu-patient-chart-items-slot","action-menu-ward-patient-items-slot"]},{"name":"lab-result","component":"labResult","slot":"completed-lab-order-results-slot","meta":{"fullWidth":false}},{"name":"print-lab-results-action-button","component":"printLabResultsButton","slot":"print-lab-results-action-button-slot","meta":{"fullWidth":false}},{"name":"patient-orders-summary-dashboard","component":"ordersDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"slot":"patient-chart-orders-dashboard-slot","path":"Orders","hideDashboardTitle":true},"order":4},{"name":"patient-orders-dashboard","component":"ordersDashboard","slot":"patient-chart-orders-dashboard-slot","meta":{"fullWidth":false}}],"workspaces":[{"name":"order-basket","title":"orderBasketWorkspaceTitle","component":"orderBasketWorkspace","type":"order","canHide":true},{"name":"patient-orders-form-workspace","title":"orderCancellation","component":"patientOrdersFormWorkspace","type":"order","canHide":false},{"name":"test-results-form-workspace","title":"enterTestResults","component":"testResultsFormWorkspace","type":"lab-results","canHide":false},{"name":"orderable-concept-workspace","title":"searchOrderables","component":"orderableConceptSearch","type":"order"}],"modals":[{"component":"printLabResultModal","name":"print-lab-results-modal"}],"version":"11.3.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"optionalBackendDependencies":{"fhirproxy":"^1.0.0-SNAPSHOT","stockmanagement":"^1.4.0 || ^2.0.0 || >=3.0.0-0","billing":"^1.2.0-SNAPSHOT"},"extensions":[{"name":"order-price-details","component":"orderPriceDetailsExtension","slot":"order-item-additional-info-slot","order":0},{"name":"order-stock-details","component":"orderStockDetailsExtension","slot":"order-item-additional-info-slot","order":1},{"name":"order-basket-action-menu","component":"orderBasketActionMenu","slots":["action-menu-patient-chart-items-slot","action-menu-ward-patient-items-slot"]},{"name":"lab-result","component":"labResult","slot":"completed-lab-order-results-slot","meta":{"fullWidth":false}},{"name":"print-lab-results-action-button","component":"printLabResultsButton","slot":"print-lab-results-action-button-slot","meta":{"fullWidth":false}},{"name":"patient-orders-summary-dashboard","component":"ordersDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"slot":"patient-chart-orders-dashboard-slot","path":"Orders","hideDashboardTitle":true},"order":4},{"name":"patient-orders-dashboard","component":"ordersDashboard","slot":"patient-chart-orders-dashboard-slot","meta":{"fullWidth":false}}],"workspaces":[{"name":"order-basket","title":"orderBasketWorkspaceTitle","component":"orderBasketWorkspace","type":"order","canHide":true},{"name":"patient-orders-form-workspace","title":"orderCancellation","component":"patientOrdersFormWorkspace","type":"order","canHide":false},{"name":"test-results-form-workspace","title":"enterTestResults","component":"testResultsFormWorkspace","type":"lab-results","canHide":false},{"name":"orderable-concept-workspace","title":"searchOrderables","component":"orderableConceptSearch","type":"order"}],"modals":[{"component":"printLabResultModal","name":"print-lab-results-modal"}],"version":"11.3.1-pre.9296"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-orders-app",
|
|
3
|
-
"version": "11.3.1-pre.
|
|
3
|
+
"version": "11.3.1-pre.9296",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Microfrontend for the OpenMRS SPA providing the order basket for the patient chart",
|
|
6
6
|
"browser": "dist/openmrs-esm-patient-orders-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.
|
|
55
|
+
"@openmrs/esm-patient-common-lib": "11.3.1-pre.9296",
|
|
56
56
|
"webpack": "^5.99.9"
|
|
57
57
|
},
|
|
58
58
|
"stableVersion": "11.3.0"
|
package/src/api/api.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
import useSWR, { useSWRConfig } from 'swr';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
type FetchResponse,
|
|
5
|
+
openmrsFetch,
|
|
6
|
+
type OpenmrsResource,
|
|
7
|
+
restBaseUrl,
|
|
8
|
+
type Visit,
|
|
9
|
+
} from '@openmrs/esm-framework';
|
|
10
|
+
import { useSystemVisitSetting } from '@openmrs/esm-patient-common-lib';
|
|
5
11
|
|
|
6
12
|
export const careSettingUuid = '6f0c9a92-6f24-11e3-af88-005056821db0';
|
|
7
13
|
|
|
@@ -43,6 +49,8 @@ export function getMedicationByUuid(abortController: AbortController, orderUuid:
|
|
|
43
49
|
|
|
44
50
|
export function useOrderEncounter(
|
|
45
51
|
patientUuid: string,
|
|
52
|
+
visit: Visit,
|
|
53
|
+
mutateVisit: () => void,
|
|
46
54
|
encounterTypeUuid: string,
|
|
47
55
|
): {
|
|
48
56
|
visitRequired: boolean;
|
|
@@ -61,7 +69,6 @@ export function useOrderEncounter(
|
|
|
61
69
|
: null,
|
|
62
70
|
openmrsFetch,
|
|
63
71
|
);
|
|
64
|
-
const visit = useVisitOrOfflineVisit(patientUuid);
|
|
65
72
|
|
|
66
73
|
const results = useMemo(() => {
|
|
67
74
|
if (isLoadingSystemVisitSetting || errorFetchingSystemVisitSetting) {
|
|
@@ -76,12 +83,11 @@ export function useOrderEncounter(
|
|
|
76
83
|
return systemVisitEnabled
|
|
77
84
|
? {
|
|
78
85
|
visitRequired: true,
|
|
79
|
-
isLoading:
|
|
80
|
-
encounterUuid: visit?.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
mutate: visit?.mutate,
|
|
86
|
+
isLoading: false,
|
|
87
|
+
encounterUuid: visit?.encounters?.find((encounter) => encounter.encounterType?.uuid === encounterTypeUuid)
|
|
88
|
+
?.uuid,
|
|
89
|
+
error: null,
|
|
90
|
+
mutate: mutateVisit,
|
|
85
91
|
}
|
|
86
92
|
: {
|
|
87
93
|
visitRequired: false,
|
|
@@ -94,6 +100,7 @@ export function useOrderEncounter(
|
|
|
94
100
|
isLoadingSystemVisitSetting,
|
|
95
101
|
errorFetchingSystemVisitSetting,
|
|
96
102
|
visit,
|
|
103
|
+
mutateVisit,
|
|
97
104
|
todayEncounter,
|
|
98
105
|
systemVisitEnabled,
|
|
99
106
|
encounterTypeUuid,
|
|
@@ -78,6 +78,8 @@ interface OrderBasketItemActionsProps {
|
|
|
78
78
|
openOrderBasket: () => void;
|
|
79
79
|
launchOrderForm: (additionalProps?: { order: MutableOrderBasketItem }) => void;
|
|
80
80
|
orderItem: Order;
|
|
81
|
+
responsiveSize: 'lg' | 'md' | 'sm';
|
|
82
|
+
patient: fhir.Patient;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
interface OrderHeaderProps {
|
|
@@ -101,10 +103,10 @@ const OrderDetailsTable: React.FC<OrderDetailsProps> = ({
|
|
|
101
103
|
const headerTitle = t('orders', 'Orders');
|
|
102
104
|
const isTablet = useLayoutType() === 'tablet';
|
|
103
105
|
const responsiveSize = isTablet ? 'lg' : 'md';
|
|
104
|
-
const launchOrderBasket = useLaunchWorkspaceRequiringVisit('order-basket');
|
|
105
|
-
const launchAddDrugOrder = useLaunchWorkspaceRequiringVisit('add-drug-order');
|
|
106
|
-
const launchModifyLabOrder = useLaunchWorkspaceRequiringVisit('add-lab-order');
|
|
107
|
-
const launchModifyGeneralOrder = useLaunchWorkspaceRequiringVisit('orderable-concept-workspace');
|
|
106
|
+
const launchOrderBasket = useLaunchWorkspaceRequiringVisit(patientUuid, 'order-basket');
|
|
107
|
+
const launchAddDrugOrder = useLaunchWorkspaceRequiringVisit(patientUuid, 'add-drug-order');
|
|
108
|
+
const launchModifyLabOrder = useLaunchWorkspaceRequiringVisit(patientUuid, 'add-lab-order');
|
|
109
|
+
const launchModifyGeneralOrder = useLaunchWorkspaceRequiringVisit(patientUuid, 'orderable-concept-workspace');
|
|
108
110
|
const contentToPrintRef = useRef<HTMLDivElement | null>(null);
|
|
109
111
|
const { excludePatientIdentifierCodeTypes } = useConfig();
|
|
110
112
|
const [isPrinting, setIsPrinting] = useState(false);
|
|
@@ -523,6 +525,8 @@ const OrderDetailsTable: React.FC<OrderDetailsProps> = ({
|
|
|
523
525
|
launchOrderForm={() => launchOrderForm(matchingOrder)}
|
|
524
526
|
openOrderBasket={launchOrderBasket}
|
|
525
527
|
orderItem={matchingOrder}
|
|
528
|
+
responsiveSize={responsiveSize}
|
|
529
|
+
patient={patient}
|
|
526
530
|
/>
|
|
527
531
|
) : (
|
|
528
532
|
<ExtensionSlot
|
|
@@ -605,7 +609,13 @@ const OrderDetailsTable: React.FC<OrderDetailsProps> = ({
|
|
|
605
609
|
);
|
|
606
610
|
};
|
|
607
611
|
|
|
608
|
-
function OrderBasketItemActions({
|
|
612
|
+
function OrderBasketItemActions({
|
|
613
|
+
orderItem,
|
|
614
|
+
openOrderBasket,
|
|
615
|
+
launchOrderForm,
|
|
616
|
+
responsiveSize,
|
|
617
|
+
patient,
|
|
618
|
+
}: OrderBasketItemActionsProps) {
|
|
609
619
|
const { t } = useTranslation();
|
|
610
620
|
|
|
611
621
|
// Use the appropriate grouping key and postDataPrepFunction based on order type
|
|
@@ -629,7 +639,7 @@ function OrderBasketItemActions({ orderItem, openOrderBasket, launchOrderForm }:
|
|
|
629
639
|
}, [orderItem.type, orderItem.orderType.uuid]);
|
|
630
640
|
|
|
631
641
|
const { grouping, postDataPrepFn } = getOrderBasketConfig();
|
|
632
|
-
const { orders, setOrders } = useOrderBasket<MutableOrderBasketItem>(grouping, postDataPrepFn);
|
|
642
|
+
const { orders, setOrders } = useOrderBasket<MutableOrderBasketItem>(patient, grouping, postDataPrepFn);
|
|
633
643
|
const alreadyInBasket = orders.some((x) => x.uuid === orderItem.uuid);
|
|
634
644
|
|
|
635
645
|
const handleAddOrEditTestResults = useCallback(() => {
|
package/src/order-basket/general-order-type/general-order-form/general-order-form.component.tsx
CHANGED
|
@@ -51,13 +51,14 @@ export function OrderForm({
|
|
|
51
51
|
closeWorkspace,
|
|
52
52
|
closeWorkspaceWithSavedChanges,
|
|
53
53
|
promptBeforeClosing,
|
|
54
|
+
patient,
|
|
54
55
|
orderTypeUuid,
|
|
55
56
|
}: OrderFormProps) {
|
|
56
57
|
const { t } = useTranslation();
|
|
57
58
|
const isTablet = useLayoutType() === 'tablet';
|
|
58
59
|
const session = useSession();
|
|
59
60
|
const isEditing = useMemo(() => initialOrder && initialOrder.action === 'REVISE', [initialOrder]);
|
|
60
|
-
const { orders, setOrders } = useOrderBasket<OrderBasketItem>(orderTypeUuid, prepOrderPostData);
|
|
61
|
+
const { orders, setOrders } = useOrderBasket<OrderBasketItem>(patient, orderTypeUuid, prepOrderPostData);
|
|
61
62
|
const [showErrorNotification, setShowErrorNotification] = useState(false);
|
|
62
63
|
const { orderType } = useOrderType(orderTypeUuid);
|
|
63
64
|
const config = useConfig<ConfigObject>();
|
|
@@ -19,14 +19,15 @@ import styles from './general-order-panel.scss';
|
|
|
19
19
|
|
|
20
20
|
interface GeneralOrderTypeProps extends OrderTypeDefinition {
|
|
21
21
|
closeWorkspace: DefaultWorkspaceProps['closeWorkspace'];
|
|
22
|
+
patient: fhir.Patient;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
const GeneralOrderType: React.FC<GeneralOrderTypeProps> = ({ orderTypeUuid, closeWorkspace, label, icon }) => {
|
|
25
|
+
const GeneralOrderType: React.FC<GeneralOrderTypeProps> = ({ patient, orderTypeUuid, closeWorkspace, label, icon }) => {
|
|
25
26
|
const { t } = useTranslation();
|
|
26
27
|
const isTablet = useLayoutType() === 'tablet';
|
|
27
28
|
const { orderType, isLoadingOrderType } = useOrderType(orderTypeUuid);
|
|
28
29
|
|
|
29
|
-
const { orders, setOrders } = useOrderBasket<OrderBasketItem>(orderTypeUuid, prepOrderPostData);
|
|
30
|
+
const { orders, setOrders } = useOrderBasket<OrderBasketItem>(patient, orderTypeUuid, prepOrderPostData);
|
|
30
31
|
const [isExpanded, setIsExpanded] = useState(orders.length > 0);
|
|
31
32
|
const {
|
|
32
33
|
incompleteOrderBasketItems,
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
type DefaultWorkspaceProps,
|
|
12
12
|
} from '@openmrs/esm-framework';
|
|
13
13
|
import {
|
|
14
|
+
type DefaultPatientWorkspaceProps,
|
|
14
15
|
type OrderBasketItem,
|
|
15
16
|
useOrderBasket,
|
|
16
17
|
useOrderType,
|
|
17
|
-
usePatientChartStore,
|
|
18
18
|
} from '@openmrs/esm-patient-common-lib';
|
|
19
19
|
import { OrderForm } from '../general-order-form/general-order-form.component';
|
|
20
20
|
import { prepOrderPostData } from '../resources';
|
|
@@ -22,7 +22,7 @@ import { type ConfigObject } from '../../../config-schema';
|
|
|
22
22
|
import OrderableConceptSearchResults from './search-results.component';
|
|
23
23
|
import styles from './orderable-concept-search.scss';
|
|
24
24
|
|
|
25
|
-
interface OrderableConceptSearchWorkspaceProps extends
|
|
25
|
+
interface OrderableConceptSearchWorkspaceProps extends DefaultPatientWorkspaceProps {
|
|
26
26
|
order: OrderBasketItem;
|
|
27
27
|
orderTypeUuid: string;
|
|
28
28
|
orderableConceptClasses: Array<string>;
|
|
@@ -44,11 +44,14 @@ const OrderableConceptSearchWorkspace: React.FC<OrderableConceptSearchWorkspaceP
|
|
|
44
44
|
closeWorkspaceWithSavedChanges,
|
|
45
45
|
promptBeforeClosing,
|
|
46
46
|
setTitle,
|
|
47
|
+
patientUuid,
|
|
48
|
+
patient,
|
|
49
|
+
visitContext,
|
|
50
|
+
mutateVisitContext,
|
|
47
51
|
}) => {
|
|
48
52
|
const { t } = useTranslation();
|
|
49
53
|
const isTablet = useLayoutType() === 'tablet';
|
|
50
|
-
const { orders } = useOrderBasket<OrderBasketItem>(orderTypeUuid, prepOrderPostData);
|
|
51
|
-
const { patientUuid, patient } = usePatientChartStore();
|
|
54
|
+
const { orders } = useOrderBasket<OrderBasketItem>(patient, orderTypeUuid, prepOrderPostData);
|
|
52
55
|
const { orderTypes } = useConfig<ConfigObject>();
|
|
53
56
|
const [currentOrder, setCurrentOrder] = useState(initialOrder);
|
|
54
57
|
const { orderType } = useOrderType(orderTypeUuid);
|
|
@@ -112,6 +115,8 @@ const OrderableConceptSearchWorkspace: React.FC<OrderableConceptSearchWorkspaceP
|
|
|
112
115
|
orderableConceptSets={orderableConceptSets}
|
|
113
116
|
patientUuid={patientUuid}
|
|
114
117
|
patient={patient}
|
|
118
|
+
visitContext={visitContext}
|
|
119
|
+
mutateVisitContext={mutateVisitContext}
|
|
115
120
|
setTitle={() => {}}
|
|
116
121
|
/>
|
|
117
122
|
) : (
|
|
@@ -120,6 +125,7 @@ const OrderableConceptSearchWorkspace: React.FC<OrderableConceptSearchWorkspaceP
|
|
|
120
125
|
closeWorkspace={closeWorkspace}
|
|
121
126
|
orderableConceptSets={orderableConceptSets}
|
|
122
127
|
orderTypeUuid={orderTypeUuid}
|
|
128
|
+
patient={patient}
|
|
123
129
|
/>
|
|
124
130
|
)}
|
|
125
131
|
</div>
|
|
@@ -131,9 +137,16 @@ interface ConceptSearchProps {
|
|
|
131
137
|
openOrderForm: (search: OrderBasketItem) => void;
|
|
132
138
|
orderTypeUuid: string;
|
|
133
139
|
orderableConceptSets: Array<string>;
|
|
140
|
+
patient: fhir.Patient;
|
|
134
141
|
}
|
|
135
142
|
|
|
136
|
-
function ConceptSearch({
|
|
143
|
+
function ConceptSearch({
|
|
144
|
+
closeWorkspace,
|
|
145
|
+
orderTypeUuid,
|
|
146
|
+
openOrderForm,
|
|
147
|
+
orderableConceptSets,
|
|
148
|
+
patient,
|
|
149
|
+
}: ConceptSearchProps) {
|
|
137
150
|
const { t } = useTranslation();
|
|
138
151
|
const { orderType } = useOrderType(orderTypeUuid);
|
|
139
152
|
const isTablet = useLayoutType() === 'tablet';
|
|
@@ -182,6 +195,7 @@ function ConceptSearch({ closeWorkspace, orderTypeUuid, openOrderForm, orderable
|
|
|
182
195
|
orderTypeUuid={orderTypeUuid}
|
|
183
196
|
cancelOrder={() => {}}
|
|
184
197
|
orderableConceptSets={orderableConceptSets}
|
|
198
|
+
patient={patient}
|
|
185
199
|
/>
|
|
186
200
|
{isTablet && (
|
|
187
201
|
<div className={styles.separatorContainer}>
|
package/src/order-basket/general-order-type/orderable-concept-search/search-results.component.tsx
CHANGED
|
@@ -28,6 +28,7 @@ interface OrderableConceptSearchResultsProps {
|
|
|
28
28
|
orderableConceptSets: Array<string>;
|
|
29
29
|
orderTypeUuid: string;
|
|
30
30
|
closeWorkspace: DefaultWorkspaceProps['closeWorkspace'];
|
|
31
|
+
patient: fhir.Patient;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
const OrderableConceptSearchResults: React.FC<OrderableConceptSearchResultsProps> = ({
|
|
@@ -38,6 +39,7 @@ const OrderableConceptSearchResults: React.FC<OrderableConceptSearchResultsProps
|
|
|
38
39
|
orderableConceptSets,
|
|
39
40
|
orderTypeUuid,
|
|
40
41
|
closeWorkspace,
|
|
42
|
+
patient,
|
|
41
43
|
}) => {
|
|
42
44
|
const { t } = useTranslation();
|
|
43
45
|
const isTablet = useLayoutType() === 'tablet';
|
|
@@ -89,6 +91,7 @@ const OrderableConceptSearchResults: React.FC<OrderableConceptSearchResultsProps
|
|
|
89
91
|
concept={concept}
|
|
90
92
|
orderTypeUuid={orderTypeUuid}
|
|
91
93
|
closeWorkspace={closeWorkspace}
|
|
94
|
+
patient={patient}
|
|
92
95
|
/>
|
|
93
96
|
))}
|
|
94
97
|
</div>
|
|
@@ -154,6 +157,7 @@ interface TestTypeSearchResultItemProps {
|
|
|
154
157
|
openOrderForm: (searchResult: OrderBasketItem) => void;
|
|
155
158
|
orderTypeUuid: string;
|
|
156
159
|
closeWorkspace: DefaultWorkspaceProps['closeWorkspace'];
|
|
160
|
+
patient: fhir.Patient;
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
const TestTypeSearchResultItem: React.FC<TestTypeSearchResultItemProps> = ({
|
|
@@ -161,11 +165,12 @@ const TestTypeSearchResultItem: React.FC<TestTypeSearchResultItemProps> = ({
|
|
|
161
165
|
openOrderForm,
|
|
162
166
|
orderTypeUuid,
|
|
163
167
|
closeWorkspace,
|
|
168
|
+
patient,
|
|
164
169
|
}) => {
|
|
165
170
|
const { t } = useTranslation();
|
|
166
171
|
const isTablet = useLayoutType() === 'tablet';
|
|
167
172
|
const session = useSession();
|
|
168
|
-
const { orders, setOrders } = useOrderBasket<OrderBasketItem>(orderTypeUuid, prepOrderPostData);
|
|
173
|
+
const { orders, setOrders } = useOrderBasket<OrderBasketItem>(patient, orderTypeUuid, prepOrderPostData);
|
|
169
174
|
|
|
170
175
|
const orderAlreadyInBasket = useMemo(
|
|
171
176
|
() => orders?.some((order) => order.concept.uuid === concept.uuid),
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useConfig,
|
|
11
11
|
useLayoutType,
|
|
12
12
|
useSession,
|
|
13
|
-
|
|
13
|
+
type Visit,
|
|
14
14
|
} from '@openmrs/esm-framework';
|
|
15
15
|
import {
|
|
16
16
|
type DefaultPatientWorkspaceProps,
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
postOrders,
|
|
20
20
|
postOrdersOnNewEncounter,
|
|
21
21
|
useOrderBasket,
|
|
22
|
-
useVisitOrOfflineVisit,
|
|
23
22
|
} from '@openmrs/esm-patient-common-lib';
|
|
24
23
|
import { useSWRConfig } from 'swr';
|
|
25
24
|
import { type ConfigObject } from '../config-schema';
|
|
@@ -27,18 +26,27 @@ import { useMutatePatientOrders, useOrderEncounter } from '../api/api';
|
|
|
27
26
|
import GeneralOrderType from './general-order-type/general-order-type.component';
|
|
28
27
|
import styles from './order-basket.scss';
|
|
29
28
|
|
|
29
|
+
interface OrderBasketSlotProps {
|
|
30
|
+
patientUuid: string;
|
|
31
|
+
patient: fhir.Patient;
|
|
32
|
+
visitContext: Visit;
|
|
33
|
+
mutateVisitContext: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
31
37
|
patientUuid,
|
|
38
|
+
patient,
|
|
32
39
|
closeWorkspace,
|
|
33
40
|
closeWorkspaceWithSavedChanges,
|
|
34
41
|
promptBeforeClosing,
|
|
42
|
+
visitContext,
|
|
43
|
+
mutateVisitContext,
|
|
35
44
|
}) => {
|
|
36
45
|
const { t } = useTranslation();
|
|
37
46
|
const isTablet = useLayoutType() === 'tablet';
|
|
38
47
|
const config = useConfig<ConfigObject>();
|
|
39
48
|
const session = useSession();
|
|
40
|
-
const {
|
|
41
|
-
const { orders, clearOrders } = useOrderBasket();
|
|
49
|
+
const { orders, clearOrders } = useOrderBasket(patient);
|
|
42
50
|
const [ordersWithErrors, setOrdersWithErrors] = useState<OrderBasketItem[]>([]);
|
|
43
51
|
const {
|
|
44
52
|
visitRequired,
|
|
@@ -46,11 +54,10 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
46
54
|
encounterUuid,
|
|
47
55
|
error: errorFetchingEncounterUuid,
|
|
48
56
|
mutate: mutateEncounterUuid,
|
|
49
|
-
} = useOrderEncounter(patientUuid, config.orderEncounterType);
|
|
57
|
+
} = useOrderEncounter(patientUuid, visitContext, mutateVisitContext, config.orderEncounterType);
|
|
50
58
|
const [isSavingOrders, setIsSavingOrders] = useState(false);
|
|
51
59
|
const [creatingEncounterError, setCreatingEncounterError] = useState('');
|
|
52
60
|
const { mutate: mutateOrders } = useMutatePatientOrders(patientUuid);
|
|
53
|
-
const { mutate: mutateCurrentVisit } = useVisit(patientUuid);
|
|
54
61
|
const { mutate } = useSWRConfig();
|
|
55
62
|
|
|
56
63
|
useEffect(() => {
|
|
@@ -75,14 +82,13 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
75
82
|
await postOrdersOnNewEncounter(
|
|
76
83
|
patientUuid,
|
|
77
84
|
config?.orderEncounterType,
|
|
78
|
-
visitRequired ?
|
|
85
|
+
visitRequired ? visitContext : null,
|
|
79
86
|
session?.sessionLocation?.uuid,
|
|
80
87
|
abortController,
|
|
81
88
|
);
|
|
82
89
|
mutateEncounterUuid();
|
|
83
90
|
// Only revalidate current visit since orders create new encounters
|
|
84
|
-
|
|
85
|
-
invalidateVisitAndEncounterData(mutate, patientUuid);
|
|
91
|
+
mutateVisitContext?.();
|
|
86
92
|
clearOrders();
|
|
87
93
|
await mutateOrders();
|
|
88
94
|
|
|
@@ -99,7 +105,7 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
99
105
|
const erroredItems = await postOrders(patientUuid, orderEncounterUuid, abortController);
|
|
100
106
|
clearOrders({ exceptThoseMatching: (item) => erroredItems.map((e) => e.display).includes(item.display) });
|
|
101
107
|
// Only revalidate current visit since orders create new encounters
|
|
102
|
-
|
|
108
|
+
mutateVisitContext?.();
|
|
103
109
|
await mutateOrders();
|
|
104
110
|
invalidateVisitAndEncounterData(mutate, patientUuid);
|
|
105
111
|
|
|
@@ -113,7 +119,7 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
113
119
|
setIsSavingOrders(false);
|
|
114
120
|
return () => abortController.abort();
|
|
115
121
|
}, [
|
|
116
|
-
|
|
122
|
+
visitContext,
|
|
117
123
|
visitRequired,
|
|
118
124
|
clearOrders,
|
|
119
125
|
closeWorkspaceWithSavedChanges,
|
|
@@ -121,7 +127,7 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
121
127
|
encounterUuid,
|
|
122
128
|
mutateEncounterUuid,
|
|
123
129
|
mutateOrders,
|
|
124
|
-
|
|
130
|
+
mutateVisitContext,
|
|
125
131
|
orders,
|
|
126
132
|
patientUuid,
|
|
127
133
|
session,
|
|
@@ -133,21 +139,36 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
133
139
|
closeWorkspace({ onWorkspaceClose: clearOrders });
|
|
134
140
|
}, [clearOrders, closeWorkspace]);
|
|
135
141
|
|
|
142
|
+
const extensionProps = {
|
|
143
|
+
patientUuid,
|
|
144
|
+
patient,
|
|
145
|
+
visitContext,
|
|
146
|
+
mutateVisitContext,
|
|
147
|
+
} satisfies OrderBasketSlotProps;
|
|
148
|
+
|
|
136
149
|
return (
|
|
137
150
|
<>
|
|
138
151
|
<div className={styles.container}>
|
|
139
|
-
<ExtensionSlot name="visit-context-header-slot" state={
|
|
152
|
+
<ExtensionSlot name="visit-context-header-slot" state={extensionProps} />
|
|
140
153
|
<div className={styles.orderBasketContainer}>
|
|
141
154
|
<ExtensionSlot
|
|
142
155
|
className={classNames(styles.orderBasketSlot, {
|
|
143
156
|
[styles.orderBasketSlotTablet]: isTablet,
|
|
144
157
|
})}
|
|
145
158
|
name="order-basket-slot"
|
|
159
|
+
state={extensionProps}
|
|
146
160
|
/>
|
|
147
161
|
{config?.orderTypes?.length > 0 &&
|
|
148
162
|
config.orderTypes.map((orderType) => (
|
|
149
163
|
<div className={styles.orderPanel} key={orderType.orderTypeUuid}>
|
|
150
|
-
<GeneralOrderType
|
|
164
|
+
<GeneralOrderType
|
|
165
|
+
key={orderType.orderTypeUuid}
|
|
166
|
+
orderTypeUuid={orderType.orderTypeUuid}
|
|
167
|
+
label={orderType.label}
|
|
168
|
+
orderableConceptSets={orderType.orderableConceptSets}
|
|
169
|
+
closeWorkspace={closeWorkspace}
|
|
170
|
+
patient={patient}
|
|
171
|
+
/>
|
|
151
172
|
</div>
|
|
152
173
|
))}
|
|
153
174
|
</div>
|
|
@@ -183,7 +204,7 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
183
204
|
isSavingOrders ||
|
|
184
205
|
!orders?.length ||
|
|
185
206
|
isLoadingEncounterUuid ||
|
|
186
|
-
(visitRequired && !
|
|
207
|
+
(visitRequired && !visitContext) ||
|
|
187
208
|
orders?.some(({ isOrderIncomplete }) => isOrderIncomplete)
|
|
188
209
|
}
|
|
189
210
|
>
|
|
@@ -196,7 +217,7 @@ const OrderBasket: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
196
217
|
</ButtonSet>
|
|
197
218
|
</div>
|
|
198
219
|
</div>
|
|
199
|
-
{visitRequired && !
|
|
220
|
+
{visitRequired && !visitContext && (
|
|
200
221
|
<ActionableNotification
|
|
201
222
|
kind="error"
|
|
202
223
|
actionButtonLabel={t('startVisit', 'Start visit')}
|