@openmrs/esm-patient-tests-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 +4 -4
- package/dist/1479.js +1 -1
- package/dist/1479.js.map +1 -1
- package/dist/1935.js +1 -1
- package/dist/1935.js.map +1 -1
- package/dist/34.js +1 -1
- package/dist/34.js.map +1 -1
- package/dist/6231.js +1 -1
- package/dist/6231.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-tests-app.js +1 -1
- package/dist/openmrs-esm-patient-tests-app.js.buildmanifest.json +16 -16
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/test-orders/add-test-order/add-test-order.test.tsx +4 -10
- package/src/test-orders/add-test-order/add-test-order.workspace.tsx +8 -7
- package/src/test-orders/add-test-order/test-order-form.component.tsx +4 -1
- package/src/test-orders/add-test-order/test-type-search.component.tsx +9 -2
- package/src/test-orders/lab-order-basket-panel/lab-order-basket-panel.extension.tsx +19 -6
- package/src/test-orders/lab-order-basket-panel/lab-order-basket-panel.test.tsx +11 -3
- package/src/test-results/grouped-timeline/useObstreeData.ts +3 -5
- package/src/test-results/individual-results-table/individual-results-table.component.tsx +9 -3
- package/src/test-results/individual-results-table/individual-results-table.test.tsx +19 -2
- package/src/test-results/results-viewer/results-viewer.extension.tsx +2 -2
- package/src/test-results/tree-view/tree-view.component.tsx +14 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
var _openmrs_esm_patient_tests_app;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,u,p,f,c,d,h,m,v,g,b,y,w,_={38584:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(8307),t.e(1778),t.e(1343),t.e(5434),t.e(3205),t.e(6231)]).then((()=>()=>t(26231)))},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 S(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,S),t.exports}S.m=_,S.c=P,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,S.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);S.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,S.d(o,a),o},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-patient-tests-app:",S.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,S.nc&&i.setAttribute("nonce",S.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=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)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{S.S={};var e={},r={};S.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];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="@openmrs/esm-patient-tests-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([S.e(9540),S.e(8307),S.e(5670),S.e(1343),S.e(8010),S.e(5434),S.e(4818),S.e(3205)]).then((()=>()=>S(55670))))),s("@openmrs/esm-patient-common-lib","11.3.1-pre.
|
|
1
|
+
var _openmrs_esm_patient_tests_app;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,u,p,f,c,d,h,m,v,g,b,y,w,_={38584:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(8307),t.e(1778),t.e(1343),t.e(5434),t.e(3205),t.e(6231)]).then((()=>()=>t(26231)))},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 S(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,S),t.exports}S.m=_,S.c=P,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,S.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);S.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,S.d(o,a),o},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-patient-tests-app:",S.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,S.nc&&i.setAttribute("nonce",S.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=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)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{S.S={};var e={},r={};S.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];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="@openmrs/esm-patient-tests-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([S.e(9540),S.e(8307),S.e(5670),S.e(1343),S.e(8010),S.e(5434),S.e(4818),S.e(3205)]).then((()=>()=>S(55670))))),s("@openmrs/esm-patient-common-lib","11.3.1-pre.9296",(()=>Promise.all([S.e(9540),S.e(8307),S.e(1343),S.e(8010),S.e(5434),S.e(4818),S.e(3205),S.e(34),S.e(7473)]).then((()=>()=>S(60034))))),s("react-i18next","16.0.0",(()=>Promise.all([S.e(6336),S.e(1343)]).then((()=>()=>S(16336))))),s("react-router-dom","6.16.0",(()=>Promise.all([S.e(2913),S.e(1343)]).then((()=>()=>S(52913))))),s("react","18.3.1",(()=>S.e(4041).then((()=>()=>S(14041))))),s("rxjs","6.6.7",(()=>S.e(2457).then((()=>()=>S(82457))))),s("swr/_internal","2.2.5",(()=>Promise.all([S.e(2372),S.e(1343)]).then((()=>()=>S(42372))))),s("swr/immutable","2.2.5",(()=>Promise.all([S.e(1343),S.e(5434),S.e(7495)]).then((()=>()=>S(29876))))),s("swr/infinite","2.2.5",(()=>Promise.all([S.e(1343),S.e(5434),S.e(89)]).then((()=>()=>S(52470)))))),e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.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(/\/[^\/]+$/,"/"),S.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 c=[],d=c.pop.bind(c);for(a=1;a<e.length;a++){var h=e[a];c.push(1==h?d()|d():2==h?d()&d():h?s(h,r):!d())}return!!d()},l=(e,r)=>e&&S.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)},c=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",d=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>d("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,o,a){var i=S.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,S.S[r],t,!1,o,a)):e(r,S.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(c(r,t,i,o)),u(r[t][i])})),g={},b={1343:()=>v("default","react",!1,[1,18],(()=>S.e(4041).then((()=>()=>S(14041))))),88010:()=>v("default","swr/immutable",!1,[1,2],(()=>S.e(9876).then((()=>()=>S(29876))))),55434:()=>v("default","swr/_internal",!1,[1,2],(()=>S.e(2372).then((()=>()=>S(42372))))),24818:()=>v("default","rxjs",!1,[1,6],(()=>S.e(2457).then((()=>()=>S(82457))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>S.e(2913).then((()=>()=>S(52913))))),54440:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([S.e(9540),S.e(5670),S.e(8010),S.e(4818)]).then((()=>()=>S(55670))))),72339:()=>v("default","react-i18next",!1,[1,16],(()=>S.e(6336).then((()=>()=>S(16336))))),98394:()=>v("default","swr/infinite",!1,[1,2],(()=>S.e(2470).then((()=>()=>S(52470))))),36274:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,11],(()=>Promise.all([S.e(9540),S.e(8010),S.e(4818),S.e(34)]).then((()=>()=>S(60034)))))},y={1343:[1343],3205:[8877,54440,72339,98394],4818:[24818],5434:[55434],6231:[36274],8010:[88010]},w={},S.f.consumes=(e,r)=>{S.o(y,e)&&y[e].forEach((e=>{if(S.o(g,e))return r.push(g[e]);if(!w[e]){var t=r=>{g[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete g[e],S.m[e]=t=>{throw delete S.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={7773:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(1343|3205|4818|5434|8010)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=S.p+S.u(r),i=new Error;S.l(a,(t=>{if(S.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)S.o(i,n)&&(S.m[n]=i[n]);s&&s(S)}for(r&&r(t);l<a.length;l++)o=a[l],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_patient_tests_app=globalThis.webpackChunk_openmrs_esm_patient_tests_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),S.nc=void 0;var j=S(38584);_openmrs_esm_patient_tests_app=j})();
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"entry": false,
|
|
7
7
|
"recorded": false,
|
|
8
8
|
"reason": "reused as split chunk (cache group: default)",
|
|
9
|
-
"size":
|
|
9
|
+
"size": 245542,
|
|
10
10
|
"sizes": {
|
|
11
|
-
"javascript":
|
|
11
|
+
"javascript": 245542
|
|
12
12
|
},
|
|
13
13
|
"names": [],
|
|
14
14
|
"idHints": [],
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"auxiliaryFiles": [
|
|
23
23
|
"34.js.map"
|
|
24
24
|
],
|
|
25
|
-
"hash": "
|
|
25
|
+
"hash": "c941eb34419d142f",
|
|
26
26
|
"childrenByOrder": {}
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -258,9 +258,9 @@
|
|
|
258
258
|
"initial": false,
|
|
259
259
|
"entry": false,
|
|
260
260
|
"recorded": false,
|
|
261
|
-
"size":
|
|
261
|
+
"size": 122009,
|
|
262
262
|
"sizes": {
|
|
263
|
-
"javascript":
|
|
263
|
+
"javascript": 122009
|
|
264
264
|
},
|
|
265
265
|
"names": [],
|
|
266
266
|
"idHints": [],
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
"auxiliaryFiles": [
|
|
275
275
|
"1479.js.map"
|
|
276
276
|
],
|
|
277
|
-
"hash": "
|
|
277
|
+
"hash": "6dd1195e0728d780",
|
|
278
278
|
"childrenByOrder": {}
|
|
279
279
|
},
|
|
280
280
|
{
|
|
@@ -335,9 +335,9 @@
|
|
|
335
335
|
"initial": false,
|
|
336
336
|
"entry": false,
|
|
337
337
|
"recorded": false,
|
|
338
|
-
"size":
|
|
338
|
+
"size": 174126,
|
|
339
339
|
"sizes": {
|
|
340
|
-
"javascript":
|
|
340
|
+
"javascript": 174126
|
|
341
341
|
},
|
|
342
342
|
"names": [],
|
|
343
343
|
"idHints": [],
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
"auxiliaryFiles": [
|
|
352
352
|
"1935.js.map"
|
|
353
353
|
],
|
|
354
|
-
"hash": "
|
|
354
|
+
"hash": "31522bc3686bf0a2",
|
|
355
355
|
"childrenByOrder": {}
|
|
356
356
|
},
|
|
357
357
|
{
|
|
@@ -954,9 +954,9 @@
|
|
|
954
954
|
"initial": false,
|
|
955
955
|
"entry": false,
|
|
956
956
|
"recorded": false,
|
|
957
|
-
"size":
|
|
957
|
+
"size": 749464,
|
|
958
958
|
"sizes": {
|
|
959
|
-
"javascript":
|
|
959
|
+
"javascript": 749422,
|
|
960
960
|
"consume-shared": 42
|
|
961
961
|
},
|
|
962
962
|
"names": [],
|
|
@@ -970,7 +970,7 @@
|
|
|
970
970
|
"auxiliaryFiles": [
|
|
971
971
|
"6231.js.map"
|
|
972
972
|
],
|
|
973
|
-
"hash": "
|
|
973
|
+
"hash": "d0c5ebd3578168ed",
|
|
974
974
|
"childrenByOrder": {}
|
|
975
975
|
},
|
|
976
976
|
{
|
|
@@ -1277,7 +1277,7 @@
|
|
|
1277
1277
|
"auxiliaryFiles": [
|
|
1278
1278
|
"openmrs-esm-patient-tests-app.js.map"
|
|
1279
1279
|
],
|
|
1280
|
-
"hash": "
|
|
1280
|
+
"hash": "8c271ea1292b56a3",
|
|
1281
1281
|
"childrenByOrder": {}
|
|
1282
1282
|
},
|
|
1283
1283
|
{
|
|
@@ -1399,10 +1399,10 @@
|
|
|
1399
1399
|
"initial": true,
|
|
1400
1400
|
"entry": true,
|
|
1401
1401
|
"recorded": false,
|
|
1402
|
-
"size":
|
|
1402
|
+
"size": 3746787,
|
|
1403
1403
|
"sizes": {
|
|
1404
1404
|
"consume-shared": 294,
|
|
1405
|
-
"javascript":
|
|
1405
|
+
"javascript": 3723575,
|
|
1406
1406
|
"share-init": 378,
|
|
1407
1407
|
"runtime": 22540
|
|
1408
1408
|
},
|
|
@@ -1419,7 +1419,7 @@
|
|
|
1419
1419
|
"auxiliaryFiles": [
|
|
1420
1420
|
"main.js.map"
|
|
1421
1421
|
],
|
|
1422
|
-
"hash": "
|
|
1422
|
+
"hash": "7fa855c94bc07305",
|
|
1423
1423
|
"childrenByOrder": {}
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
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"},"extensions":[{"name":"test-results-summary-dashboard","component":"testResultsDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"slot":"patient-chart-test-results-dashboard-slot","path":"Results","hideDashboardTitle":true,"layoutMode":"anchored"},"order":4},{"name":"test-results-filtered-overview","slot":"test-results-filtered-overview-slot","component":"externalOverview"},{"name":"results-viewer","slots":["patient-chart-results-viewer-slot","patient-chart-test-results-dashboard-slot"],"component":"resultsViewer"},{"name":"lab-order-panel","component":"labOrderPanel","slot":"order-basket-slot","order":2}],"modals":[{"name":"timeline-results-modal","component":"timelineResultsModal"},{"name":"print-modal","component":"printModal"},{"name":"edit-lab-results-modal","component":"editLabResultsModal"}],"workspaces":[{"name":"add-lab-order","type":"order","component":"addLabOrderWorkspace","title":"addLabOrderWorkspaceTitle"}],"version":"11.3.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"test-results-summary-dashboard","component":"testResultsDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"slot":"patient-chart-test-results-dashboard-slot","path":"Results","hideDashboardTitle":true,"layoutMode":"anchored"},"order":4},{"name":"test-results-filtered-overview","slot":"test-results-filtered-overview-slot","component":"externalOverview"},{"name":"results-viewer","slots":["patient-chart-results-viewer-slot","patient-chart-test-results-dashboard-slot"],"component":"resultsViewer"},{"name":"lab-order-panel","component":"labOrderPanel","slot":"order-basket-slot","order":2}],"modals":[{"name":"timeline-results-modal","component":"timelineResultsModal"},{"name":"print-modal","component":"printModal"},{"name":"edit-lab-results-modal","component":"editLabResultsModal"}],"workspaces":[{"name":"add-lab-order","type":"order","component":"addLabOrderWorkspace","title":"addLabOrderWorkspaceTitle"}],"version":"11.3.1-pre.9296"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-tests-app",
|
|
3
|
-
"version": "11.3.1-pre.
|
|
3
|
+
"version": "11.3.1-pre.9296",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Patient test order and results microfrontend for the OpenMRS SPA",
|
|
6
6
|
"browser": "dist/openmrs-esm-patient-tests-app.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"swr": "2.x"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@openmrs/esm-patient-common-lib": "11.3.1-pre.
|
|
56
|
+
"@openmrs/esm-patient-common-lib": "11.3.1-pre.9296",
|
|
57
57
|
"webpack": "^5.99.9"
|
|
58
58
|
},
|
|
59
59
|
"stableVersion": "11.3.0"
|
|
@@ -62,14 +62,6 @@ jest.mock('@openmrs/esm-patient-common-lib', () => ({
|
|
|
62
62
|
useOrderType: jest.fn(),
|
|
63
63
|
}));
|
|
64
64
|
|
|
65
|
-
jest.mock('@openmrs/esm-patient-common-lib/src/store/patient-chart-store', () => ({
|
|
66
|
-
getPatientUuidFromStore: jest.fn(() => mockPatient.id),
|
|
67
|
-
usePatientChartStore: jest.fn(() => ({
|
|
68
|
-
patientUuid: mockPatient.id,
|
|
69
|
-
patient: mockPatient,
|
|
70
|
-
})),
|
|
71
|
-
}));
|
|
72
|
-
|
|
73
65
|
function renderAddLabOrderWorkspace() {
|
|
74
66
|
const mockCloseWorkspace = jest.fn().mockImplementation(({ onWorkspaceClose }) => {
|
|
75
67
|
onWorkspaceClose();
|
|
@@ -87,6 +79,8 @@ function renderAddLabOrderWorkspace() {
|
|
|
87
79
|
patient={mockPatient}
|
|
88
80
|
setTitle={jest.fn()}
|
|
89
81
|
orderTypeUuid="test-lab-order-type-uuid"
|
|
82
|
+
visitContext={null}
|
|
83
|
+
mutateVisitContext={null}
|
|
90
84
|
/>,
|
|
91
85
|
);
|
|
92
86
|
return { mockCloseWorkspace, mockPromptBeforeClosing, mockCloseWorkspaceWithSavedChanges, ...view };
|
|
@@ -126,7 +120,7 @@ describe('AddLabOrder', () => {
|
|
|
126
120
|
test('happy path fill and submit form', async () => {
|
|
127
121
|
const user = userEvent.setup();
|
|
128
122
|
const { result: hookResult } = renderHook(() =>
|
|
129
|
-
useOrderBasket('test-lab-order-type-uuid', ((x) => x) as unknown as PostDataPrepLabOrderFunction),
|
|
123
|
+
useOrderBasket(mockPatient, 'test-lab-order-type-uuid', ((x) => x) as unknown as PostDataPrepLabOrderFunction),
|
|
130
124
|
);
|
|
131
125
|
const { mockCloseWorkspaceWithSavedChanges } = renderAddLabOrderWorkspace();
|
|
132
126
|
await user.type(screen.getByRole('searchbox'), 'cd4');
|
|
@@ -178,7 +172,7 @@ describe('AddLabOrder', () => {
|
|
|
178
172
|
test('from lab search, click add directly to order basket', async () => {
|
|
179
173
|
const user = userEvent.setup();
|
|
180
174
|
const { result: hookResult } = renderHook(() =>
|
|
181
|
-
useOrderBasket('test-lab-order-type-uuid', ((x) => x) as unknown as PostDataPrepFunction),
|
|
175
|
+
useOrderBasket(mockPatient, 'test-lab-order-type-uuid', ((x) => x) as unknown as PostDataPrepFunction),
|
|
182
176
|
);
|
|
183
177
|
renderAddLabOrderWorkspace();
|
|
184
178
|
await user.type(screen.getByRole('searchbox'), 'cd4');
|
|
@@ -13,12 +13,7 @@ import {
|
|
|
13
13
|
useLayoutType,
|
|
14
14
|
useConfig,
|
|
15
15
|
} from '@openmrs/esm-framework';
|
|
16
|
-
import {
|
|
17
|
-
type DefaultPatientWorkspaceProps,
|
|
18
|
-
type OrderBasketItem,
|
|
19
|
-
useOrderType,
|
|
20
|
-
usePatientChartStore,
|
|
21
|
-
} from '@openmrs/esm-patient-common-lib';
|
|
16
|
+
import { type DefaultPatientWorkspaceProps, type OrderBasketItem, useOrderType } from '@openmrs/esm-patient-common-lib';
|
|
22
17
|
import { type ConfigObject } from '../../config-schema';
|
|
23
18
|
import type { TestOrderBasketItem } from '../../types';
|
|
24
19
|
import { LabOrderForm } from './test-order-form.component';
|
|
@@ -40,10 +35,13 @@ export default function AddLabOrderWorkspace({
|
|
|
40
35
|
closeWorkspaceWithSavedChanges,
|
|
41
36
|
promptBeforeClosing,
|
|
42
37
|
setTitle,
|
|
38
|
+
patientUuid,
|
|
39
|
+
patient,
|
|
40
|
+
visitContext,
|
|
41
|
+
mutateVisitContext,
|
|
43
42
|
}: AddLabOrderWorkspace) {
|
|
44
43
|
const { t } = useTranslation();
|
|
45
44
|
const isTablet = useLayoutType() === 'tablet';
|
|
46
|
-
const { patientUuid, patient } = usePatientChartStore();
|
|
47
45
|
const [currentLabOrder, setCurrentLabOrder] = useState(initialOrder as TestOrderBasketItem);
|
|
48
46
|
const { additionalTestOrderTypes, orders } = useConfig<ConfigObject>();
|
|
49
47
|
const { orderType } = useOrderType(orderTypeUuid);
|
|
@@ -115,12 +113,15 @@ export default function AddLabOrderWorkspace({
|
|
|
115
113
|
setTitle={() => {}}
|
|
116
114
|
orderTypeUuid={orderTypeUuid}
|
|
117
115
|
orderableConceptSets={orderableConceptSets}
|
|
116
|
+
visitContext={visitContext}
|
|
117
|
+
mutateVisitContext={mutateVisitContext}
|
|
118
118
|
/>
|
|
119
119
|
) : (
|
|
120
120
|
<TestTypeSearch
|
|
121
121
|
orderTypeUuid={orderTypeUuid}
|
|
122
122
|
orderableConceptSets={orderableConceptSets}
|
|
123
123
|
openLabForm={setCurrentLabOrder}
|
|
124
|
+
patient={patient}
|
|
124
125
|
/>
|
|
125
126
|
)}
|
|
126
127
|
</div>
|
|
@@ -43,6 +43,7 @@ export interface LabOrderFormProps extends DefaultPatientWorkspaceProps {
|
|
|
43
43
|
initialOrder: TestOrderBasketItem;
|
|
44
44
|
orderTypeUuid: string;
|
|
45
45
|
orderableConceptSets: Array<string>;
|
|
46
|
+
patient: fhir.Patient;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
// Designs:
|
|
@@ -55,12 +56,14 @@ export function LabOrderForm({
|
|
|
55
56
|
promptBeforeClosing,
|
|
56
57
|
orderTypeUuid,
|
|
57
58
|
orderableConceptSets,
|
|
59
|
+
patientUuid,
|
|
60
|
+
patient,
|
|
58
61
|
}: LabOrderFormProps) {
|
|
59
62
|
const { t } = useTranslation();
|
|
60
63
|
const isTablet = useLayoutType() === 'tablet';
|
|
61
64
|
const session = useSession();
|
|
62
65
|
const isEditing = useMemo(() => initialOrder && initialOrder.action === 'REVISE', [initialOrder]);
|
|
63
|
-
const { orders, setOrders } = useOrderBasket<TestOrderBasketItem>(orderTypeUuid, prepTestOrderPostData);
|
|
66
|
+
const { orders, setOrders } = useOrderBasket<TestOrderBasketItem>(patient, orderTypeUuid, prepTestOrderPostData);
|
|
64
67
|
const [showErrorNotification, setShowErrorNotification] = useState(false);
|
|
65
68
|
const config = useConfig<ConfigObject>();
|
|
66
69
|
const { orderType, isLoadingOrderType } = useOrderType(orderTypeUuid);
|
|
@@ -24,21 +24,24 @@ export interface TestTypeSearchProps {
|
|
|
24
24
|
openLabForm: (searchResult: TestOrderBasketItem) => void;
|
|
25
25
|
orderTypeUuid: string;
|
|
26
26
|
orderableConceptSets: Array<string>;
|
|
27
|
+
patient: fhir.Patient;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
interface TestTypeSearchResultsProps extends TestTypeSearchProps {
|
|
30
31
|
cancelOrder: () => void;
|
|
31
32
|
searchTerm: string;
|
|
32
33
|
focusAndClearSearchInput: () => void;
|
|
34
|
+
patient: fhir.Patient;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
interface TestTypeSearchResultItemProps {
|
|
36
38
|
orderTypeUuid: string;
|
|
37
39
|
testType: TestType;
|
|
38
40
|
openOrderForm: (searchResult: TestOrderBasketItem) => void;
|
|
41
|
+
patient: fhir.Patient;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
export function TestTypeSearch({ openLabForm, orderTypeUuid, orderableConceptSets }: TestTypeSearchProps) {
|
|
44
|
+
export function TestTypeSearch({ openLabForm, orderTypeUuid, orderableConceptSets, patient }: TestTypeSearchProps) {
|
|
42
45
|
const { t } = useTranslation();
|
|
43
46
|
const [searchTerm, setSearchTerm] = useState('');
|
|
44
47
|
const debouncedSearchTerm = useDebounce(searchTerm);
|
|
@@ -83,6 +86,7 @@ export function TestTypeSearch({ openLabForm, orderTypeUuid, orderableConceptSet
|
|
|
83
86
|
focusAndClearSearchInput={focusAndClearSearchInput}
|
|
84
87
|
openLabForm={openLabForm}
|
|
85
88
|
searchTerm={debouncedSearchTerm}
|
|
89
|
+
patient={patient}
|
|
86
90
|
/>
|
|
87
91
|
</>
|
|
88
92
|
);
|
|
@@ -95,6 +99,7 @@ function TestTypeSearchResults({
|
|
|
95
99
|
orderableConceptSets,
|
|
96
100
|
openLabForm,
|
|
97
101
|
focusAndClearSearchInput,
|
|
102
|
+
patient,
|
|
98
103
|
}: TestTypeSearchResultsProps) {
|
|
99
104
|
const { t } = useTranslation();
|
|
100
105
|
const isTablet = useLayoutType() === 'tablet';
|
|
@@ -145,6 +150,7 @@ function TestTypeSearchResults({
|
|
|
145
150
|
orderTypeUuid={orderTypeUuid}
|
|
146
151
|
openOrderForm={openLabForm}
|
|
147
152
|
testType={testType}
|
|
153
|
+
patient={patient}
|
|
148
154
|
/>
|
|
149
155
|
))}
|
|
150
156
|
</div>
|
|
@@ -185,11 +191,12 @@ const TestTypeSearchResultItem: React.FC<TestTypeSearchResultItemProps> = ({
|
|
|
185
191
|
testType,
|
|
186
192
|
openOrderForm,
|
|
187
193
|
orderTypeUuid,
|
|
194
|
+
patient,
|
|
188
195
|
}) => {
|
|
189
196
|
const { t } = useTranslation();
|
|
190
197
|
const isTablet = useLayoutType() === 'tablet';
|
|
191
198
|
const session = useSession();
|
|
192
|
-
const { orders, setOrders } = useOrderBasket<TestOrderBasketItem>(orderTypeUuid, prepTestOrderPostData);
|
|
199
|
+
const { orders, setOrders } = useOrderBasket<TestOrderBasketItem>(patient, orderTypeUuid, prepTestOrderPostData);
|
|
193
200
|
|
|
194
201
|
const testTypeAlreadyInBasket = useMemo(
|
|
195
202
|
() => orders?.some((order) => order.testType.conceptUuid === testType.conceptUuid),
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useConfig,
|
|
12
12
|
MaybeIcon,
|
|
13
13
|
launchWorkspace,
|
|
14
|
+
type Visit,
|
|
14
15
|
} from '@openmrs/esm-framework';
|
|
15
16
|
import { type OrderBasketItem, useOrderBasket, useOrderType } from '@openmrs/esm-patient-common-lib';
|
|
16
17
|
import type { ConfigObject } from '../../config-schema';
|
|
@@ -19,10 +20,18 @@ import { LabOrderBasketItemTile } from './lab-order-basket-item-tile.component';
|
|
|
19
20
|
import { prepTestOrderPostData } from '../api';
|
|
20
21
|
import styles from './lab-order-basket-panel.scss';
|
|
21
22
|
|
|
23
|
+
interface OrderBasketSlotProps {
|
|
24
|
+
patientUuid: string;
|
|
25
|
+
patient: fhir.Patient;
|
|
26
|
+
visitContext: Visit;
|
|
27
|
+
mutateVisitContext: () => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* Designs: https://app.zeplin.io/project/60d59321e8100b0324762e05/screen/648c44d9d4052c613e7f23da
|
|
32
|
+
* Slotted into order-basket-slot by default
|
|
24
33
|
*/
|
|
25
|
-
|
|
34
|
+
const LabOrderBasketPanelExtension: React.FC<OrderBasketSlotProps> = ({ patient }) => {
|
|
26
35
|
const { orders, additionalTestOrderTypes } = useConfig<ConfigObject>();
|
|
27
36
|
const { t } = useTranslation();
|
|
28
37
|
const allOrderTypes: ConfigObject['additionalTestOrderTypes'] = [
|
|
@@ -38,22 +47,24 @@ export default function LabOrderBasketPanelExtension() {
|
|
|
38
47
|
return (
|
|
39
48
|
<>
|
|
40
49
|
{allOrderTypes.map((orderTypeConfig) => (
|
|
41
|
-
<LabOrderBasketPanel key={orderTypeConfig.orderTypeUuid} {...orderTypeConfig} />
|
|
50
|
+
<LabOrderBasketPanel patient={patient} key={orderTypeConfig.orderTypeUuid} {...orderTypeConfig} />
|
|
42
51
|
))}
|
|
43
52
|
</>
|
|
44
53
|
);
|
|
45
|
-
}
|
|
54
|
+
};
|
|
46
55
|
|
|
47
56
|
type OrderTypeConfig = ConfigObject['additionalTestOrderTypes'][0];
|
|
48
57
|
|
|
49
|
-
interface LabOrderBasketPanelProps extends OrderTypeConfig {
|
|
58
|
+
interface LabOrderBasketPanelProps extends OrderTypeConfig {
|
|
59
|
+
patient: fhir.Patient;
|
|
60
|
+
}
|
|
50
61
|
|
|
51
|
-
function LabOrderBasketPanel({ orderTypeUuid, label, icon }: LabOrderBasketPanelProps) {
|
|
62
|
+
function LabOrderBasketPanel({ orderTypeUuid, label, icon, patient }: LabOrderBasketPanelProps) {
|
|
52
63
|
const { t } = useTranslation();
|
|
53
64
|
const isTablet = useLayoutType() === 'tablet';
|
|
54
65
|
const { orderType, isLoadingOrderType } = useOrderType(orderTypeUuid);
|
|
55
66
|
|
|
56
|
-
const { orders, setOrders } = useOrderBasket<TestOrderBasketItem>(orderTypeUuid, prepTestOrderPostData);
|
|
67
|
+
const { orders, setOrders } = useOrderBasket<TestOrderBasketItem>(patient, orderTypeUuid, prepTestOrderPostData);
|
|
57
68
|
const [isExpanded, setIsExpanded] = useState(orders.length > 0);
|
|
58
69
|
const {
|
|
59
70
|
incompleteOrderBasketItems,
|
|
@@ -245,3 +256,5 @@ function LabOrderBasketPanel({ orderTypeUuid, label, icon }: LabOrderBasketPanel
|
|
|
245
256
|
</Tile>
|
|
246
257
|
);
|
|
247
258
|
}
|
|
259
|
+
|
|
260
|
+
export default LabOrderBasketPanelExtension;
|
|
@@ -6,6 +6,7 @@ import { getDefaultsFromConfigSchema, useConfig } from '@openmrs/esm-framework';
|
|
|
6
6
|
import { type ConfigObject, configSchema } from '../../config-schema';
|
|
7
7
|
import type { TestOrderBasketItem } from '../../types';
|
|
8
8
|
import LabOrderBasketPanel from './lab-order-basket-panel.extension';
|
|
9
|
+
import { mockPatient } from 'tools';
|
|
9
10
|
|
|
10
11
|
const mockUseOrderBasket = jest.fn();
|
|
11
12
|
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
@@ -36,10 +37,17 @@ mockUseOrderType.mockReturnValue({
|
|
|
36
37
|
errorFetchingOrderType: undefined,
|
|
37
38
|
});
|
|
38
39
|
|
|
40
|
+
const testProps = {
|
|
41
|
+
patientUuid: mockPatient.id,
|
|
42
|
+
patient: mockPatient,
|
|
43
|
+
visitContext: null,
|
|
44
|
+
mutateVisitContext: null,
|
|
45
|
+
};
|
|
46
|
+
|
|
39
47
|
describe('LabOrderBasketPanel', () => {
|
|
40
48
|
test('renders an empty state when no items are selected in the order basket', () => {
|
|
41
49
|
mockUseOrderBasket.mockReturnValue({ orders: [] });
|
|
42
|
-
render(<LabOrderBasketPanel />);
|
|
50
|
+
render(<LabOrderBasketPanel {...testProps} />);
|
|
43
51
|
expect(screen.getByRole('heading', { name: /Lab orders \(0\)/i })).toBeInTheDocument();
|
|
44
52
|
expect(screen.getByRole('button', { name: /Add/i })).toBeInTheDocument();
|
|
45
53
|
});
|
|
@@ -76,7 +84,7 @@ describe('LabOrderBasketPanel', () => {
|
|
|
76
84
|
orders: orders,
|
|
77
85
|
setOrders: mockSetOrders,
|
|
78
86
|
}));
|
|
79
|
-
const { rerender } = render(<LabOrderBasketPanel />);
|
|
87
|
+
const { rerender } = render(<LabOrderBasketPanel {...testProps} />);
|
|
80
88
|
expect(screen.getByText(/Lab orders \(2\)/i)).toBeInTheDocument();
|
|
81
89
|
expect(screen.getByText(/HIV VIRAL LOAD/i)).toBeInTheDocument();
|
|
82
90
|
expect(screen.getByText(/CD4 COUNT/i)).toBeInTheDocument();
|
|
@@ -85,7 +93,7 @@ describe('LabOrderBasketPanel', () => {
|
|
|
85
93
|
expect(removeHivButton).toBeVisible();
|
|
86
94
|
|
|
87
95
|
await user.click(removeHivButton);
|
|
88
|
-
rerender(<LabOrderBasketPanel />);
|
|
96
|
+
rerender(<LabOrderBasketPanel {...testProps} />);
|
|
89
97
|
await expect(screen.getByText(/Lab orders \(1\)/i)).toBeInTheDocument();
|
|
90
98
|
expect(screen.getByText(/CD4 COUNT/i)).toBeInTheDocument();
|
|
91
99
|
expect(screen.queryByText(/HIV VIRAL LOAD/i)).not.toBeInTheDocument();
|
|
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import useSWR from 'swr';
|
|
3
3
|
import useSWRInfinite from 'swr/infinite';
|
|
4
4
|
import { openmrsFetch, restBaseUrl, type FetchResponse } from '@openmrs/esm-framework';
|
|
5
|
-
import {
|
|
5
|
+
import { type OBSERVATION_INTERPRETATION } from '@openmrs/esm-patient-common-lib';
|
|
6
6
|
import { assessValue, exist } from '../loadPatientTestData/helpers';
|
|
7
7
|
import { selectReferenceRange, formatReferenceRange, type ReferenceRanges } from './reference-range-helpers';
|
|
8
8
|
|
|
@@ -116,8 +116,7 @@ const augmentObstreeData = (node: ObsTreeNode, prefix: string | undefined) => {
|
|
|
116
116
|
return { ...outData } as ObsTreeNode;
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
const useGetObstreeData = (conceptUuid: string) => {
|
|
120
|
-
const { patientUuid } = usePatientChartStore();
|
|
119
|
+
const useGetObstreeData = (patientUuid: string, conceptUuid: string) => {
|
|
121
120
|
const response = useSWR<FetchResponse<ObsTreeNode>, Error>(
|
|
122
121
|
`${restBaseUrl}/obstree?patient=${patientUuid}&concept=${conceptUuid}`,
|
|
123
122
|
openmrsFetch,
|
|
@@ -138,8 +137,7 @@ const useGetObstreeData = (conceptUuid: string) => {
|
|
|
138
137
|
return result;
|
|
139
138
|
};
|
|
140
139
|
|
|
141
|
-
const useGetManyObstreeData = (uuidArray: Array<string>) => {
|
|
142
|
-
const { patientUuid } = usePatientChartStore();
|
|
140
|
+
const useGetManyObstreeData = (patientUuid: string, uuidArray: Array<string>) => {
|
|
143
141
|
const getObstreeUrl = (index: number) => {
|
|
144
142
|
if (index < uuidArray.length && patientUuid) {
|
|
145
143
|
return `${restBaseUrl}/obstree?patient=${patientUuid}&concept=${uuidArray[index]}`;
|
|
@@ -14,11 +14,12 @@ import {
|
|
|
14
14
|
TableRow,
|
|
15
15
|
} from '@carbon/react';
|
|
16
16
|
import { showModal, useLayoutType, formatDate, parseDate } from '@openmrs/esm-framework';
|
|
17
|
-
import {
|
|
17
|
+
import { type OBSERVATION_INTERPRETATION } from '@openmrs/esm-patient-common-lib';
|
|
18
18
|
import { type GroupedObservation } from '../../types';
|
|
19
19
|
import styles from './individual-results-table.scss';
|
|
20
20
|
|
|
21
21
|
interface IndividualResultsTableProps {
|
|
22
|
+
patientUuid;
|
|
22
23
|
isLoading: boolean;
|
|
23
24
|
subRows: GroupedObservation;
|
|
24
25
|
index: number;
|
|
@@ -51,10 +52,15 @@ const getClasses = (interpretation: OBSERVATION_INTERPRETATION) => {
|
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
const IndividualResultsTable: React.FC<IndividualResultsTableProps> = ({
|
|
55
|
+
const IndividualResultsTable: React.FC<IndividualResultsTableProps> = ({
|
|
56
|
+
patientUuid,
|
|
57
|
+
isLoading,
|
|
58
|
+
subRows,
|
|
59
|
+
index,
|
|
60
|
+
title,
|
|
61
|
+
}) => {
|
|
55
62
|
const { t } = useTranslation();
|
|
56
63
|
const layout = useLayoutType();
|
|
57
|
-
const patientUuid = getPatientUuidFromStore();
|
|
58
64
|
const isDesktop = layout === 'small-desktop' || layout === 'large-desktop';
|
|
59
65
|
|
|
60
66
|
const headerTitle = t(title);
|
|
@@ -64,13 +64,29 @@ describe('IndividualResultsTable', () => {
|
|
|
64
64
|
} as GroupedObservation;
|
|
65
65
|
|
|
66
66
|
it('renders a loading skeleton when fetching results data', () => {
|
|
67
|
-
render(
|
|
67
|
+
render(
|
|
68
|
+
<IndividualResultsTable
|
|
69
|
+
patientUuid={'patient-uuid'}
|
|
70
|
+
isLoading={true}
|
|
71
|
+
subRows={mockEmptySubRows}
|
|
72
|
+
index={0}
|
|
73
|
+
title={'HIV viral load'}
|
|
74
|
+
/>,
|
|
75
|
+
);
|
|
68
76
|
|
|
69
77
|
expect(screen.getByRole('progressbar')).toBeInTheDocument();
|
|
70
78
|
});
|
|
71
79
|
|
|
72
80
|
it('renders a tabular overview of the available test result data', () => {
|
|
73
|
-
render(
|
|
81
|
+
render(
|
|
82
|
+
<IndividualResultsTable
|
|
83
|
+
patientUuid={'patient-uuid'}
|
|
84
|
+
isLoading={false}
|
|
85
|
+
subRows={mockSubRows}
|
|
86
|
+
index={0}
|
|
87
|
+
title={'HIV viral load'}
|
|
88
|
+
/>,
|
|
89
|
+
);
|
|
74
90
|
|
|
75
91
|
expect(screen.getByRole('table')).toBeInTheDocument();
|
|
76
92
|
expect(screen.getByText(/15-Oct-2024/i)).toBeInTheDocument();
|
|
@@ -82,6 +98,7 @@ describe('IndividualResultsTable', () => {
|
|
|
82
98
|
it('uses observation-level range when available', () => {
|
|
83
99
|
render(
|
|
84
100
|
<IndividualResultsTable
|
|
101
|
+
patientUuid={'patient-uuid'}
|
|
85
102
|
isLoading={false}
|
|
86
103
|
subRows={mockSubRowsWithObservationRange}
|
|
87
104
|
index={0}
|
|
@@ -23,14 +23,14 @@ interface RefreshDataButtonProps {
|
|
|
23
23
|
|
|
24
24
|
interface ResultsViewerProps {
|
|
25
25
|
basePath: string;
|
|
26
|
-
patientUuid
|
|
26
|
+
patientUuid: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const RoutedResultsViewer: React.FC<ResultsViewerProps> = ({ basePath, patientUuid }) => {
|
|
30
30
|
const { t } = useTranslation();
|
|
31
31
|
const config = useConfig<ConfigObject>();
|
|
32
32
|
const conceptUuids = config.resultsViewerConcepts.map((concept) => concept.conceptUuid) ?? [];
|
|
33
|
-
const { roots, isLoading, error } = useGetManyObstreeData(conceptUuids);
|
|
33
|
+
const { roots, isLoading, error } = useGetManyObstreeData(patientUuid, conceptUuids);
|
|
34
34
|
|
|
35
35
|
if (error) {
|
|
36
36
|
return <ErrorState error={error} headerTitle={t('dataLoadError', 'Data Load Error')} />;
|
|
@@ -19,9 +19,10 @@ interface TreeViewProps {
|
|
|
19
19
|
error?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const GroupedPanelsTables: React.FC<{ className: string; loadingPanelData: boolean }> = ({
|
|
22
|
+
const GroupedPanelsTables: React.FC<{ patientUuid: string; className: string; loadingPanelData: boolean }> = ({
|
|
23
23
|
className,
|
|
24
24
|
loadingPanelData,
|
|
25
|
+
patientUuid,
|
|
25
26
|
}) => {
|
|
26
27
|
const { t } = useTranslation();
|
|
27
28
|
const { checkboxes, someChecked, tableData } = useContext(FilterContext);
|
|
@@ -70,6 +71,7 @@ const GroupedPanelsTables: React.FC<{ className: string; loadingPanelData: boole
|
|
|
70
71
|
})}
|
|
71
72
|
>
|
|
72
73
|
<IndividualResultsTable
|
|
74
|
+
patientUuid={patientUuid}
|
|
73
75
|
isLoading={loadingPanelData}
|
|
74
76
|
subRows={filteredSubRows}
|
|
75
77
|
index={index}
|
|
@@ -88,7 +90,7 @@ const TreeView: React.FC<TreeViewProps> = ({ patientUuid, expanded, view }) => {
|
|
|
88
90
|
const [showTreeOverlay, setShowTreeOverlay] = useState(false);
|
|
89
91
|
const config = useConfig<ConfigObject>();
|
|
90
92
|
const conceptUuids = config?.resultsViewerConcepts?.map((c) => c.conceptUuid) ?? [];
|
|
91
|
-
const { roots, error } = useGetManyObstreeData(conceptUuids);
|
|
93
|
+
const { roots, error } = useGetManyObstreeData(patientUuid, conceptUuids);
|
|
92
94
|
|
|
93
95
|
const { timelineData, tableData, totalResultsCount, filteredResultsCount, resetTree, isLoading } =
|
|
94
96
|
useContext(FilterContext);
|
|
@@ -113,7 +115,11 @@ const TreeView: React.FC<TreeViewProps> = ({ patientUuid, expanded, view }) => {
|
|
|
113
115
|
{!isLoading && view === 'over-time' ? (
|
|
114
116
|
<GroupedTimeline patientUuid={patientUuid} />
|
|
115
117
|
) : view === 'individual-test' ? (
|
|
116
|
-
<GroupedPanelsTables
|
|
118
|
+
<GroupedPanelsTables
|
|
119
|
+
patientUuid={patientUuid}
|
|
120
|
+
className={styles.groupPanelsTables}
|
|
121
|
+
loadingPanelData={isLoading}
|
|
122
|
+
/>
|
|
117
123
|
) : (
|
|
118
124
|
<DataTableSkeleton role="progressbar" />
|
|
119
125
|
)}
|
|
@@ -160,7 +166,11 @@ const TreeView: React.FC<TreeViewProps> = ({ patientUuid, expanded, view }) => {
|
|
|
160
166
|
<DataTableSkeleton />
|
|
161
167
|
) : view === 'individual-test' ? (
|
|
162
168
|
<div className={styles.panelViewTimeline}>
|
|
163
|
-
<GroupedPanelsTables
|
|
169
|
+
<GroupedPanelsTables
|
|
170
|
+
patientUuid={patientUuid}
|
|
171
|
+
className={styles.groupPanelsTables}
|
|
172
|
+
loadingPanelData={isLoading}
|
|
173
|
+
/>
|
|
164
174
|
</div>
|
|
165
175
|
) : view === 'over-time' ? (
|
|
166
176
|
<GroupedTimeline patientUuid={patientUuid} />
|