@openmrs/esm-patient-vitals-app 9.2.3-pre.7474 → 9.2.3-pre.7484

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_vitals_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,p,f,d,c,h,m,v,g,b,y,w,_={8746:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(5395),t.e(8295),t.e(1343),t.e(1196),t.e(5387)]).then((()=>()=>t(5387)))},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,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,S),t.loaded=!0,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-vitals-app:",S.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==o)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+o){i=p;break}}i||(l=!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(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),l&&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.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{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-vitals-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","6.2.1-pre.2884",(()=>Promise.all([S.e(831),S.e(1343)]).then((()=>()=>S(831))))),l("@openmrs/esm-patient-common-lib","9.2.3-pre.7474",(()=>Promise.all([S.e(5395),S.e(4605),S.e(1343),S.e(5434),S.e(9867),S.e(1196)]).then((()=>()=>S(2248))))),l("dayjs","1.11.11",(()=>S.e(3464).then((()=>()=>S(3464))))),l("react-i18next","11.18.6",(()=>Promise.all([S.e(4641),S.e(1343)]).then((()=>()=>S(4641))))),l("react-router-dom","6.16.0",(()=>Promise.all([S.e(2913),S.e(1343)]).then((()=>()=>S(2913))))),l("react","18.3.1",(()=>S.e(4041).then((()=>()=>S(4041))))),l("swr/_internal","2.2.5",(()=>Promise.all([S.e(2372),S.e(1343)]).then((()=>()=>S(2372))))),l("swr/immutable","2.2.5",(()=>Promise.all([S.e(9876),S.e(1343),S.e(5434)]).then((()=>()=>S(9876))))),l("swr/infinite","2.2.5",(()=>Promise.all([S.e(2470),S.e(1343),S.e(5434)]).then((()=>()=>S(2470)))))),e[t]=s.length?Promise.all(s).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(/#.*$/,"").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],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"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(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var a=[];for(o=1;o<e.length;o++){var l=e[o];a.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?a.pop()+" "+a.pop():i(l))}return s();function s(){return a.pop().replace(/^\((.+)\)$/,"$1")}},l=(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,s=!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!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 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?l(h,r):!c())}return!!c()},s=(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)},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=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(!s(r,t))return m(e,t,a);var i=f(r,t,n);return l(o,i)||h(d(r,t,i,o)),u(r[t][i])})),g={},b={1343:()=>v("default","react",!1,[1,18],(()=>S.e(4041).then((()=>()=>S(4041))))),5434:()=>v("default","swr/_internal",!1,[1,2],(()=>S.e(2372).then((()=>()=>S(2372))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>S.e(2913).then((()=>()=>S(2913))))),3150:()=>v("default","react-i18next",!1,[1,11],(()=>S.e(4641).then((()=>()=>S(4641))))),7223:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,9],(()=>Promise.all([S.e(4605),S.e(5434),S.e(9867)]).then((()=>()=>S(2248))))),8010:()=>v("default","swr/immutable",!1,[1,2],(()=>Promise.all([S.e(9876),S.e(5434)]).then((()=>()=>S(9876))))),8254:()=>v("default","@openmrs/esm-framework",!1,[1,6],(()=>S.e(831).then((()=>()=>S(831))))),6372:()=>v("default","dayjs",!1,[1,1],(()=>S.e(3464).then((()=>()=>S(3464))))),8394:()=>v("default","swr/infinite",!1,[1,2],(()=>Promise.all([S.e(2470),S.e(5434)]).then((()=>()=>S(2470)))))},y={1196:[3150,7223,8010,8254],1343:[1343],5387:[6372,8394],5434:[5434],9867:[8877]},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={6167: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(/^(1196|1343|5434)$/.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,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)S.o(i,n)&&(S.m[n]=i[n]);l&&l(S)}for(r&&r(t);s<a.length;s++)o=a[s],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_patient_vitals_app=globalThis.webpackChunk_openmrs_esm_patient_vitals_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),S.nc=void 0;var j=S(8746);_openmrs_esm_patient_vitals_app=j})();
1
+ var _openmrs_esm_patient_vitals_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,p,f,d,c,h,m,v,g,b,y,w,_={8746:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(5395),t.e(8295),t.e(1343),t.e(1196),t.e(5387)]).then((()=>()=>t(5387)))},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,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,S),t.loaded=!0,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-vitals-app:",S.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==o)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+o){i=p;break}}i||(l=!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(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),l&&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.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{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-vitals-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","6.2.1-pre.2884",(()=>Promise.all([S.e(831),S.e(1343)]).then((()=>()=>S(831))))),l("@openmrs/esm-patient-common-lib","9.2.3-pre.7484",(()=>Promise.all([S.e(5395),S.e(4605),S.e(1343),S.e(5434),S.e(9867),S.e(1196)]).then((()=>()=>S(2248))))),l("dayjs","1.11.11",(()=>S.e(3464).then((()=>()=>S(3464))))),l("react-i18next","11.18.6",(()=>Promise.all([S.e(4641),S.e(1343)]).then((()=>()=>S(4641))))),l("react-router-dom","6.16.0",(()=>Promise.all([S.e(2913),S.e(1343)]).then((()=>()=>S(2913))))),l("react","18.3.1",(()=>S.e(4041).then((()=>()=>S(4041))))),l("swr/_internal","2.2.5",(()=>Promise.all([S.e(2372),S.e(1343)]).then((()=>()=>S(2372))))),l("swr/immutable","2.2.5",(()=>Promise.all([S.e(9876),S.e(1343),S.e(5434)]).then((()=>()=>S(9876))))),l("swr/infinite","2.2.5",(()=>Promise.all([S.e(2470),S.e(1343),S.e(5434)]).then((()=>()=>S(2470)))))),e[t]=s.length?Promise.all(s).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(/#.*$/,"").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],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"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(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var a=[];for(o=1;o<e.length;o++){var l=e[o];a.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?a.pop()+" "+a.pop():i(l))}return s();function s(){return a.pop().replace(/^\((.+)\)$/,"$1")}},l=(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,s=!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!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 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?l(h,r):!c())}return!!c()},s=(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)},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=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(!s(r,t))return m(e,t,a);var i=f(r,t,n);return l(o,i)||h(d(r,t,i,o)),u(r[t][i])})),g={},b={1343:()=>v("default","react",!1,[1,18],(()=>S.e(4041).then((()=>()=>S(4041))))),5434:()=>v("default","swr/_internal",!1,[1,2],(()=>S.e(2372).then((()=>()=>S(2372))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>S.e(2913).then((()=>()=>S(2913))))),3150:()=>v("default","react-i18next",!1,[1,11],(()=>S.e(4641).then((()=>()=>S(4641))))),7223:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,9],(()=>Promise.all([S.e(4605),S.e(5434),S.e(9867)]).then((()=>()=>S(2248))))),8010:()=>v("default","swr/immutable",!1,[1,2],(()=>Promise.all([S.e(9876),S.e(5434)]).then((()=>()=>S(9876))))),8254:()=>v("default","@openmrs/esm-framework",!1,[1,6],(()=>S.e(831).then((()=>()=>S(831))))),6372:()=>v("default","dayjs",!1,[1,1],(()=>S.e(3464).then((()=>()=>S(3464))))),8394:()=>v("default","swr/infinite",!1,[1,2],(()=>Promise.all([S.e(2470),S.e(5434)]).then((()=>()=>S(2470)))))},y={1196:[3150,7223,8010,8254],1343:[1343],5387:[6372,8394],5434:[5434],9867:[8877]},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={6167: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(/^(1196|1343|5434)$/.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,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)S.o(i,n)&&(S.m[n]=i[n]);l&&l(S)}for(r&&r(t);s<a.length;s++)o=a[s],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_patient_vitals_app=globalThis.webpackChunk_openmrs_esm_patient_vitals_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),S.nc=void 0;var j=S(8746);_openmrs_esm_patient_vitals_app=j})();
@@ -162,9 +162,9 @@
162
162
  "initial": false,
163
163
  "entry": false,
164
164
  "recorded": false,
165
- "size": 138789,
165
+ "size": 138426,
166
166
  "sizes": {
167
- "javascript": 138789
167
+ "javascript": 138426
168
168
  },
169
169
  "names": [],
170
170
  "idHints": [],
@@ -178,7 +178,7 @@
178
178
  "auxiliaryFiles": [
179
179
  "1423.js.map"
180
180
  ],
181
- "hash": "778acacc8b06ffcd",
181
+ "hash": "22bdc219309425f7",
182
182
  "childrenByOrder": {}
183
183
  },
184
184
  {
@@ -660,9 +660,9 @@
660
660
  "initial": false,
661
661
  "entry": false,
662
662
  "recorded": false,
663
- "size": 32792,
663
+ "size": 32727,
664
664
  "sizes": {
665
- "javascript": 32792
665
+ "javascript": 32727
666
666
  },
667
667
  "names": [],
668
668
  "idHints": [],
@@ -676,7 +676,7 @@
676
676
  "auxiliaryFiles": [
677
677
  "5207.js.map"
678
678
  ],
679
- "hash": "d8da2f4c2ff6e2a0",
679
+ "hash": "8003d5a383c3d3b8",
680
680
  "childrenByOrder": {}
681
681
  },
682
682
  {
@@ -706,9 +706,9 @@
706
706
  "initial": false,
707
707
  "entry": false,
708
708
  "recorded": false,
709
- "size": 410022,
709
+ "size": 417255,
710
710
  "sizes": {
711
- "javascript": 409938,
711
+ "javascript": 417171,
712
712
  "consume-shared": 84
713
713
  },
714
714
  "names": [],
@@ -722,7 +722,7 @@
722
722
  "auxiliaryFiles": [
723
723
  "5387.js.map"
724
724
  ],
725
- "hash": "3af24a94a2e45545",
725
+ "hash": "02b0af60e38456a1",
726
726
  "childrenByOrder": {}
727
727
  },
728
728
  {
@@ -841,7 +841,7 @@
841
841
  "auxiliaryFiles": [
842
842
  "openmrs-esm-patient-vitals-app.js.map"
843
843
  ],
844
- "hash": "57e7ae43458701e2",
844
+ "hash": "eba9f360991e5c85",
845
845
  "childrenByOrder": {}
846
846
  },
847
847
  {
@@ -1029,10 +1029,10 @@
1029
1029
  "initial": true,
1030
1030
  "entry": true,
1031
1031
  "recorded": false,
1032
- "size": 3575774,
1032
+ "size": 3583007,
1033
1033
  "sizes": {
1034
1034
  "consume-shared": 294,
1035
- "javascript": 3552919,
1035
+ "javascript": 3560152,
1036
1036
  "share-init": 378,
1037
1037
  "runtime": 22183
1038
1038
  },
@@ -1049,7 +1049,7 @@
1049
1049
  "auxiliaryFiles": [
1050
1050
  "main.js.map"
1051
1051
  ],
1052
- "hash": "8ac42b9896da47ca",
1052
+ "hash": "32898dc65623b39f",
1053
1053
  "childrenByOrder": {}
1054
1054
  },
1055
1055
  {
@@ -1073,7 +1073,7 @@
1073
1073
  "auxiliaryFiles": [
1074
1074
  "8953.js.map"
1075
1075
  ],
1076
- "hash": "55f300d0ef45c3f0",
1076
+ "hash": "b0bd72ae952ed410",
1077
1077
  "childrenByOrder": {}
1078
1078
  },
1079
1079
  {
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":"vitals-overview-widget","component":"vitalsSummary","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":true},"order":1},{"name":"vitals-details-widget","component":"vitalsMain","slot":"patient-chart-vitals-biometrics-dashboard-slot","meta":{"title":"Vitals","view":"vitals","fullWidth":true},"order":1},{"name":"patient-vitals-info","component":"vitalsHeader","slot":"patient-info-slot"},{"name":"biometrics-overview-widget","component":"biometricsOverview","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":true},"order":2},{"name":"biometrics-details-widget","component":"biometricsDetailedSummary","slot":"patient-chart-vitals-biometrics-dashboard-slot","meta":{"view":"biometrics","title":"Biometrics","fullWidth":true}},{"name":"results-summary-dashboard","component":"vitalsAndBiometricsDashboardLink","slot":"patient-chart-dashboard-slot","order":2,"meta":{"slot":"patient-chart-vitals-biometrics-dashboard-slot","path":"Vitals & Biometrics"}},{"name":"weight-tile","component":"weightTile","slot":"visit-form-header-slot","order":2}],"pages":[],"workspaces":[{"name":"patient-vitals-biometrics-form-workspace","title":"recordVitalsAndBiometrics","component":"vitalsBiometricsFormWorkspace"}],"modals":[{"name":"vitals-biometrics-delete-confirmation-modal","component":"vitalsAndBiometricsDeleteConfirmationModal"}],"version":"9.2.3-pre.7474"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.2.0"},"extensions":[{"name":"vitals-overview-widget","component":"vitalsSummary","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":true},"order":1},{"name":"vitals-details-widget","component":"vitalsMain","slot":"patient-chart-vitals-biometrics-dashboard-slot","meta":{"title":"Vitals","view":"vitals","fullWidth":true},"order":1},{"name":"patient-vitals-info","component":"vitalsHeader","slot":"patient-info-slot"},{"name":"biometrics-overview-widget","component":"biometricsOverview","slot":"patient-chart-summary-dashboard-slot","meta":{"fullWidth":true},"order":2},{"name":"biometrics-details-widget","component":"biometricsDetailedSummary","slot":"patient-chart-vitals-biometrics-dashboard-slot","meta":{"view":"biometrics","title":"Biometrics","fullWidth":true}},{"name":"results-summary-dashboard","component":"vitalsAndBiometricsDashboardLink","slot":"patient-chart-dashboard-slot","order":2,"meta":{"slot":"patient-chart-vitals-biometrics-dashboard-slot","path":"Vitals & Biometrics"}},{"name":"weight-tile","component":"weightTile","slot":"visit-form-header-slot","order":2}],"pages":[],"workspaces":[{"name":"patient-vitals-biometrics-form-workspace","title":"recordVitalsAndBiometrics","component":"vitalsBiometricsFormWorkspace"}],"modals":[{"name":"vitals-biometrics-delete-confirmation-modal","component":"vitalsAndBiometricsDeleteConfirmationModal"}],"version":"9.2.3-pre.7484"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-vitals-app",
3
- "version": "9.2.3-pre.7474",
3
+ "version": "9.2.3-pre.7484",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Patient vitals microfrontend for the OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-patient-vitals-app.js",
@@ -53,7 +53,7 @@
53
53
  "swr": "2.x"
54
54
  },
55
55
  "devDependencies": {
56
- "@openmrs/esm-patient-common-lib": "9.2.3-pre.7474",
56
+ "@openmrs/esm-patient-common-lib": "9.2.3-pre.7484",
57
57
  "webpack": "^5.94.0"
58
58
  },
59
59
  "stableVersion": "9.2.2"
@@ -5,7 +5,7 @@ import { Add, Analytics, Table } from '@carbon/react/icons';
5
5
  import { formatDatetime, parseDate, useConfig, useLayoutType } from '@openmrs/esm-framework';
6
6
  import { CardHeader, EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
7
7
  import { useLaunchVitalsAndBiometricsForm } from '../utils';
8
- import { useVitalsConceptMetadata, useVitalsAndBiometrics, withUnit } from '../common';
8
+ import { useConceptUnits, useVitalsAndBiometrics, withUnit } from '../common';
9
9
  import { type ConfigObject } from '../config-schema';
10
10
  import type { BiometricsTableHeader, BiometricsTableRow } from './types';
11
11
  import BiometricsChart from './biometrics-chart.component';
@@ -29,7 +29,7 @@ const BiometricsBase: React.FC<BiometricsBaseProps> = ({ patientUuid, pageSize,
29
29
  const config = useConfig<ConfigObject>();
30
30
  const { bmiUnit } = config.biometrics;
31
31
  const { data: biometrics, isLoading, error, isValidating } = useVitalsAndBiometrics(patientUuid, 'biometrics');
32
- const { data: conceptUnits } = useVitalsConceptMetadata();
32
+ const { conceptUnits } = useConceptUnits();
33
33
  const launchBiometricsForm = useLaunchVitalsAndBiometricsForm();
34
34
 
35
35
  const tableHeaders: Array<BiometricsTableHeader> = [
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { screen } from '@testing-library/react';
4
4
  import userEvent from '@testing-library/user-event';
5
5
  import { getDefaultsFromConfigSchema, useConfig } from '@openmrs/esm-framework';
6
- import { formattedBiometrics, mockBiometricsConfig, mockConceptMetadata, mockConceptUnits } from '__mocks__';
6
+ import { formattedBiometrics, mockBiometricsConfig, mockConceptUnits } from '__mocks__';
7
7
  import { configSchema, type ConfigObject } from '../config-schema';
8
8
  import { mockPatient, patientChartBasePath, renderWithSwr, waitForLoadingToFinish } from 'tools';
9
9
  import { useVitalsAndBiometrics } from '../common';
@@ -22,9 +22,9 @@ jest.mock('../common', () => {
22
22
 
23
23
  return {
24
24
  ...originalModule,
25
- useVitalsConceptMetadata: jest.fn().mockImplementation(() => ({
26
- data: mockConceptUnits,
27
- conceptMetadata: mockConceptMetadata,
25
+ useConceptUnits: jest.fn().mockImplementation(() => ({
26
+ conceptUnits: mockConceptUnits,
27
+ error: null,
28
28
  isLoading: false,
29
29
  })),
30
30
  useVitalsAndBiometrics: jest.fn(),
@@ -36,7 +36,7 @@ mockUseConfig.mockReturnValue({
36
36
  ...mockBiometricsConfig,
37
37
  } as ConfigObject);
38
38
 
39
- describe('BiometricsOverview', () => {
39
+ describe('Biometrics Overview', () => {
40
40
  it('renders an empty state view if biometrics data is unavailable', async () => {
41
41
  mockUseVitalsAndBiometrics.mockReturnValue({
42
42
  data: [],
@@ -12,7 +12,13 @@ import useSWRImmutable from 'swr/immutable';
12
12
  import useSWRInfinite from 'swr/infinite';
13
13
  import { type ConfigObject } from '../config-schema';
14
14
  import { assessValue, calculateBodyMassIndex, getReferenceRangesForConcept, interpretBloodPressure } from './helpers';
15
- import type { FHIRSearchBundleResponse, MappedVitals, PatientVitalsAndBiometrics, VitalsResponse } from './types';
15
+ import type {
16
+ FHIRObservationResource,
17
+ FHIRSearchBundleResponse,
18
+ MappedVitals,
19
+ PatientVitalsAndBiometrics,
20
+ VitalsResponse,
21
+ } from './types';
16
22
 
17
23
  const pageSize = 100;
18
24
 
@@ -21,6 +27,18 @@ const swrKeyNeedle = Symbol('vitalsAndBiometrics');
21
27
  const encounterRepresentation =
22
28
  'custom:(uuid,encounterDatetime,encounterType:(uuid,display),obs:(uuid,concept:(uuid,display),value,interpretation))';
23
29
 
30
+ type ConceptRange = {
31
+ display: string;
32
+ hiAbsolute: number | null;
33
+ hiCritical: number | null;
34
+ hiNormal: number | null;
35
+ lowAbsolute: number | null;
36
+ lowCritical: number | null;
37
+ lowNormal: number | null;
38
+ units: string | null;
39
+ uuid: string;
40
+ };
41
+
24
42
  type VitalsAndBiometricsMode = 'vitals' | 'biometrics' | 'both';
25
43
 
26
44
  type VitalsAndBiometricsSwrKey = {
@@ -63,12 +81,66 @@ function getInterpretationKey(header: string) {
63
81
  return `${header}RenderInterpretation`;
64
82
  }
65
83
 
66
- export function useVitalsConceptMetadata() {
84
+ export function useVitalsConceptMetadata(patientUuid: string) {
85
+ const {
86
+ concepts: {
87
+ diastolicBloodPressureUuid,
88
+ oxygenSaturationUuid,
89
+ pulseUuid,
90
+ respiratoryRateUuid,
91
+ systolicBloodPressureUuid,
92
+ temperatureUuid,
93
+ },
94
+ } = useConfig<ConfigObject>();
95
+
96
+ const apiUrl = `${restBaseUrl}/conceptreferencerange/?patient=${patientUuid}&concept=${systolicBloodPressureUuid},${diastolicBloodPressureUuid},${pulseUuid},${temperatureUuid},${oxygenSaturationUuid},${respiratoryRateUuid}&v=full`;
97
+
98
+ const { data, error, isLoading } = useSWRImmutable<{ data: any }, Error>(patientUuid ? apiUrl : null, openmrsFetch);
99
+
100
+ const conceptMetadata = data?.data?.results;
101
+
102
+ const conceptUnits = conceptMetadata?.length
103
+ ? new Map<string, string>(conceptMetadata.map((concept) => [concept.uuid, concept.units]))
104
+ : new Map<string, string>([]);
105
+
106
+ const conceptRanges = useMemo(
107
+ () =>
108
+ conceptMetadata?.length
109
+ ? conceptMetadata.map((concept) => ({
110
+ uuid: concept.concept,
111
+ display: concept.display,
112
+ hiNormal: concept.hiNormal ?? null,
113
+ hiAbsolute: concept.hiAbsolute ?? null,
114
+ hiCritical: concept.hiCritical ?? null,
115
+ lowNormal: concept.lowNormal ?? null,
116
+ lowAbsolute: concept.lowAbsolute ?? null,
117
+ lowCritical: concept.lowCritical ?? null,
118
+ units: concept.units ?? null,
119
+ }))
120
+ : [],
121
+ [conceptMetadata],
122
+ );
123
+
124
+ const conceptRangeMap = useMemo(
125
+ () => new Map<string, ConceptRange>(conceptRanges.map((range) => [range.uuid, range])),
126
+ [conceptRanges],
127
+ );
128
+
129
+ return {
130
+ data: conceptUnits,
131
+ error,
132
+ isLoading,
133
+ conceptMetadata,
134
+ conceptRanges,
135
+ conceptRangeMap,
136
+ };
137
+ }
138
+
139
+ export function useConceptUnits() {
67
140
  const { concepts } = useConfig<ConfigObject>();
68
141
  const vitalSignsConceptSetUuid = concepts.vitalSignsConceptSetUuid;
69
142
 
70
- const customRepresentation =
71
- 'custom:(setMembers:(uuid,display,hiNormal,hiAbsolute,hiCritical,lowNormal,lowAbsolute,lowCritical,units))';
143
+ const customRepresentation = 'custom:(setMembers:(uuid,display,units))';
72
144
 
73
145
  const apiUrl = `${restBaseUrl}/concept/${vitalSignsConceptSetUuid}?v=${customRepresentation}`;
74
146
 
@@ -83,24 +155,10 @@ export function useVitalsConceptMetadata() {
83
155
  ? new Map<string, string>(conceptMetadata.map((concept) => [concept.uuid, concept.units]))
84
156
  : new Map<string, string>([]);
85
157
 
86
- const conceptRanges = conceptMetadata?.length
87
- ? new Map<string, { lowAbsolute: number | null; highAbsolute: number | null }>(
88
- conceptMetadata.map((concept) => [
89
- concept.uuid,
90
- {
91
- lowAbsolute: concept.lowAbsolute ?? null,
92
- highAbsolute: concept.hiAbsolute ?? null,
93
- },
94
- ]),
95
- )
96
- : new Map<string, { lowAbsolute: number | null; highAbsolute: number | null }>([]);
97
-
98
158
  return {
99
- data: conceptUnits,
159
+ conceptUnits,
100
160
  error,
101
161
  isLoading,
102
- conceptMetadata,
103
- conceptRanges,
104
162
  };
105
163
  }
106
164
 
@@ -153,9 +211,9 @@ export function useVitalsOrBiometricsConcepts(mode: VitalsAndBiometricsMode) {
153
211
  * @returns An SWR-like structure that includes the cleaned-up vitals
154
212
  */
155
213
  export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiometricsMode = 'vitals') {
156
- const { conceptMetadata } = useVitalsConceptMetadata();
157
- const { concepts } = useConfig<ConfigObject>();
158
214
  const conceptUuids = useVitalsOrBiometricsConcepts(mode);
215
+ const { concepts } = useConfig<ConfigObject>();
216
+ const { conceptRanges } = useVitalsConceptMetadata(patientUuid);
159
217
 
160
218
  const getPage = useCallback(
161
219
  (page: number, prevPageData: FHIRSearchBundleResponse): VitalsAndBiometricsSwrKey => ({
@@ -225,7 +283,7 @@ export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiome
225
283
  const vitalsHashTable = data?.[0]?.data?.entry
226
284
  ?.map((entry) => entry.resource)
227
285
  .filter(Boolean)
228
- .map(vitalsProperties(conceptMetadata))
286
+ .map(mapVitalsAndBiometrics)
229
287
  ?.reduce((vitalsHashTable, vitalSign) => {
230
288
  const encounterId = vitalSign.encounterId;
231
289
  if (vitalsHashTable.has(encounterId) && vitalsHashTable.get(encounterId)) {
@@ -245,7 +303,6 @@ export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiome
245
303
  [getInterpretationKey(getVitalsMapKey(vitalSign.code))]: vitalSign.interpretation,
246
304
  });
247
305
  }
248
-
249
306
  return vitalsHashTable;
250
307
  }, new Map<string, Partial<PatientVitalsAndBiometrics>>());
251
308
 
@@ -265,13 +322,29 @@ export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiome
265
322
  vitalSigns.systolic,
266
323
  vitalSigns.diastolic,
267
324
  concepts,
268
- conceptMetadata,
325
+ conceptRanges,
326
+ );
327
+ result.pulseRenderInterpretation = assessValue(
328
+ vitalSigns.pulse,
329
+ getReferenceRangesForConcept(concepts.pulseUuid, conceptRanges),
330
+ );
331
+ result.temperatureRenderInterpretation = assessValue(
332
+ vitalSigns.temperature,
333
+ getReferenceRangesForConcept(concepts.temperatureUuid, conceptRanges),
334
+ );
335
+ result.spo2RenderInterpretation = assessValue(
336
+ vitalSigns.spo2,
337
+ getReferenceRangesForConcept(concepts.oxygenSaturationUuid, conceptRanges),
338
+ );
339
+ result.respiratoryRateRenderInterpretation = assessValue(
340
+ vitalSigns.respiratoryRate,
341
+ getReferenceRangesForConcept(concepts.respiratoryRateUuid, conceptRanges),
269
342
  );
270
343
  }
271
344
 
272
345
  return result;
273
346
  });
274
- }, [data, conceptMetadata, getVitalsMapKey, concepts, mode]);
347
+ }, [conceptRanges, concepts, data, getVitalsMapKey, mode]);
275
348
 
276
349
  return {
277
350
  data: data ? formattedObs : undefined,
@@ -365,17 +438,44 @@ function handleFetch({ patientUuid, conceptUuids, page, prevPageData }: VitalsAn
365
438
  * Mapper that converts a FHIR Observation resource into a MappedVitals object.
366
439
  * @internal
367
440
  */
368
- function vitalsProperties(conceptMetadata: Array<ConceptMetadata> | undefined) {
369
- return (resource: FHIRResource['resource']): MappedVitals => ({
441
+ function mapVitalsAndBiometrics(resource: FHIRObservationResource): MappedVitals {
442
+ const referenceRanges = {
443
+ uuid: resource?.code?.coding?.[0]?.code,
444
+ display: resource?.code?.text,
445
+ hiNormal: null,
446
+ hiAbsolute: null,
447
+ hiCritical: null,
448
+ lowNormal: null,
449
+ lowAbsolute: null,
450
+ lowCritical: null,
451
+ units: resource.valueQuantity?.unit ?? null,
452
+ };
453
+
454
+ resource?.referenceRange?.forEach((range) => {
455
+ const rangeType = range.type?.coding?.[0]?.code;
456
+ const rangeSystem = range.type?.coding?.[0]?.system;
457
+
458
+ if (rangeSystem === 'http://terminology.hl7.org/CodeSystem/referencerange-meaning') {
459
+ if (rangeType === 'normal') {
460
+ referenceRanges.hiNormal = range.high?.value ?? null;
461
+ referenceRanges.lowNormal = range.low?.value ?? null;
462
+ } else if (rangeType === 'treatment') {
463
+ referenceRanges.hiCritical = range.high?.value ?? null;
464
+ referenceRanges.lowCritical = range.low?.value ?? null;
465
+ }
466
+ } else if (rangeSystem === 'http://fhir.openmrs.org/ext/obs/reference-range' && rangeType === 'absolute') {
467
+ referenceRanges.hiAbsolute = range.high?.value ?? null;
468
+ referenceRanges.lowAbsolute = range.low?.value ?? null;
469
+ }
470
+ });
471
+
472
+ return {
370
473
  code: resource?.code?.coding?.[0]?.code,
371
- interpretation: assessValue(
372
- resource?.valueQuantity?.value,
373
- getReferenceRangesForConcept(resource?.code?.coding?.[0]?.code, conceptMetadata),
374
- ),
474
+ encounterId: extractEncounterUuid(resource.encounter),
475
+ interpretation: assessValue(resource?.valueQuantity?.value, referenceRanges),
375
476
  recordedDate: resource?.effectiveDateTime,
376
477
  value: resource?.valueQuantity?.value,
377
- encounterId: extractEncounterUuid(resource.encounter),
378
- });
478
+ };
379
479
  }
380
480
 
381
481
  export function createOrUpdateVitalsAndBiometrics(
@@ -1,8 +1,8 @@
1
1
  import { type OpenmrsResource } from '@openmrs/esm-framework';
2
2
  import { type ConceptMetadata } from '../common';
3
+ import type { ObsReferenceRanges, ObservationInterpretation } from './types';
3
4
  import { type VitalsBiometricsFormData } from '../vitals-biometrics-form/schema';
4
5
  import { type VitalsAndBiometricsFieldValuesMap } from './data.resource';
5
- import type { ObsReferenceRanges, ObservationInterpretation } from './types';
6
6
 
7
7
  export function calculateBodyMassIndex(weight: number, height: number) {
8
8
  if (weight > 0 && height > 0) {
@@ -1,18 +1,19 @@
1
1
  export {
2
+ createOrUpdateVitalsAndBiometrics,
2
3
  deleteEncounter,
3
4
  invalidateCachedVitalsAndBiometrics,
5
+ useConceptUnits,
6
+ useEncounterVitalsAndBiometrics,
4
7
  useVitalsAndBiometrics,
5
8
  useVitalsConceptMetadata,
6
- createOrUpdateVitalsAndBiometrics,
7
- useEncounterVitalsAndBiometrics,
8
9
  withUnit,
9
10
  type ConceptMetadata,
10
11
  } from './data.resource';
11
12
  export {
12
13
  assessValue,
13
14
  calculateBodyMassIndex,
14
- getReferenceRangesForConcept,
15
15
  generatePlaceholder,
16
+ getReferenceRangesForConcept,
16
17
  interpretBloodPressure,
17
18
  } from './helpers';
18
19
  export type { ObservationInterpretation, PatientVitalsAndBiometrics } from './types';
@@ -26,6 +26,64 @@ export type MappedVitals = {
26
26
  encounterId: string;
27
27
  };
28
28
 
29
+ export interface FHIRObservationResource {
30
+ resourceType: string;
31
+ id: string;
32
+ category: Array<{
33
+ coding: Array<{
34
+ system: string;
35
+ code: string;
36
+ display: string;
37
+ }>;
38
+ }>;
39
+ code: {
40
+ coding: Array<{
41
+ code: string;
42
+ display: string;
43
+ }>;
44
+ text: string;
45
+ };
46
+ encounter?: {
47
+ reference: string;
48
+ type: string;
49
+ };
50
+ effectiveDateTime: string;
51
+ issued: string;
52
+ valueString?: string;
53
+ valueQuantity?: {
54
+ value: number;
55
+ unit: string;
56
+ system: string;
57
+ code: string;
58
+ };
59
+ valueCodeableConcept?: {
60
+ coding: [
61
+ {
62
+ code: string;
63
+ display: string;
64
+ },
65
+ ];
66
+ text: string;
67
+ };
68
+ referenceRange: Array<{
69
+ low?: {
70
+ value: number;
71
+ };
72
+ high?: {
73
+ value: number;
74
+ };
75
+ type: {
76
+ coding: Array<{
77
+ system: string;
78
+ code: string;
79
+ }>;
80
+ };
81
+ }>;
82
+ hasMember?: Array<{
83
+ reference: string;
84
+ }>;
85
+ }
86
+
29
87
  export interface PatientVitalsAndBiometrics {
30
88
  id: string;
31
89
  date: string;
@@ -33,18 +91,22 @@ export interface PatientVitalsAndBiometrics {
33
91
  diastolic?: number;
34
92
  bloodPressureRenderInterpretation?: ObservationInterpretation;
35
93
  pulse?: number;
94
+ pulseRenderInterpretation?: ObservationInterpretation;
36
95
  temperature?: number;
96
+ temperatureRenderInterpretation?: ObservationInterpretation;
37
97
  spo2?: number;
98
+ spo2RenderInterpretation?: ObservationInterpretation;
38
99
  height?: number;
39
100
  weight?: number;
40
101
  bmi?: number | null;
41
102
  respiratoryRate?: number;
103
+ respiratoryRateRenderInterpretation?: ObservationInterpretation;
42
104
  muac?: number;
43
105
  }
44
106
 
45
107
  export interface VitalsResponse {
46
108
  entry: Array<{
47
- resource: FHIRResource['resource'];
109
+ resource: FHIRObservationResource;
48
110
  }>;
49
111
  id: string;
50
112
  meta: {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { InlineLoading } from '@carbon/react';
4
4
  import { useConfig } from '@openmrs/esm-framework';
5
- import { useVitalsAndBiometrics, useVitalsConceptMetadata } from '../../common';
5
+ import { useVitalsAndBiometrics, useConceptUnits } from '../../common';
6
6
  import { type ConfigObject } from '../../config-schema';
7
7
  import styles from './weight-tile.scss';
8
8
 
@@ -11,15 +11,16 @@ interface WeightTileInterface {
11
11
  }
12
12
 
13
13
  const WeightTile: React.FC<WeightTileInterface> = ({ patientUuid }) => {
14
- const { t } = useTranslation();
15
14
  const config = useConfig<ConfigObject>();
16
- const { data: conceptUnits } = useVitalsConceptMetadata();
15
+ const { t } = useTranslation();
16
+ const { conceptUnits } = useConceptUnits();
17
17
  const { data: biometrics, isLoading } = useVitalsAndBiometrics(patientUuid, 'biometrics');
18
18
  const weightData = biometrics?.filter((result) => result.weight);
19
19
 
20
20
  if (isLoading) {
21
21
  return <InlineLoading role="progressbar" description={`${t('loading', 'Loading')} ...`} />;
22
22
  }
23
+
23
24
  if (weightData?.length) {
24
25
  return (
25
26
  <div>
@@ -31,6 +32,7 @@ const WeightTile: React.FC<WeightTileInterface> = ({ patientUuid }) => {
31
32
  </div>
32
33
  );
33
34
  }
35
+
34
36
  return (
35
37
  <div>
36
38
  <p className={styles.label}>{t('weight', 'Weight')}</p>
@@ -3,7 +3,7 @@ import { screen } from '@testing-library/react';
3
3
  import { getDefaultsFromConfigSchema, useConfig } from '@openmrs/esm-framework';
4
4
  import { configSchema, type ConfigObject } from '../../config-schema';
5
5
  import { getByTextWithMarkup, mockPatient, renderWithSwr, waitForLoadingToFinish } from 'tools';
6
- import { formattedBiometrics, mockBiometricsConfig, mockConceptMetadata, mockVitalsSignsConcepts } from '__mocks__';
6
+ import { formattedBiometrics, mockBiometricsConfig, mockVitalsSignsConcepts } from '__mocks__';
7
7
  import { useVitalsAndBiometrics } from '../../common';
8
8
  import WeightTile from './weight-tile.component';
9
9
 
@@ -18,9 +18,10 @@ jest.mock('../../common', () => {
18
18
 
19
19
  return {
20
20
  ...originalModule,
21
- useVitalsConceptMetadata: jest.fn().mockImplementation(() => ({
22
- data: mockConceptUnits,
23
- conceptMetadata: mockConceptMetadata,
21
+ useConceptUnits: jest.fn().mockImplementation(() => ({
22
+ conceptUnits: mockConceptUnits,
23
+ error: null,
24
+ isLoading: false,
24
25
  })),
25
26
  useVitalsAndBiometrics: jest.fn(),
26
27
  };
@@ -34,7 +34,7 @@ const PaginatedVitals: React.FC<PaginatedVitalsProps> = ({
34
34
  }) => {
35
35
  const isTablet = useLayoutType() === 'tablet';
36
36
 
37
- const StyledTableCell = ({ interpretation, children }: { interpretation: string; children: React.ReactNode }) => {
37
+ const StyledTableCell = ({ children, interpretation }: { children: React.ReactNode; interpretation: string }) => {
38
38
  switch (interpretation) {
39
39
  case 'critically_high':
40
40
  return <TableCell className={styles.criticallyHigh}>{children}</TableCell>;