@openmrs/esm-patient-chart-app 11.3.1-pre.9201 → 11.3.1-pre.9203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var _openmrs_esm_patient_chart_app;(()=>{"use strict";var e,r,t,n,a,o,i,l,s,u,p,f,c,h,d,m,v,g,b,y,w,_={20131:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2017),t.e(1343),t.e(5434),t.e(9533),t.e(2442)]).then((()=>()=>t(52442)))},a=(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),o=(e,r)=>{if(t.S){var n="default",a=t.S[n];if(a&&a!==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:()=>a,init:()=>o})}},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 a=Object.create(null);j.r(a);var o={};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=>o[e]=()=>t[e]));return o.default=()=>t,j.d(a,o),a},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-chart-app:",j.l=(e,r,a,o)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==a)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var p=s[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+a){i=p;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,j.nc&&i.setAttribute("nonce",j.nc),i.setAttribute("data-webpack",n+a),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.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),l&&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 a=r[t];if(a||(a=r[t]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[t])return e[t];j.o(j.S,t)||(j.S[t]={});var o=j.S[t],i="@openmrs/esm-patient-chart-app",l=(e,r,t,n)=>{var a=o[e]=o[e]||{},l=a[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(a[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@carbon/react","1.92.1",(()=>Promise.all([j.e(68),j.e(9007),j.e(4632),j.e(7816),j.e(1343),j.e(3373)]).then((()=>()=>j(67816))))),l("@openmrs/esm-framework","8.0.1-pre.3473",(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(5670),j.e(1343),j.e(8010),j.e(5434),j.e(3808),j.e(9533),j.e(868)]).then((()=>()=>j(55670))))),l("@openmrs/esm-patient-common-lib","11.3.1-pre.9201",(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(1343),j.e(8010),j.e(5434),j.e(3808),j.e(9533),j.e(5048),j.e(8487)]).then((()=>()=>j(15048))))),l("dayjs","1.11.13",(()=>j.e(3464).then((()=>()=>j(23464))))),l("lodash-es","4.17.21",(()=>Promise.all([j.e(5992),j.e(2687)]).then((()=>()=>j(42687))))),l("react-i18next","16.0.0",(()=>Promise.all([j.e(6336),j.e(1343)]).then((()=>()=>j(16336))))),l("react-router-dom","6.16.0",(()=>Promise.all([j.e(2913),j.e(1343)]).then((()=>()=>j(52913))))),l("react","18.3.1",(()=>j.e(4041).then((()=>()=>j(14041))))),l("rxjs","6.6.7",(()=>j.e(2457).then((()=>()=>j(82457))))),l("single-spa-react","6.0.2",(()=>j.e(1469).then((()=>()=>j(61469))))),l("single-spa","6.0.3",(()=>j.e(2244).then((()=>()=>j(22244))))),l("swr/_internal","2.2.5",(()=>Promise.all([j.e(2372),j.e(1343)]).then((()=>()=>j(42372))))),l("swr/immutable","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(7495)]).then((()=>()=>j(29876))))),l("swr/infinite","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(89)]).then((()=>()=>j(52470)))))),e[t]=s.length?Promise.all(s).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})(),a=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},o=(e,r)=>{e=a(e),r=a(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],o=(typeof n)[0];if(t>=r.length)return"u"==o;var i=r[t],l=(typeof i)[0];if(o!=l)return"o"==o&&"n"==l||"s"==l||"u"==o;if("o"!=o&&"u"!=o&&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,a=1;a<e.length;a++)n--,t+="u"==(typeof(l=e[a]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var o=[];for(a=1;a<e.length;a++){var l=e[a];o.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?o.pop()+" "+o.pop():i(l))}return s();function s(){return o.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=a(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var o=0,i=1,s=!0;;i++,o++){var u,p,f=i<e.length?(typeof e[i])[0]:"";if(o>=r.length||"o"==(p=(typeof(u=r[o]))[0]))return!s||("u"==f?i>t&&!n:""==f!=n);if("u"==p){if(!s||"u"!=f)return!1}else if(s)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]&&(s=!1)}else if("s"!=f&&"n"!=f){if(n||i<=t)return!1;s=!1,i--}else{if(i<=t||p<f!=n)return!1;s=!1}else"s"!=f&&"n"!=f&&(s=!1,i--)}}var c=[],h=c.pop.bind(c);for(o=1;o<e.length;o++){var d=e[o];c.push(1==d?h()|h():2==d?h()&h():d?l(d,r):!h())}return!!h()},s=(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&&o(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)+")",h=e=>{throw new Error(e)},d=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>h("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,a,o){var i=j.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,j.S[r],t,!1,a,o)):e(r,j.S[r],t,n,a,o)})(((e,r,t,n,a,o)=>{if(!s(r,t))return m(e,t,o);var i=f(r,t,n);return l(a,i)||d(c(r,t,i,a)),u(r[t][i])})),g={},b={1343:()=>v("default","react",!1,[1,18],(()=>j.e(4041).then((()=>()=>j(14041))))),88010:()=>v("default","swr/immutable",!1,[1,2],(()=>j.e(9876).then((()=>()=>j(29876))))),55434:()=>v("default","swr/_internal",!1,[1,2],(()=>j.e(2372).then((()=>()=>j(42372))))),8125:()=>v("default","single-spa-react",!1,[1,6],(()=>j.e(1469).then((()=>()=>j(61469))))),24818:()=>v("default","rxjs",!1,[1,6],(()=>j.e(2457).then((()=>()=>j(82457))))),74730:()=>v("default","single-spa",!1,[1,6],(()=>j.e(2244).then((()=>()=>j(22244))))),98394:()=>v("default","swr/infinite",!1,[1,2],(()=>j.e(2470).then((()=>()=>j(52470))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>j.e(2913).then((()=>()=>j(52913))))),14497:()=>v("default","lodash-es",!1,[1,4],(()=>Promise.all([j.e(5992),j.e(2687)]).then((()=>()=>j(42687))))),46372:()=>v("default","dayjs",!1,[1,1],(()=>j.e(3464).then((()=>()=>j(23464))))),72339:()=>v("default","react-i18next",!1,[1,16],(()=>j.e(6336).then((()=>()=>j(16336))))),75198:()=>v("default","@carbon/react",!1,[1,1],(()=>Promise.all([j.e(68),j.e(9007),j.e(4632),j.e(7816)]).then((()=>()=>j(67816))))),54440:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(5670),j.e(8010),j.e(3808)]).then((()=>()=>j(55670))))),63276:()=>v("default","@openmrs/esm-patient-common-lib",!1,[0],(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(8010),j.e(3808),j.e(5048)]).then((()=>()=>j(15048)))))},y={868:[54440],1343:[1343],2442:[54440,63276],3808:[8125,24818,74730,98394],5434:[55434],8010:[88010],8487:[54440],9533:[8877,14497,46372,72339,75198]},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 a=b[e]();a.then?r.push(g[e]=a.then(t).catch(n)):t(a)}catch(e){n(e)}}}))},(()=>{var e={9426: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|3808|5434|8010|9533)$/.test(r))e[r]=0;else{var a=new Promise(((t,a)=>n=e[r]=[t,a]));t.push(n[2]=a);var o=j.p+j.u(r),i=new Error;j.l(o,(t=>{if(j.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,a,[o,i,l]=t,s=0;if(o.some((r=>0!==e[r]))){for(n in i)j.o(i,n)&&(j.m[n]=i[n]);l&&l(j)}for(r&&r(t);s<o.length;s++)a=o[s],j.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=globalThis.webpackChunk_openmrs_esm_patient_chart_app=globalThis.webpackChunk_openmrs_esm_patient_chart_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var S=j(20131);_openmrs_esm_patient_chart_app=S})();
1
+ var _openmrs_esm_patient_chart_app;(()=>{"use strict";var e,r,t,n,a,o,i,l,s,u,p,f,c,h,d,m,v,g,b,y,w,_={20131:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2017),t.e(1343),t.e(5434),t.e(9533),t.e(2442)]).then((()=>()=>t(52442)))},a=(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),o=(e,r)=>{if(t.S){var n="default",a=t.S[n];if(a&&a!==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:()=>a,init:()=>o})}},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 a=Object.create(null);j.r(a);var o={};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=>o[e]=()=>t[e]));return o.default=()=>t,j.d(a,o),a},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-chart-app:",j.l=(e,r,a,o)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==a)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var p=s[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+a){i=p;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,j.nc&&i.setAttribute("nonce",j.nc),i.setAttribute("data-webpack",n+a),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.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),l&&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 a=r[t];if(a||(a=r[t]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[t])return e[t];j.o(j.S,t)||(j.S[t]={});var o=j.S[t],i="@openmrs/esm-patient-chart-app",l=(e,r,t,n)=>{var a=o[e]=o[e]||{},l=a[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(a[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@carbon/react","1.92.1",(()=>Promise.all([j.e(68),j.e(9007),j.e(4632),j.e(7816),j.e(1343),j.e(3373)]).then((()=>()=>j(67816))))),l("@openmrs/esm-framework","8.0.1-pre.3473",(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(5670),j.e(1343),j.e(8010),j.e(5434),j.e(3808),j.e(9533),j.e(868)]).then((()=>()=>j(55670))))),l("@openmrs/esm-patient-common-lib","11.3.1-pre.9203",(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(1343),j.e(8010),j.e(5434),j.e(3808),j.e(9533),j.e(5048),j.e(8487)]).then((()=>()=>j(15048))))),l("dayjs","1.11.13",(()=>j.e(3464).then((()=>()=>j(23464))))),l("lodash-es","4.17.21",(()=>Promise.all([j.e(5992),j.e(2687)]).then((()=>()=>j(42687))))),l("react-i18next","16.0.0",(()=>Promise.all([j.e(6336),j.e(1343)]).then((()=>()=>j(16336))))),l("react-router-dom","6.16.0",(()=>Promise.all([j.e(2913),j.e(1343)]).then((()=>()=>j(52913))))),l("react","18.3.1",(()=>j.e(4041).then((()=>()=>j(14041))))),l("rxjs","6.6.7",(()=>j.e(2457).then((()=>()=>j(82457))))),l("single-spa-react","6.0.2",(()=>j.e(1469).then((()=>()=>j(61469))))),l("single-spa","6.0.3",(()=>j.e(2244).then((()=>()=>j(22244))))),l("swr/_internal","2.2.5",(()=>Promise.all([j.e(2372),j.e(1343)]).then((()=>()=>j(42372))))),l("swr/immutable","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(7495)]).then((()=>()=>j(29876))))),l("swr/infinite","2.2.5",(()=>Promise.all([j.e(1343),j.e(5434),j.e(89)]).then((()=>()=>j(52470)))))),e[t]=s.length?Promise.all(s).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})(),a=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},o=(e,r)=>{e=a(e),r=a(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],o=(typeof n)[0];if(t>=r.length)return"u"==o;var i=r[t],l=(typeof i)[0];if(o!=l)return"o"==o&&"n"==l||"s"==l||"u"==o;if("o"!=o&&"u"!=o&&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,a=1;a<e.length;a++)n--,t+="u"==(typeof(l=e[a]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var o=[];for(a=1;a<e.length;a++){var l=e[a];o.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?o.pop()+" "+o.pop():i(l))}return s();function s(){return o.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=a(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var o=0,i=1,s=!0;;i++,o++){var u,p,f=i<e.length?(typeof e[i])[0]:"";if(o>=r.length||"o"==(p=(typeof(u=r[o]))[0]))return!s||("u"==f?i>t&&!n:""==f!=n);if("u"==p){if(!s||"u"!=f)return!1}else if(s)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]&&(s=!1)}else if("s"!=f&&"n"!=f){if(n||i<=t)return!1;s=!1,i--}else{if(i<=t||p<f!=n)return!1;s=!1}else"s"!=f&&"n"!=f&&(s=!1,i--)}}var c=[],h=c.pop.bind(c);for(o=1;o<e.length;o++){var d=e[o];c.push(1==d?h()|h():2==d?h()&h():d?l(d,r):!h())}return!!h()},s=(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&&o(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)+")",h=e=>{throw new Error(e)},d=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>h("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,a,o){var i=j.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,j.S[r],t,!1,a,o)):e(r,j.S[r],t,n,a,o)})(((e,r,t,n,a,o)=>{if(!s(r,t))return m(e,t,o);var i=f(r,t,n);return l(a,i)||d(c(r,t,i,a)),u(r[t][i])})),g={},b={1343:()=>v("default","react",!1,[1,18],(()=>j.e(4041).then((()=>()=>j(14041))))),88010:()=>v("default","swr/immutable",!1,[1,2],(()=>j.e(9876).then((()=>()=>j(29876))))),55434:()=>v("default","swr/_internal",!1,[1,2],(()=>j.e(2372).then((()=>()=>j(42372))))),8125:()=>v("default","single-spa-react",!1,[1,6],(()=>j.e(1469).then((()=>()=>j(61469))))),24818:()=>v("default","rxjs",!1,[1,6],(()=>j.e(2457).then((()=>()=>j(82457))))),74730:()=>v("default","single-spa",!1,[1,6],(()=>j.e(2244).then((()=>()=>j(22244))))),98394:()=>v("default","swr/infinite",!1,[1,2],(()=>j.e(2470).then((()=>()=>j(52470))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>j.e(2913).then((()=>()=>j(52913))))),14497:()=>v("default","lodash-es",!1,[1,4],(()=>Promise.all([j.e(5992),j.e(2687)]).then((()=>()=>j(42687))))),46372:()=>v("default","dayjs",!1,[1,1],(()=>j.e(3464).then((()=>()=>j(23464))))),72339:()=>v("default","react-i18next",!1,[1,16],(()=>j.e(6336).then((()=>()=>j(16336))))),75198:()=>v("default","@carbon/react",!1,[1,1],(()=>Promise.all([j.e(68),j.e(9007),j.e(4632),j.e(7816)]).then((()=>()=>j(67816))))),54440:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(5670),j.e(8010),j.e(3808)]).then((()=>()=>j(55670))))),63276:()=>v("default","@openmrs/esm-patient-common-lib",!1,[0],(()=>Promise.all([j.e(68),j.e(5992),j.e(1815),j.e(8010),j.e(3808),j.e(5048)]).then((()=>()=>j(15048)))))},y={868:[54440],1343:[1343],2442:[54440,63276],3808:[8125,24818,74730,98394],5434:[55434],8010:[88010],8487:[54440],9533:[8877,14497,46372,72339,75198]},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 a=b[e]();a.then?r.push(g[e]=a.then(t).catch(n)):t(a)}catch(e){n(e)}}}))},(()=>{var e={9426: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|3808|5434|8010|9533)$/.test(r))e[r]=0;else{var a=new Promise(((t,a)=>n=e[r]=[t,a]));t.push(n[2]=a);var o=j.p+j.u(r),i=new Error;j.l(o,(t=>{if(j.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,a,[o,i,l]=t,s=0;if(o.some((r=>0!==e[r]))){for(n in i)j.o(i,n)&&(j.m[n]=i[n]);l&&l(j)}for(r&&r(t);s<o.length;s++)a=o[s],j.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=globalThis.webpackChunk_openmrs_esm_patient_chart_app=globalThis.webpackChunk_openmrs_esm_patient_chart_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var S=j(20131);_openmrs_esm_patient_chart_app=S})();
@@ -634,9 +634,9 @@
634
634
  "initial": false,
635
635
  "entry": false,
636
636
  "recorded": false,
637
- "size": 111457,
637
+ "size": 111348,
638
638
  "sizes": {
639
- "javascript": 111457
639
+ "javascript": 111348
640
640
  },
641
641
  "names": [],
642
642
  "idHints": [],
@@ -650,7 +650,7 @@
650
650
  "auxiliaryFiles": [
651
651
  "3042.js.map"
652
652
  ],
653
- "hash": "7c3185d50e998a7c",
653
+ "hash": "5bcb6cb1d4372de5",
654
654
  "childrenByOrder": {}
655
655
  },
656
656
  {
@@ -1890,7 +1890,7 @@
1890
1890
  "auxiliaryFiles": [
1891
1891
  "main.js.map"
1892
1892
  ],
1893
- "hash": "65d56ab41434fdaf",
1893
+ "hash": "4d8cd572d693632e",
1894
1894
  "childrenByOrder": {}
1895
1895
  },
1896
1896
  {
@@ -1966,7 +1966,7 @@
1966
1966
  "auxiliaryFiles": [
1967
1967
  "openmrs-esm-patient-chart-app.js.map"
1968
1968
  ],
1969
- "hash": "3edd4835f7f8ddc9",
1969
+ "hash": "556e5a4121156e0a",
1970
1970
  "childrenByOrder": {}
1971
1971
  },
1972
1972
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","optionalBackendDependencies":{"emrapi":{"version":"^2.0.0","feature":{"flagName":"emrapi-module","label":"EMR API Module","description":"This module, if installed, provides core EMR business logic."}}},"extensions":[{"name":"charts-summary-dashboard","component":"patientSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":0,"meta":{"slot":"patient-chart-summary-dashboard-slot","path":"Patient Summary"},"online":true,"offline":true},{"name":"encounter-list","component":"encounterListTableTabs","online":true,"offline":true},{"name":"start-visit-button","component":"startVisitActionButton","slot":"patient-actions-slot","online":true,"offline":true},{"name":"clinical-views-summary","component":"clinicalViewsSummary","online":true,"offline":true},{"name":"stop-visit-button","component":"stopVisitActionButton","slot":"patient-actions-slot","online":true,"offline":true},{"name":"mark-alive-button","slot":"patient-actions-slot","component":"markPatientAliveActionButton","online":true,"offline":true},{"name":"stop-visit-button-patient-search","slot":"patient-search-actions-slot","component":"stopVisitPatientSearchActionButton","online":true,"offline":true},{"name":"delete-visit-button","slot":"patient-actions-slot","component":"deleteVisitActionMenuButton","online":true,"offline":true},{"name":"delete-visit-button","slot":"patient-search-actions-slot","component":"deleteVisitActionMenuButton","online":true,"offline":true},{"name":"mark-patient-deceased-button","slot":"patient-actions-slot","component":"markPatientDeceasedActionButton","online":true,"offline":true},{"name":"encounters-summary-dashboard","slot":"patient-chart-dashboard-slot","component":"encountersSummaryDashboardLink","meta":{"slot":"patient-chart-encounters-dashboard-slot","path":"Visits","layoutMode":"anchored"},"order":5,"online":true,"offline":true},{"name":"past-visits-detail-overview","slot":"patient-chart-encounters-dashboard-slot","component":"pastVisitsDetailOverview","order":1,"meta":{"title":"Visits","view":"visits"},"online":true,"offline":true},{"name":"patient-details-tile","slot":"visit-form-header-slot","component":"patientDetailsTile","order":1,"online":true,"offline":true},{"name":"start-visit-button-patient-search","slot":"start-visit-button-slot","component":"startVisitPatientSearchActionButton","online":true,"offline":true},{"name":"visit-attribute-tags","slot":"patient-banner-tags-slot","component":"visitAttributeTags","online":true,"offline":true},{"name":"current-visit-summary","component":"currentVisitSummary","online":true,"offline":true,"meta":{"fullWidth":true}},{"name":"edit-visit-action-button","slot":"visit-detail-overview-actions","component":"editVisitDetailsActionButton","online":true,"offline":true,"order":0},{"name":"delete-visit-action-button","slot":"visit-detail-overview-actions","component":"deleteVisitActionButton","online":true,"offline":true,"order":1},{"name":"active-visit-action-button","slot":"active-visit-actions","component":"activeVisitActionsComponent","online":true,"offline":true,"order":1},{"name":"visit-context-header","slot":"visit-context-header-slot","component":"visitContextHeader"},{"name":"retrospective-date-time-picker","slot":"restrospective-date-time-picker-slot","component":"retrospectiveDateTimePicker"}],"featureFlags":[{"description":"Features to enter data for past visits. Includes the 'Edit Past Visit' button in the start visit dialog, and the 'Add Past Visit' button in the patient header","flagName":"rde","label":"Retrospective Data Entry"},{"description":"When enabled, encounter summaries will display the full form layout instead of a simple observation list.","flagName":"enable-embedded-form-view","label":"Enable Embedded Form View"}],"modals":[{"name":"delete-encounter-modal","component":"deleteEncounterModal"},{"name":"delete-visit-dialog","component":"deleteVisitModal"},{"name":"end-visit-dialog","component":"endVisitModal"},{"name":"mark-patient-alive-modal","component":"markPatientAliveModal"},{"name":"modify-visit-date-dialog","component":"modifyVisitDateModal"},{"name":"start-visit-dialog","component":"startVisitModal"},{"name":"visit-context-switcher","component":"visitContextSwitcherModal"}],"pages":[{"component":"root","routeRegex":"^patient/.+/chart","online":true,"offline":true}],"workspaces":[{"name":"mark-patient-deceased-workspace-form","component":"markPatientDeceasedForm","title":"Mark patient deceased","type":"form"},{"name":"start-visit-workspace-form","component":"startVisitWorkspace","title":"startVisitWorkspaceTitle","type":"start-visit"}],"version":"11.3.1-pre.9201"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","optionalBackendDependencies":{"emrapi":{"version":"^2.0.0","feature":{"flagName":"emrapi-module","label":"EMR API Module","description":"This module, if installed, provides core EMR business logic."}}},"extensions":[{"name":"charts-summary-dashboard","component":"patientSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":0,"meta":{"slot":"patient-chart-summary-dashboard-slot","path":"Patient Summary"},"online":true,"offline":true},{"name":"encounter-list","component":"encounterListTableTabs","online":true,"offline":true},{"name":"start-visit-button","component":"startVisitActionButton","slot":"patient-actions-slot","online":true,"offline":true},{"name":"clinical-views-summary","component":"clinicalViewsSummary","online":true,"offline":true},{"name":"stop-visit-button","component":"stopVisitActionButton","slot":"patient-actions-slot","online":true,"offline":true},{"name":"mark-alive-button","slot":"patient-actions-slot","component":"markPatientAliveActionButton","online":true,"offline":true},{"name":"stop-visit-button-patient-search","slot":"patient-search-actions-slot","component":"stopVisitPatientSearchActionButton","online":true,"offline":true},{"name":"delete-visit-button","slot":"patient-actions-slot","component":"deleteVisitActionMenuButton","online":true,"offline":true},{"name":"delete-visit-button","slot":"patient-search-actions-slot","component":"deleteVisitActionMenuButton","online":true,"offline":true},{"name":"mark-patient-deceased-button","slot":"patient-actions-slot","component":"markPatientDeceasedActionButton","online":true,"offline":true},{"name":"encounters-summary-dashboard","slot":"patient-chart-dashboard-slot","component":"encountersSummaryDashboardLink","meta":{"slot":"patient-chart-encounters-dashboard-slot","path":"Visits","layoutMode":"anchored"},"order":5,"online":true,"offline":true},{"name":"past-visits-detail-overview","slot":"patient-chart-encounters-dashboard-slot","component":"pastVisitsDetailOverview","order":1,"meta":{"title":"Visits","view":"visits"},"online":true,"offline":true},{"name":"patient-details-tile","slot":"visit-form-header-slot","component":"patientDetailsTile","order":1,"online":true,"offline":true},{"name":"start-visit-button-patient-search","slot":"start-visit-button-slot","component":"startVisitPatientSearchActionButton","online":true,"offline":true},{"name":"visit-attribute-tags","slot":"patient-banner-tags-slot","component":"visitAttributeTags","online":true,"offline":true},{"name":"current-visit-summary","component":"currentVisitSummary","online":true,"offline":true,"meta":{"fullWidth":true}},{"name":"edit-visit-action-button","slot":"visit-detail-overview-actions","component":"editVisitDetailsActionButton","online":true,"offline":true,"order":0},{"name":"delete-visit-action-button","slot":"visit-detail-overview-actions","component":"deleteVisitActionButton","online":true,"offline":true,"order":1},{"name":"active-visit-action-button","slot":"active-visit-actions","component":"activeVisitActionsComponent","online":true,"offline":true,"order":1},{"name":"visit-context-header","slot":"visit-context-header-slot","component":"visitContextHeader"},{"name":"retrospective-date-time-picker","slot":"restrospective-date-time-picker-slot","component":"retrospectiveDateTimePicker"}],"featureFlags":[{"description":"Features to enter data for past visits. Includes the 'Edit Past Visit' button in the start visit dialog, and the 'Add Past Visit' button in the patient header","flagName":"rde","label":"Retrospective Data Entry"},{"description":"When enabled, encounter summaries will display the full form layout instead of a simple observation list.","flagName":"enable-embedded-form-view","label":"Enable Embedded Form View"}],"modals":[{"name":"delete-encounter-modal","component":"deleteEncounterModal"},{"name":"delete-visit-dialog","component":"deleteVisitModal"},{"name":"end-visit-dialog","component":"endVisitModal"},{"name":"mark-patient-alive-modal","component":"markPatientAliveModal"},{"name":"modify-visit-date-dialog","component":"modifyVisitDateModal"},{"name":"start-visit-dialog","component":"startVisitModal"},{"name":"visit-context-switcher","component":"visitContextSwitcherModal"}],"pages":[{"component":"root","routeRegex":"^patient/.+/chart","online":true,"offline":true}],"workspaces":[{"name":"mark-patient-deceased-workspace-form","component":"markPatientDeceasedForm","title":"Mark patient deceased","type":"form"},{"name":"start-visit-workspace-form","component":"startVisitWorkspace","title":"startVisitWorkspaceTitle","type":"start-visit"}],"version":"11.3.1-pre.9203"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-chart-app",
3
- "version": "11.3.1-pre.9201",
3
+ "version": "11.3.1-pre.9203",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Patient dashboard microfrontend for the OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-patient-chart-app.js",
@@ -55,7 +55,7 @@
55
55
  "swr": "2.x"
56
56
  },
57
57
  "devDependencies": {
58
- "@openmrs/esm-patient-common-lib": "11.3.1-pre.9201",
58
+ "@openmrs/esm-patient-common-lib": "11.3.1-pre.9203",
59
59
  "@types/uuid": "^9.0.4",
60
60
  "webpack": "^5.99.9"
61
61
  },
@@ -0,0 +1,306 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { renderTag } from './tag.component';
4
+ import { type ConfigConcepts, type Encounter, type Observation } from '../types';
5
+
6
+ describe('Tag component', () => {
7
+ const mockConfig: ConfigConcepts = {
8
+ trueConceptUuid: 'true-uuid',
9
+ falseConceptUuid: 'false-uuid',
10
+ otherConceptUuid: 'other-uuid',
11
+ };
12
+
13
+ const mockStatusColorMappings = {
14
+ 'status-uuid-1': 'green',
15
+ 'status-uuid-2': 'red',
16
+ };
17
+
18
+ const createMockEncounter = (obsValue: Observation['value']): Encounter => ({
19
+ uuid: 'encounter-uuid',
20
+ encounterDatetime: '2024-01-01',
21
+ encounterType: {
22
+ uuid: 'encounter-type-uuid',
23
+ name: 'Test Encounter',
24
+ },
25
+ obs: [
26
+ {
27
+ uuid: 'obs-uuid',
28
+ concept: {
29
+ uuid: 'test-concept-uuid',
30
+ name: 'Test Concept',
31
+ },
32
+ value: obsValue,
33
+ obsDatetime: '2024-01-01',
34
+ },
35
+ ],
36
+ encounterProviders: [],
37
+ form: undefined,
38
+ patient: {
39
+ uuid: 'patient-uuid',
40
+ display: 'Test Patient',
41
+ age: 30,
42
+ birthDate: '1994-01-01',
43
+ },
44
+ location: {
45
+ uuid: 'location-uuid',
46
+ display: 'Test Location',
47
+ name: 'Test Location',
48
+ },
49
+ });
50
+
51
+ it('should render "--" when columnStatus is "--"', () => {
52
+ const mockEncounter = createMockEncounter('--');
53
+ const view = renderTag(mockEncounter, 'non-existent-concept', mockStatusColorMappings, mockConfig);
54
+ expect(view).toBe('--');
55
+ });
56
+
57
+ it('should render a Tag component with the correct text content', () => {
58
+ const mockEncounter = createMockEncounter({
59
+ uuid: 'status-uuid-1',
60
+ name: {
61
+ name: 'Active',
62
+ display: 'Active',
63
+ },
64
+ });
65
+
66
+ render(
67
+ <div data-testid="tag-wrapper">
68
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
69
+ </div>,
70
+ );
71
+
72
+ expect(screen.getByText('Active')).toBeInTheDocument();
73
+ });
74
+
75
+ it('should not have a title attribute when rendering a Tag', () => {
76
+ const mockEncounter = createMockEncounter({
77
+ uuid: 'status-uuid-1',
78
+ name: {
79
+ name: 'Active',
80
+ display: 'Active',
81
+ },
82
+ });
83
+
84
+ const { container } = render(
85
+ <div data-testid="tag-wrapper">
86
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
87
+ </div>,
88
+ );
89
+
90
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
91
+ const tag = container.querySelector('.cds--tag');
92
+ expect(tag).not.toHaveAttribute('title');
93
+ expect(screen.getByText('Active')).toBeInTheDocument();
94
+ });
95
+
96
+ it('should apply the correct color type based on status color mappings', () => {
97
+ const mockEncounter = createMockEncounter({
98
+ uuid: 'status-uuid-2',
99
+ name: {
100
+ name: 'Inactive',
101
+ display: 'Inactive',
102
+ },
103
+ });
104
+
105
+ const { container } = render(
106
+ <div data-testid="tag-wrapper">
107
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
108
+ </div>,
109
+ );
110
+
111
+ expect(screen.getByText('Inactive')).toBeInTheDocument();
112
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
113
+ const tag = container.querySelector('.cds--tag');
114
+ expect(tag).toHaveClass('cds--tag--red');
115
+ });
116
+
117
+ it('should render with minimum width style', () => {
118
+ const mockEncounter = createMockEncounter({
119
+ uuid: 'status-uuid-1',
120
+ name: {
121
+ name: 'Active',
122
+ display: 'Active',
123
+ },
124
+ });
125
+
126
+ const { container } = render(
127
+ <div data-testid="tag-wrapper">
128
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
129
+ </div>,
130
+ );
131
+
132
+ expect(screen.getByText('Active')).toBeInTheDocument();
133
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
134
+ const tag = container.querySelector('.cds--tag');
135
+ expect(tag).toHaveStyle({ minWidth: '80px' });
136
+ });
137
+
138
+ it('should handle string values correctly', () => {
139
+ const mockEncounter = createMockEncounter('Completed');
140
+
141
+ render(
142
+ <div data-testid="tag-wrapper">
143
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
144
+ </div>,
145
+ );
146
+
147
+ expect(screen.getByText('Completed')).toBeInTheDocument();
148
+ });
149
+
150
+ it('should render Tag without color type when uuid is not in statusColorMappings', () => {
151
+ const mockEncounter = createMockEncounter({
152
+ uuid: 'unmapped-uuid',
153
+ name: {
154
+ name: 'Unmapped Status',
155
+ display: 'Unmapped Status',
156
+ },
157
+ });
158
+
159
+ const { container } = render(
160
+ <div data-testid="tag-wrapper">
161
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
162
+ </div>,
163
+ );
164
+
165
+ expect(screen.getByText('Unmapped Status')).toBeInTheDocument();
166
+
167
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
168
+ const tag = container.querySelector('.cds--tag');
169
+ expect(tag).toBeInTheDocument();
170
+ const allColorClasses = Object.values(mockStatusColorMappings).map((color) => `cds--tag--${color}`);
171
+ allColorClasses.forEach((colorClass) => {
172
+ expect(tag).not.toHaveClass(colorClass);
173
+ });
174
+ });
175
+
176
+ it('should render Tag without color type when value is a string', () => {
177
+ const mockEncounter = createMockEncounter('String Value');
178
+
179
+ const { container } = render(
180
+ <div data-testid="tag-wrapper">
181
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
182
+ </div>,
183
+ );
184
+
185
+ expect(screen.getByText('String Value')).toBeInTheDocument();
186
+
187
+ // String values don't have uuid, so no color type should be applied
188
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
189
+ const tag = container.querySelector('.cds--tag');
190
+ expect(tag).toBeInTheDocument();
191
+ const allColorClasses = Object.values(mockStatusColorMappings).map((color) => `cds--tag--${color}`);
192
+ allColorClasses.forEach((colorClass) => {
193
+ expect(tag).not.toHaveClass(colorClass);
194
+ });
195
+ });
196
+
197
+ it('should render Tag without color type when observation value object lacks uuid property', () => {
198
+ // Create an observation value without uuid property (edge case)
199
+ const mockEncounter: Encounter = {
200
+ uuid: 'encounter-uuid',
201
+ encounterDatetime: '2024-01-01',
202
+ encounterType: {
203
+ uuid: 'encounter-type-uuid',
204
+ name: 'Test Encounter',
205
+ },
206
+ obs: [
207
+ {
208
+ uuid: 'obs-uuid',
209
+ concept: {
210
+ uuid: 'test-concept-uuid',
211
+ name: 'Test Concept',
212
+ },
213
+ value: {
214
+ name: {
215
+ name: 'Status Without UUID',
216
+ display: 'Status Without UUID',
217
+ },
218
+ // Missing uuid property - using type assertion for test case
219
+ } as Observation['value'],
220
+ obsDatetime: '2024-01-01',
221
+ },
222
+ ],
223
+ encounterProviders: [],
224
+ form: undefined,
225
+ patient: {
226
+ uuid: 'patient-uuid',
227
+ display: 'Test Patient',
228
+ age: 30,
229
+ birthDate: '1994-01-01',
230
+ },
231
+ location: {
232
+ uuid: 'location-uuid',
233
+ display: 'Test Location',
234
+ name: 'Test Location',
235
+ },
236
+ };
237
+
238
+ const { container } = render(
239
+ <div data-testid="tag-wrapper">
240
+ {renderTag(mockEncounter, 'test-concept-uuid', mockStatusColorMappings, mockConfig)}
241
+ </div>,
242
+ );
243
+
244
+ expect(screen.getByText('Status Without UUID')).toBeInTheDocument();
245
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
246
+ const tag = container.querySelector('.cds--tag');
247
+ const allColorClasses = Object.values(mockStatusColorMappings).map((color) => `cds--tag--${color}`);
248
+ allColorClasses.forEach((colorClass) => {
249
+ expect(tag).not.toHaveClass(colorClass);
250
+ });
251
+ });
252
+
253
+ it('should handle empty statusColorMappings', () => {
254
+ const emptyMappings = {};
255
+ const mockEncounter = createMockEncounter({
256
+ uuid: 'status-uuid-1',
257
+ name: {
258
+ name: 'Active',
259
+ display: 'Active',
260
+ },
261
+ });
262
+
263
+ const { container } = render(
264
+ <div data-testid="tag-wrapper">{renderTag(mockEncounter, 'test-concept-uuid', emptyMappings, mockConfig)}</div>,
265
+ );
266
+
267
+ expect(screen.getByText('Active')).toBeInTheDocument();
268
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
269
+ const tag = container.querySelector('.cds--tag');
270
+ expect(tag).toBeInTheDocument();
271
+ // With empty mappings, verify no color classes from mockStatusColorMappings are applied
272
+ const allColorClasses = Object.values(mockStatusColorMappings).map((color) => `cds--tag--${color}`);
273
+ allColorClasses.forEach((colorClass) => {
274
+ expect(tag).not.toHaveClass(colorClass);
275
+ });
276
+ });
277
+
278
+ it('should handle when findObs returns undefined (no observation found)', () => {
279
+ const mockEncounter: Encounter = {
280
+ uuid: 'encounter-uuid',
281
+ encounterDatetime: '2024-01-01',
282
+ encounterType: {
283
+ uuid: 'encounter-type-uuid',
284
+ name: 'Test Encounter',
285
+ },
286
+ obs: [], // No observations
287
+ encounterProviders: [],
288
+ form: undefined,
289
+ patient: {
290
+ uuid: 'patient-uuid',
291
+ display: 'Test Patient',
292
+ age: 30,
293
+ birthDate: '1994-01-01',
294
+ },
295
+ location: {
296
+ uuid: 'location-uuid',
297
+ display: 'Test Location',
298
+ name: 'Test Location',
299
+ },
300
+ };
301
+
302
+ const view = renderTag(mockEncounter, 'non-existent-concept', mockStatusColorMappings, mockConfig);
303
+ // When no observation is found, getObsFromEncounter returns '--'
304
+ expect(view).toBe('--');
305
+ });
306
+ });
@@ -9,36 +9,35 @@ export const renderTag = (
9
9
  statusColorMappings: Record<string, string>,
10
10
  config: ConfigConcepts,
11
11
  ) => {
12
- const columnStatus = getObsFromEncounter({ encounter: encounter, obsConcept: concept, config: config });
12
+ const columnStatus = getObsFromEncounter({ encounter, obsConcept: concept, config });
13
13
  const columnStatusObs = findObs(encounter, concept);
14
14
 
15
- if (columnStatus == '--') {
15
+ if (columnStatus === '--') {
16
16
  return '--';
17
- } else {
18
- return (
19
- <Tag
20
- type={
21
- typeof columnStatusObs?.value === 'object' && 'uuid' in columnStatusObs.value
22
- ? (statusColorMappings[columnStatusObs.value.uuid] as
23
- | 'red'
24
- | 'magenta'
25
- | 'purple'
26
- | 'blue'
27
- | 'cyan'
28
- | 'teal'
29
- | 'green'
30
- | 'gray'
31
- | 'cool-gray'
32
- | 'warm-gray'
33
- | 'high-contrast'
34
- | 'outline')
35
- : undefined
36
- }
37
- title={typeof columnStatus === 'string' ? columnStatus : ''}
38
- style={{ minWidth: '80px' }}
39
- >
40
- {typeof columnStatus === 'string' ? columnStatus : ''}
41
- </Tag>
42
- );
43
17
  }
18
+
19
+ return (
20
+ <Tag
21
+ type={
22
+ typeof columnStatusObs?.value === 'object' && 'uuid' in columnStatusObs.value
23
+ ? (statusColorMappings[columnStatusObs.value.uuid] as
24
+ | 'red'
25
+ | 'magenta'
26
+ | 'purple'
27
+ | 'blue'
28
+ | 'cyan'
29
+ | 'teal'
30
+ | 'green'
31
+ | 'gray'
32
+ | 'cool-gray'
33
+ | 'warm-gray'
34
+ | 'high-contrast'
35
+ | 'outline')
36
+ : undefined
37
+ }
38
+ style={{ minWidth: '80px' }}
39
+ >
40
+ {typeof columnStatus === 'string' ? columnStatus : ''}
41
+ </Tag>
42
+ );
44
43
  };