@openmrs/esm-patient-orders-app 11.3.1-pre.9388 → 11.3.1-pre.9390
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 +10 -13
- package/dist/1571.js +1 -1
- package/dist/1571.js.map +1 -1
- package/dist/2717.js +1 -0
- package/dist/2717.js.map +1 -0
- package/dist/4300.js +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/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 +42 -42
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/components/test-order.component.tsx +53 -49
- package/src/lab-results/lab-results-form.component.tsx +121 -41
- package/src/lab-results/lab-results-form.test.tsx +432 -283
- package/src/lab-results/lab-results-schema.resource.tsx +13 -4
- package/src/lab-results/lab-results.resource.ts +113 -0
- package/translations/en.json +2 -0
- package/dist/7202.js +0 -1
- package/dist/7202.js.map +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.3504",(()=>Promise.all([j.e(5134),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.3504",(()=>Promise.all([j.e(5134),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.9390",(()=>Promise.all([j.e(5134),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(5134),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(5134),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": "634940a33e54f674",
|
|
52
52
|
"childrenByOrder": {}
|
|
53
53
|
},
|
|
54
54
|
{
|
|
@@ -231,9 +231,9 @@
|
|
|
231
231
|
"initial": false,
|
|
232
232
|
"entry": false,
|
|
233
233
|
"recorded": false,
|
|
234
|
-
"size":
|
|
234
|
+
"size": 89187,
|
|
235
235
|
"sizes": {
|
|
236
|
-
"javascript":
|
|
236
|
+
"javascript": 89187
|
|
237
237
|
},
|
|
238
238
|
"names": [],
|
|
239
239
|
"idHints": [],
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
"auxiliaryFiles": [
|
|
248
248
|
"1571.js.map"
|
|
249
249
|
],
|
|
250
|
-
"hash": "
|
|
250
|
+
"hash": "cb0b5d57f8cb62a7",
|
|
251
251
|
"childrenByOrder": {}
|
|
252
252
|
},
|
|
253
253
|
{
|
|
@@ -372,6 +372,30 @@
|
|
|
372
372
|
"hash": "dd7d0bc9b366d595",
|
|
373
373
|
"childrenByOrder": {}
|
|
374
374
|
},
|
|
375
|
+
{
|
|
376
|
+
"rendered": true,
|
|
377
|
+
"initial": false,
|
|
378
|
+
"entry": false,
|
|
379
|
+
"recorded": false,
|
|
380
|
+
"size": 138371,
|
|
381
|
+
"sizes": {
|
|
382
|
+
"javascript": 138371
|
|
383
|
+
},
|
|
384
|
+
"names": [],
|
|
385
|
+
"idHints": [],
|
|
386
|
+
"runtime": [
|
|
387
|
+
"@openmrs/esm-patient-orders-app",
|
|
388
|
+
"main"
|
|
389
|
+
],
|
|
390
|
+
"files": [
|
|
391
|
+
"2717.js"
|
|
392
|
+
],
|
|
393
|
+
"auxiliaryFiles": [
|
|
394
|
+
"2717.js.map"
|
|
395
|
+
],
|
|
396
|
+
"hash": "2e152dbafb534a1d",
|
|
397
|
+
"childrenByOrder": {}
|
|
398
|
+
},
|
|
375
399
|
{
|
|
376
400
|
"rendered": true,
|
|
377
401
|
"initial": false,
|
|
@@ -585,9 +609,9 @@
|
|
|
585
609
|
"initial": false,
|
|
586
610
|
"entry": false,
|
|
587
611
|
"recorded": false,
|
|
588
|
-
"size":
|
|
612
|
+
"size": 5009,
|
|
589
613
|
"sizes": {
|
|
590
|
-
"javascript":
|
|
614
|
+
"javascript": 5009
|
|
591
615
|
},
|
|
592
616
|
"names": [],
|
|
593
617
|
"idHints": [],
|
|
@@ -599,7 +623,7 @@
|
|
|
599
623
|
"4300.js"
|
|
600
624
|
],
|
|
601
625
|
"auxiliaryFiles": [],
|
|
602
|
-
"hash": "
|
|
626
|
+
"hash": "d422049e939b083c",
|
|
603
627
|
"childrenByOrder": {}
|
|
604
628
|
},
|
|
605
629
|
{
|
|
@@ -993,7 +1017,7 @@
|
|
|
993
1017
|
"auxiliaryFiles": [
|
|
994
1018
|
"6542.js.map"
|
|
995
1019
|
],
|
|
996
|
-
"hash": "
|
|
1020
|
+
"hash": "6839facbca7d3f48",
|
|
997
1021
|
"childrenByOrder": {}
|
|
998
1022
|
},
|
|
999
1023
|
{
|
|
@@ -1181,30 +1205,6 @@
|
|
|
1181
1205
|
"hash": "648bab76e9ecbf7e",
|
|
1182
1206
|
"childrenByOrder": {}
|
|
1183
1207
|
},
|
|
1184
|
-
{
|
|
1185
|
-
"rendered": true,
|
|
1186
|
-
"initial": false,
|
|
1187
|
-
"entry": false,
|
|
1188
|
-
"recorded": false,
|
|
1189
|
-
"size": 138371,
|
|
1190
|
-
"sizes": {
|
|
1191
|
-
"javascript": 138371
|
|
1192
|
-
},
|
|
1193
|
-
"names": [],
|
|
1194
|
-
"idHints": [],
|
|
1195
|
-
"runtime": [
|
|
1196
|
-
"@openmrs/esm-patient-orders-app",
|
|
1197
|
-
"main"
|
|
1198
|
-
],
|
|
1199
|
-
"files": [
|
|
1200
|
-
"7202.js"
|
|
1201
|
-
],
|
|
1202
|
-
"auxiliaryFiles": [
|
|
1203
|
-
"7202.js.map"
|
|
1204
|
-
],
|
|
1205
|
-
"hash": "e9b7b095c9b65bea",
|
|
1206
|
-
"childrenByOrder": {}
|
|
1207
|
-
},
|
|
1208
1208
|
{
|
|
1209
1209
|
"rendered": true,
|
|
1210
1210
|
"initial": false,
|
|
@@ -1299,7 +1299,7 @@
|
|
|
1299
1299
|
"auxiliaryFiles": [
|
|
1300
1300
|
"8154.js.map"
|
|
1301
1301
|
],
|
|
1302
|
-
"hash": "
|
|
1302
|
+
"hash": "4e23aa4f55c34a04",
|
|
1303
1303
|
"childrenByOrder": {}
|
|
1304
1304
|
},
|
|
1305
1305
|
{
|
|
@@ -1395,9 +1395,9 @@
|
|
|
1395
1395
|
"initial": false,
|
|
1396
1396
|
"entry": false,
|
|
1397
1397
|
"recorded": false,
|
|
1398
|
-
"size":
|
|
1398
|
+
"size": 288526,
|
|
1399
1399
|
"sizes": {
|
|
1400
|
-
"javascript":
|
|
1400
|
+
"javascript": 288484,
|
|
1401
1401
|
"consume-shared": 42
|
|
1402
1402
|
},
|
|
1403
1403
|
"names": [],
|
|
@@ -1411,7 +1411,7 @@
|
|
|
1411
1411
|
"auxiliaryFiles": [
|
|
1412
1412
|
"8625.js.map"
|
|
1413
1413
|
],
|
|
1414
|
-
"hash": "
|
|
1414
|
+
"hash": "34a2b7c59d4bb3a6",
|
|
1415
1415
|
"childrenByOrder": {}
|
|
1416
1416
|
},
|
|
1417
1417
|
{
|
|
@@ -1440,10 +1440,10 @@
|
|
|
1440
1440
|
"initial": true,
|
|
1441
1441
|
"entry": true,
|
|
1442
1442
|
"recorded": false,
|
|
1443
|
-
"size":
|
|
1443
|
+
"size": 3252303,
|
|
1444
1444
|
"sizes": {
|
|
1445
1445
|
"consume-shared": 294,
|
|
1446
|
-
"javascript":
|
|
1446
|
+
"javascript": 3228927,
|
|
1447
1447
|
"share-init": 420,
|
|
1448
1448
|
"runtime": 22662
|
|
1449
1449
|
},
|
|
@@ -1460,7 +1460,7 @@
|
|
|
1460
1460
|
"auxiliaryFiles": [
|
|
1461
1461
|
"main.js.map"
|
|
1462
1462
|
],
|
|
1463
|
-
"hash": "
|
|
1463
|
+
"hash": "18f65bdca9fba676",
|
|
1464
1464
|
"childrenByOrder": {}
|
|
1465
1465
|
},
|
|
1466
1466
|
{
|
|
@@ -1469,9 +1469,9 @@
|
|
|
1469
1469
|
"entry": false,
|
|
1470
1470
|
"recorded": false,
|
|
1471
1471
|
"reason": "reused as split chunk (cache group: default)",
|
|
1472
|
-
"size":
|
|
1472
|
+
"size": 251776,
|
|
1473
1473
|
"sizes": {
|
|
1474
|
-
"javascript":
|
|
1474
|
+
"javascript": 251776
|
|
1475
1475
|
},
|
|
1476
1476
|
"names": [],
|
|
1477
1477
|
"idHints": [],
|
|
@@ -1485,7 +1485,7 @@
|
|
|
1485
1485
|
"auxiliaryFiles": [
|
|
1486
1486
|
"8803.js.map"
|
|
1487
1487
|
],
|
|
1488
|
-
"hash": "
|
|
1488
|
+
"hash": "8525371c7f8063c0",
|
|
1489
1489
|
"childrenByOrder": {}
|
|
1490
1490
|
},
|
|
1491
1491
|
{
|
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.9390"}
|
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.9390",
|
|
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.9390",
|
|
56
56
|
"webpack": "^5.99.9"
|
|
57
57
|
},
|
|
58
58
|
"stableVersion": "11.3.0"
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
TableHeader,
|
|
15
15
|
TableRow,
|
|
16
16
|
} from '@carbon/react';
|
|
17
|
-
import { useLabEncounter, useOrderConceptByUuid } from '../lab-results/lab-results.resource';
|
|
17
|
+
import { useLabEncounter, useOrderConceptByUuid, useOrderConceptsByUuids } from '../lab-results/lab-results.resource';
|
|
18
18
|
import { getObservationDisplayValue } from '../utils';
|
|
19
19
|
import styles from './test-order.scss';
|
|
20
20
|
|
|
@@ -46,52 +46,56 @@ const TestOrder: React.FC<TestOrderProps> = ({ testOrder }) => {
|
|
|
46
46
|
[t, testOrder?.orderType?.display],
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
const testResultObs = useMemo(() => {
|
|
50
|
-
if (!encounter
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const [testResultObs, obsUuids] = useMemo(() => {
|
|
50
|
+
if (!encounter) return [[], []];
|
|
51
|
+
const testObs = encounter.obs?.filter((obs) => obs.order?.uuid === testOrder.uuid) ?? [];
|
|
52
|
+
return [testObs, testObs.map((obs) => obs.concept?.uuid).filter(Boolean)];
|
|
53
|
+
}, [encounter, testOrder.uuid]);
|
|
54
|
+
|
|
55
|
+
const { isLoading: isLoadingResultsConcepts, concepts: conceptList } = useOrderConceptsByUuids(obsUuids);
|
|
53
56
|
|
|
54
57
|
const testRows = useMemo(() => {
|
|
55
|
-
if (!
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
resultValue
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
resultValue
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
58
|
+
if (!Array.isArray(testResultObs) || testResultObs.length === 0) return [];
|
|
59
|
+
|
|
60
|
+
return testResultObs.flatMap((obs) => {
|
|
61
|
+
const concept = conceptList.find((c) => c.uuid === obs.concept.uuid);
|
|
62
|
+
if (!concept) return [];
|
|
63
|
+
|
|
64
|
+
// Handle panel tests (with set members / groupMembers)
|
|
65
|
+
if (concept.setMembers && concept.setMembers.length > 0) {
|
|
66
|
+
return concept.setMembers.map((memberConcept) => {
|
|
67
|
+
const memberObs = obs.groupMembers?.find((gm) => gm.concept.uuid === memberConcept.uuid);
|
|
68
|
+
|
|
69
|
+
let resultValue: React.ReactNode;
|
|
70
|
+
if (isLoadingResult) {
|
|
71
|
+
resultValue = <SkeletonText />;
|
|
72
|
+
} else if (memberObs) {
|
|
73
|
+
resultValue = getObservationDisplayValue(memberObs.value ?? memberObs);
|
|
74
|
+
} else {
|
|
75
|
+
resultValue = '--';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
id: memberConcept.uuid,
|
|
80
|
+
testType: <div className={styles.testType}>{memberConcept.display || '--'}</div>,
|
|
81
|
+
result: resultValue,
|
|
82
|
+
normalRange:
|
|
83
|
+
memberConcept.lowNormal != null && memberConcept.hiNormal != null
|
|
84
|
+
? `${memberConcept.lowNormal} - ${memberConcept.hiNormal}`
|
|
85
|
+
: t('notApplicable', 'Not applicable'),
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Handle single test (no set members)
|
|
91
|
+
let resultValue: React.ReactNode;
|
|
92
|
+
if (isLoadingResult) {
|
|
93
|
+
resultValue = <SkeletonText />;
|
|
94
|
+
} else {
|
|
95
|
+
resultValue = getObservationDisplayValue(obs.value ?? obs);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
95
99
|
id: concept.uuid,
|
|
96
100
|
testType: <div className={styles.testType}>{concept.display || '--'}</div>,
|
|
97
101
|
result: resultValue,
|
|
@@ -99,11 +103,11 @@ const TestOrder: React.FC<TestOrderProps> = ({ testOrder }) => {
|
|
|
99
103
|
concept.lowNormal != null && concept.hiNormal != null
|
|
100
104
|
? `${concept.lowNormal} - ${concept.hiNormal}`
|
|
101
105
|
: t('notApplicable', 'Not applicable'),
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
}, [
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
}, [isLoadingResult, testResultObs, conceptList, t]);
|
|
105
109
|
|
|
106
|
-
if (
|
|
110
|
+
if (isLoadingResultsConcepts || isLoadingResult) {
|
|
107
111
|
return <DataTableSkeleton role="progressbar" compact={!isTablet} zebra />;
|
|
108
112
|
}
|
|
109
113
|
|
|
@@ -5,30 +5,41 @@ import { type Control, useForm } from 'react-hook-form';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useSWRConfig } from 'swr';
|
|
7
7
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
restBaseUrl,
|
|
10
|
+
showSnackbar,
|
|
11
|
+
useAbortController,
|
|
12
|
+
useLayoutType,
|
|
13
|
+
ExtensionSlot,
|
|
14
|
+
usePatient,
|
|
15
|
+
} from '@openmrs/esm-framework';
|
|
16
|
+
import { type DefaultPatientWorkspaceProps, type Order, useOrderBasket } from '@openmrs/esm-patient-common-lib';
|
|
10
17
|
import { type ObservationValue } from '../types/encounter';
|
|
11
18
|
import {
|
|
12
|
-
|
|
19
|
+
createCompositeObservationPayload,
|
|
13
20
|
isCoded,
|
|
14
21
|
isNumeric,
|
|
15
22
|
isPanel,
|
|
16
23
|
isText,
|
|
17
24
|
updateObservation,
|
|
18
25
|
updateOrderResult,
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
useCompletedLabResultsArray,
|
|
27
|
+
useOrderConceptsByUuids,
|
|
21
28
|
} from './lab-results.resource';
|
|
22
|
-
import {
|
|
23
|
-
|
|
29
|
+
import { createLabResultsFormCompositeSchema } from './lab-results-schema.resource';
|
|
24
30
|
import ResultFormField from './lab-results-form-field.component';
|
|
25
31
|
import styles from './lab-results-form.scss';
|
|
32
|
+
import orderStyles from '../order-basket/order-basket.scss';
|
|
26
33
|
|
|
27
34
|
export interface LabResultsFormProps extends DefaultPatientWorkspaceProps {
|
|
28
35
|
order: Order;
|
|
29
36
|
invalidateLabOrders?: () => void;
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
interface OrderBasketSlotProps {
|
|
40
|
+
patient: fhir.Patient;
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
33
44
|
closeWorkspace,
|
|
34
45
|
closeWorkspaceWithSavedChanges,
|
|
@@ -43,11 +54,15 @@ const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
|
43
54
|
const { t } = useTranslation();
|
|
44
55
|
const abortController = useAbortController();
|
|
45
56
|
const isTablet = useLayoutType() === 'tablet';
|
|
46
|
-
const
|
|
57
|
+
const [orderConceptUuids, setOrderConceptUuids] = useState([order.concept.uuid]);
|
|
58
|
+
const { isLoading: isLoadingResultConcepts, concepts: conceptArray } = useOrderConceptsByUuids(orderConceptUuids);
|
|
47
59
|
const [showEmptyFormErrorNotification, setShowEmptyFormErrorNotification] = useState(false);
|
|
48
|
-
const
|
|
49
|
-
const { completeLabResult, isLoading, mutate: mutateResults } = useCompletedLabResults(order);
|
|
60
|
+
const compositeSchema = useMemo(() => createLabResultsFormCompositeSchema(conceptArray), [conceptArray]);
|
|
50
61
|
const { mutate } = useSWRConfig();
|
|
62
|
+
const { isLoading: isLoadingPatient, patient } = usePatient(order.patient.uuid);
|
|
63
|
+
const { orders, clearOrders } = useOrderBasket(patient);
|
|
64
|
+
const [isSavingOrders, setIsSavingOrders] = useState(false);
|
|
65
|
+
const { isLoading, completeLabResults, mutate: mutateResults } = useCompletedLabResultsArray(order);
|
|
51
66
|
|
|
52
67
|
const mutateOrderData = useCallback(() => {
|
|
53
68
|
mutate(
|
|
@@ -57,6 +72,16 @@ const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
|
57
72
|
);
|
|
58
73
|
}, [mutate, order.patient.uuid]);
|
|
59
74
|
|
|
75
|
+
const handleCancel = useCallback(() => {
|
|
76
|
+
clearOrders();
|
|
77
|
+
}, [clearOrders]);
|
|
78
|
+
|
|
79
|
+
const handleSave = useCallback(() => {
|
|
80
|
+
const newConceptUuids = orders.map((order) => order['testType']['conceptUuid']);
|
|
81
|
+
setOrderConceptUuids([order.concept.uuid, ...newConceptUuids]);
|
|
82
|
+
clearOrders();
|
|
83
|
+
}, [clearOrders, orders, order.concept.uuid]);
|
|
84
|
+
|
|
60
85
|
const {
|
|
61
86
|
control,
|
|
62
87
|
formState: { errors, isDirty, isSubmitting },
|
|
@@ -64,40 +89,53 @@ const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
|
64
89
|
handleSubmit,
|
|
65
90
|
} = useForm<Record<string, ObservationValue>>({
|
|
66
91
|
defaultValues: {} as Record<string, ObservationValue>,
|
|
67
|
-
resolver: zodResolver(
|
|
92
|
+
resolver: zodResolver(compositeSchema),
|
|
68
93
|
mode: 'all',
|
|
69
94
|
});
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (Array.isArray(completeLabResults) && completeLabResults.length > 1) {
|
|
97
|
+
const conceptUuids = completeLabResults.map((r) => r.concept.uuid);
|
|
98
|
+
setOrderConceptUuids(conceptUuids);
|
|
99
|
+
}
|
|
100
|
+
}, [completeLabResults]);
|
|
101
|
+
|
|
102
|
+
const extensionProps = {
|
|
103
|
+
patient,
|
|
104
|
+
} satisfies OrderBasketSlotProps;
|
|
70
105
|
|
|
71
106
|
useEffect(() => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
conceptArray.forEach((concept, index) => {
|
|
108
|
+
const completeLabResult = completeLabResults.find((r) => r.concept.uuid === concept.uuid);
|
|
109
|
+
if (concept && completeLabResult && order?.fulfillerStatus === 'COMPLETED') {
|
|
110
|
+
if (isCoded(concept) && typeof completeLabResult?.value === 'object' && completeLabResult?.value?.uuid) {
|
|
111
|
+
setValue(concept.uuid, completeLabResult.value.uuid);
|
|
112
|
+
} else if (isNumeric(concept) && completeLabResult?.value) {
|
|
113
|
+
setValue(concept.uuid, parseFloat(completeLabResult.value as string));
|
|
114
|
+
} else if (isText(concept) && completeLabResult?.value) {
|
|
115
|
+
setValue(concept.uuid, completeLabResult?.value);
|
|
116
|
+
} else if (isPanel(concept)) {
|
|
117
|
+
concept.setMembers.forEach((member) => {
|
|
118
|
+
const obs = completeLabResult.groupMembers.find((v) => v.concept.uuid === member.uuid);
|
|
119
|
+
let value: ObservationValue;
|
|
120
|
+
if (isCoded(member)) {
|
|
121
|
+
value = typeof obs?.value === 'object' ? obs.value.uuid : obs?.value;
|
|
122
|
+
} else if (isNumeric(member)) {
|
|
123
|
+
value = obs?.value ? parseFloat(obs.value as string) : undefined;
|
|
124
|
+
} else if (isText(member)) {
|
|
125
|
+
value = obs?.value;
|
|
126
|
+
}
|
|
127
|
+
if (value) setValue(member.uuid, value);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
92
130
|
}
|
|
93
|
-
}
|
|
94
|
-
}, [
|
|
131
|
+
});
|
|
132
|
+
}, [conceptArray, completeLabResults, order?.fulfillerStatus, setValue]);
|
|
95
133
|
|
|
96
134
|
useEffect(() => {
|
|
97
135
|
promptBeforeClosing(() => isDirty);
|
|
98
136
|
}, [isDirty, promptBeforeClosing]);
|
|
99
137
|
|
|
100
|
-
if (
|
|
138
|
+
if (isLoadingResultConcepts) {
|
|
101
139
|
return (
|
|
102
140
|
<div className={styles.loaderContainer}>
|
|
103
141
|
<InlineLoading
|
|
@@ -133,6 +171,7 @@ const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
|
133
171
|
// Handle update operation for completed lab order results
|
|
134
172
|
if (order.fulfillerStatus === 'COMPLETED') {
|
|
135
173
|
const updateTasks = Object.entries(formValues).map(([conceptUuid, value]) => {
|
|
174
|
+
const completeLabResult = completeLabResults.find((r) => r.concept.uuid === conceptUuid);
|
|
136
175
|
const obs = completeLabResult?.groupMembers?.find((v) => v.concept.uuid === conceptUuid) ?? completeLabResult;
|
|
137
176
|
return updateObservation(obs?.uuid, { value });
|
|
138
177
|
});
|
|
@@ -162,7 +201,7 @@ const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
|
162
201
|
// Handle Creation logic
|
|
163
202
|
|
|
164
203
|
// Set the observation status to 'FINAL' as we're not capturing it in the form
|
|
165
|
-
const obsPayload =
|
|
204
|
+
const obsPayload = createCompositeObservationPayload(conceptArray, order, formValues, 'FINAL');
|
|
166
205
|
const orderDiscontinuationPayload = {
|
|
167
206
|
previousOrder: order.uuid,
|
|
168
207
|
type: 'testorder',
|
|
@@ -210,17 +249,58 @@ const LabResultsForm: React.FC<LabResultsFormProps> = ({
|
|
|
210
249
|
<Form className={styles.form} onSubmit={handleSubmit(saveLabResults)}>
|
|
211
250
|
<Layer level={isTablet ? 1 : 0}>
|
|
212
251
|
<div className={styles.grid}>
|
|
213
|
-
{
|
|
252
|
+
{conceptArray?.length > 0 && (
|
|
214
253
|
<Stack gap={5}>
|
|
215
254
|
{!isLoading ? (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
255
|
+
conceptArray.map((c) => (
|
|
256
|
+
<ResultFormField
|
|
257
|
+
defaultValue={completeLabResults.find((r) => r.concept.uuid === c.uuid)}
|
|
258
|
+
concept={c}
|
|
259
|
+
control={control as unknown as Control<Record<string, unknown>>}
|
|
260
|
+
/>
|
|
261
|
+
))
|
|
221
262
|
) : (
|
|
222
263
|
<InlineLoading description={t('loadingInitialValues', 'Loading initial values') + '...'} />
|
|
223
264
|
)}
|
|
265
|
+
{order.fulfillerStatus !== 'COMPLETED' && (
|
|
266
|
+
<div className={orderStyles.orderBasketContainer}>
|
|
267
|
+
<div className={styles.heading}>
|
|
268
|
+
<span>{t('addOrderTests', 'Add Tests to this order')}</span>
|
|
269
|
+
</div>
|
|
270
|
+
<ExtensionSlot
|
|
271
|
+
className={classNames(orderStyles.orderBasketSlot, {
|
|
272
|
+
[orderStyles.orderBasketSlotTablet]: isTablet,
|
|
273
|
+
})}
|
|
274
|
+
name="result-order-basket-slot"
|
|
275
|
+
state={extensionProps}
|
|
276
|
+
/>
|
|
277
|
+
</div>
|
|
278
|
+
)}
|
|
279
|
+
|
|
280
|
+
{orders?.length > 0 && (
|
|
281
|
+
<div className={orderStyles.orderBasketContainer}>
|
|
282
|
+
<ButtonSet className={styles.buttonSet}>
|
|
283
|
+
<Button size="sm" className={styles.actionButton} kind="secondary" onClick={handleCancel}>
|
|
284
|
+
{t('cancelOrder', 'Cancel order')}
|
|
285
|
+
</Button>
|
|
286
|
+
<Button
|
|
287
|
+
className={styles.actionButton}
|
|
288
|
+
kind="primary"
|
|
289
|
+
onClick={handleSave}
|
|
290
|
+
size="sm"
|
|
291
|
+
disabled={
|
|
292
|
+
isSavingOrders || !orders?.length || orders?.some(({ isOrderIncomplete }) => isOrderIncomplete)
|
|
293
|
+
}
|
|
294
|
+
>
|
|
295
|
+
{isSavingOrders ? (
|
|
296
|
+
<InlineLoading description={t('saving', 'Saving') + '...'} />
|
|
297
|
+
) : (
|
|
298
|
+
<span>{t('saveTests', 'Save Tests')}</span>
|
|
299
|
+
)}
|
|
300
|
+
</Button>
|
|
301
|
+
</ButtonSet>
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
224
304
|
</Stack>
|
|
225
305
|
)}
|
|
226
306
|
{showEmptyFormErrorNotification && (
|