@openmrs/esm-patient-vitals-app 11.3.1-pre.9208 → 11.3.1-pre.9212
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 +5 -5
- package/dist/5810.js +1 -1
- package/dist/5810.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-vitals-app.js +1 -1
- package/dist/openmrs-esm-patient-vitals-app.js.buildmanifest.json +8 -8
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/common/data.resource.ts +15 -18
- package/src/common/helpers.ts +34 -9
- package/src/common/types.ts +13 -1
- package/src/vitals-and-biometrics-header/vitals-header.component.tsx +27 -16
- package/src/vitals-and-biometrics-header/vitals-header.test.tsx +95 -1
|
@@ -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,_={28746:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2276),t.e(9595),t.e(1343),t.e(8515),t.e(5810)]).then((()=>()=>t(55810)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},P={};function j(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,exports:{}};return _[e].call(t.exports,t,t.exports,j),t.exports}j.m=_,j.c=P,j.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return j.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,j.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);j.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,j.d(o,a),o},j.d=(e,r)=>{for(var t in r)j.o(r,t)&&!j.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},j.f={},j.e=e=>Promise.all(Object.keys(j.f).reduce(((r,t)=>(j.f[t](e,r),r)),[])),j.u=e=>e+".js",j.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),j.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-patient-vitals-app:",j.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,j.nc&&i.setAttribute("nonce",j.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),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 o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];j.o(j.S,t)||(j.S[t]={});var a=j.S[t],i="@openmrs/esm-patient-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","8.0.1-pre.3473",(()=>Promise.all([j.e(3174),j.e(2276),j.e(5670),j.e(5434),j.e(1343),j.e(5182),j.e(8515)]).then((()=>()=>j(55670))))),l("@openmrs/esm-patient-common-lib","11.3.1-pre.
|
|
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,_={28746:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2276),t.e(9595),t.e(1343),t.e(8515),t.e(5810)]).then((()=>()=>t(55810)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},P={};function j(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,exports:{}};return _[e].call(t.exports,t,t.exports,j),t.exports}j.m=_,j.c=P,j.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return j.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,j.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);j.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,j.d(o,a),o},j.d=(e,r)=>{for(var t in r)j.o(r,t)&&!j.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},j.f={},j.e=e=>Promise.all(Object.keys(j.f).reduce(((r,t)=>(j.f[t](e,r),r)),[])),j.u=e=>e+".js",j.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),j.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-patient-vitals-app:",j.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,j.nc&&i.setAttribute("nonce",j.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),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 o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];j.o(j.S,t)||(j.S[t]={});var a=j.S[t],i="@openmrs/esm-patient-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","8.0.1-pre.3473",(()=>Promise.all([j.e(3174),j.e(2276),j.e(5670),j.e(5434),j.e(1343),j.e(5182),j.e(8515)]).then((()=>()=>j(55670))))),l("@openmrs/esm-patient-common-lib","11.3.1-pre.9212",(()=>Promise.all([j.e(3174),j.e(2276),j.e(5434),j.e(1343),j.e(5182),j.e(8515),j.e(8803)]).then((()=>()=>j(18803))))),l("dayjs","1.11.13",(()=>j.e(3464).then((()=>()=>j(23464))))),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("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(9876),j.e(5434),j.e(1343)]).then((()=>()=>j(29876))))),l("swr/infinite","2.2.5",(()=>Promise.all([j.e(2470),j.e(5434),j.e(1343)]).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})(),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&&j.o(e,r),u=e=>(e.loaded=1,e.get()),p=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),f=(e,r,t)=>{var n=t?p(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&a(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",c=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,o,a){var i=j.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,j.S[r],t,!1,o,a)):e(r,j.S[r],t,n,o,a)})(((e,r,t,n,o,a)=>{if(!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={55434:()=>v("default","swr/_internal",!1,[1,2],(()=>j.e(2372).then((()=>()=>j(42372))))),1343:()=>v("default","react",!1,[1,18],(()=>j.e(4041).then((()=>()=>j(14041))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>j.e(2913).then((()=>()=>j(52913))))),24818:()=>v("default","rxjs",!1,[1,6],(()=>j.e(2457).then((()=>()=>j(82457))))),46372:()=>v("default","dayjs",!1,[1,1],(()=>j.e(3464).then((()=>()=>j(23464))))),54440:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([j.e(3174),j.e(5670),j.e(5434),j.e(5182)]).then((()=>()=>j(55670))))),72339:()=>v("default","react-i18next",!1,[1,16],(()=>j.e(6336).then((()=>()=>j(16336))))),88010:()=>v("default","swr/immutable",!1,[1,2],(()=>Promise.all([j.e(9876),j.e(5434)]).then((()=>()=>j(29876))))),98394:()=>v("default","swr/infinite",!1,[1,2],(()=>Promise.all([j.e(2470),j.e(5434)]).then((()=>()=>j(52470))))),36274:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,11],(()=>Promise.all([j.e(3174),j.e(5434),j.e(5182),j.e(8803)]).then((()=>()=>j(18803)))))},y={1343:[1343],5182:[8877,24818],5434:[55434],5810:[36274],8515:[46372,54440,72339,88010,98394]},w={},j.f.consumes=(e,r)=>{j.o(y,e)&&y[e].forEach((e=>{if(j.o(g,e))return r.push(g[e]);if(!w[e]){var t=r=>{g[e]=0,j.m[e]=t=>{delete j.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete g[e],j.m[e]=t=>{throw delete j.c[e],r}};try{var o=b[e]();o.then?r.push(g[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={6167: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|5182|5434|8515)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=j.p+j.u(r),i=new Error;j.l(a,(t=>{if(j.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,l]=t,s=0;if(a.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<a.length;s++)o=a[s],j.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))})(),j.nc=void 0;var S=j(28746);_openmrs_esm_patient_vitals_app=S})();
|
|
@@ -718,7 +718,7 @@
|
|
|
718
718
|
"auxiliaryFiles": [
|
|
719
719
|
"5415.js.map"
|
|
720
720
|
],
|
|
721
|
-
"hash": "
|
|
721
|
+
"hash": "dc164ed3c3faaac4",
|
|
722
722
|
"childrenByOrder": {}
|
|
723
723
|
},
|
|
724
724
|
{
|
|
@@ -818,9 +818,9 @@
|
|
|
818
818
|
"initial": false,
|
|
819
819
|
"entry": false,
|
|
820
820
|
"recorded": false,
|
|
821
|
-
"size":
|
|
821
|
+
"size": 422524,
|
|
822
822
|
"sizes": {
|
|
823
|
-
"javascript":
|
|
823
|
+
"javascript": 422482,
|
|
824
824
|
"consume-shared": 42
|
|
825
825
|
},
|
|
826
826
|
"names": [],
|
|
@@ -834,7 +834,7 @@
|
|
|
834
834
|
"auxiliaryFiles": [
|
|
835
835
|
"5810.js.map"
|
|
836
836
|
],
|
|
837
|
-
"hash": "
|
|
837
|
+
"hash": "53c2e172d7cc1359",
|
|
838
838
|
"childrenByOrder": {}
|
|
839
839
|
},
|
|
840
840
|
{
|
|
@@ -883,7 +883,7 @@
|
|
|
883
883
|
"auxiliaryFiles": [
|
|
884
884
|
"openmrs-esm-patient-vitals-app.js.map"
|
|
885
885
|
],
|
|
886
|
-
"hash": "
|
|
886
|
+
"hash": "3a4c51d8c822acb9",
|
|
887
887
|
"childrenByOrder": {}
|
|
888
888
|
},
|
|
889
889
|
{
|
|
@@ -1183,10 +1183,10 @@
|
|
|
1183
1183
|
"initial": true,
|
|
1184
1184
|
"entry": true,
|
|
1185
1185
|
"recorded": false,
|
|
1186
|
-
"size":
|
|
1186
|
+
"size": 4060628,
|
|
1187
1187
|
"sizes": {
|
|
1188
1188
|
"consume-shared": 294,
|
|
1189
|
-
"javascript":
|
|
1189
|
+
"javascript": 4037114,
|
|
1190
1190
|
"share-init": 420,
|
|
1191
1191
|
"runtime": 22800
|
|
1192
1192
|
},
|
|
@@ -1203,7 +1203,7 @@
|
|
|
1203
1203
|
"auxiliaryFiles": [
|
|
1204
1204
|
"main.js.map"
|
|
1205
1205
|
],
|
|
1206
|
-
"hash": "
|
|
1206
|
+
"hash": "8fe1f4bec5444cbd",
|
|
1207
1207
|
"childrenByOrder": {}
|
|
1208
1208
|
},
|
|
1209
1209
|
{
|
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":"11.3.1-pre.
|
|
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":"11.3.1-pre.9212"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-vitals-app",
|
|
3
|
-
"version": "11.3.1-pre.
|
|
3
|
+
"version": "11.3.1-pre.9212",
|
|
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": "11.3.1-pre.
|
|
56
|
+
"@openmrs/esm-patient-common-lib": "11.3.1-pre.9212"
|
|
57
57
|
},
|
|
58
58
|
"stableVersion": "11.3.0"
|
|
59
59
|
}
|
|
@@ -11,7 +11,12 @@ import {
|
|
|
11
11
|
import useSWRImmutable from 'swr/immutable';
|
|
12
12
|
import useSWRInfinite from 'swr/infinite';
|
|
13
13
|
import { type ConfigObject } from '../config-schema';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
assessValue,
|
|
16
|
+
calculateBodyMassIndex,
|
|
17
|
+
interpretBloodPressure,
|
|
18
|
+
mapFhirInterpretationToObservationInterpretation,
|
|
19
|
+
} from './helpers';
|
|
15
20
|
import type {
|
|
16
21
|
FHIRObservationResource,
|
|
17
22
|
FHIRSearchBundleResponse,
|
|
@@ -323,23 +328,13 @@ export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiome
|
|
|
323
328
|
vitalSigns.diastolic,
|
|
324
329
|
concepts,
|
|
325
330
|
conceptRanges,
|
|
331
|
+
vitalSigns.systolicRenderInterpretation,
|
|
332
|
+
vitalSigns.diastolicRenderInterpretation,
|
|
326
333
|
);
|
|
327
|
-
result.pulseRenderInterpretation =
|
|
328
|
-
|
|
329
|
-
|
|
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),
|
|
342
|
-
);
|
|
334
|
+
result.pulseRenderInterpretation = vitalSigns.pulseRenderInterpretation;
|
|
335
|
+
result.temperatureRenderInterpretation = vitalSigns.temperatureRenderInterpretation;
|
|
336
|
+
result.spo2RenderInterpretation = vitalSigns.spo2RenderInterpretation;
|
|
337
|
+
result.respiratoryRateRenderInterpretation = vitalSigns.respiratoryRateRenderInterpretation;
|
|
343
338
|
}
|
|
344
339
|
|
|
345
340
|
return result;
|
|
@@ -472,7 +467,9 @@ function mapVitalsAndBiometrics(resource: FHIRObservationResource): MappedVitals
|
|
|
472
467
|
return {
|
|
473
468
|
code: resource?.code?.coding?.[0]?.code,
|
|
474
469
|
encounterId: extractEncounterUuid(resource.encounter),
|
|
475
|
-
interpretation:
|
|
470
|
+
interpretation: resource.interpretation?.[0]?.coding?.[0]?.display
|
|
471
|
+
? mapFhirInterpretationToObservationInterpretation(resource.interpretation?.[0]?.coding?.[0]?.display)
|
|
472
|
+
: assessValue(resource?.valueQuantity?.value, referenceRanges),
|
|
476
473
|
recordedDate: resource?.effectiveDateTime,
|
|
477
474
|
value: resource?.valueQuantity?.value,
|
|
478
475
|
};
|
package/src/common/helpers.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type OpenmrsResource } from '@openmrs/esm-framework';
|
|
2
2
|
import { type ConceptMetadata } from '../common';
|
|
3
|
-
import type { ObsReferenceRanges, ObservationInterpretation } from './types';
|
|
3
|
+
import type { FHIRInterpretation, ObsReferenceRanges, ObservationInterpretation } from './types';
|
|
4
4
|
import { type VitalsBiometricsFormData } from '../vitals-biometrics-form/schema';
|
|
5
5
|
import { type VitalsAndBiometricsFieldValuesMap } from './data.resource';
|
|
6
6
|
|
|
@@ -33,24 +33,49 @@ export function assessValue(value: number | undefined, range?: ObsReferenceRange
|
|
|
33
33
|
return 'normal';
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export function mapFhirInterpretationToObservationInterpretation(
|
|
37
|
+
interpretation: FHIRInterpretation,
|
|
38
|
+
): ObservationInterpretation {
|
|
39
|
+
const normalized = interpretation?.trim();
|
|
40
|
+
switch (normalized) {
|
|
41
|
+
case 'Critically Low':
|
|
42
|
+
return 'critically_low';
|
|
43
|
+
case 'Critically High':
|
|
44
|
+
return 'critically_high';
|
|
45
|
+
case 'High':
|
|
46
|
+
return 'high';
|
|
47
|
+
case 'Low':
|
|
48
|
+
return 'low';
|
|
49
|
+
case 'Normal':
|
|
50
|
+
return 'normal';
|
|
51
|
+
default:
|
|
52
|
+
return 'normal';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
36
56
|
export function interpretBloodPressure(
|
|
37
57
|
systolic: number | undefined,
|
|
38
58
|
diastolic: number | undefined,
|
|
39
59
|
concepts: { systolicBloodPressureUuid?: string; diastolicBloodPressureUuid?: string } | undefined,
|
|
40
60
|
conceptMetadata: Array<ConceptMetadata> | undefined,
|
|
61
|
+
systolicInterpretation?: ObservationInterpretation,
|
|
62
|
+
diastolicInterpretation?: ObservationInterpretation,
|
|
41
63
|
): ObservationInterpretation {
|
|
42
64
|
if (!conceptMetadata) {
|
|
43
65
|
return 'normal';
|
|
44
66
|
}
|
|
45
67
|
|
|
46
|
-
const systolicAssessment =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
68
|
+
const systolicAssessment =
|
|
69
|
+
systolicInterpretation ??
|
|
70
|
+
(concepts?.systolicBloodPressureUuid
|
|
71
|
+
? assessValue(systolic, getReferenceRangesForConcept(concepts.systolicBloodPressureUuid, conceptMetadata))
|
|
72
|
+
: 'normal');
|
|
73
|
+
|
|
74
|
+
const diastolicAssessment =
|
|
75
|
+
diastolicInterpretation ??
|
|
76
|
+
(concepts?.diastolicBloodPressureUuid
|
|
77
|
+
? assessValue(diastolic, getReferenceRangesForConcept(concepts.diastolicBloodPressureUuid, conceptMetadata))
|
|
78
|
+
: 'normal');
|
|
54
79
|
|
|
55
80
|
if (systolicAssessment === 'critically_high' || diastolicAssessment === 'critically_high') {
|
|
56
81
|
return 'critically_high';
|
package/src/common/types.ts
CHANGED
|
@@ -20,12 +20,14 @@ export type ObservationInterpretation = 'critically_low' | 'critically_high' | '
|
|
|
20
20
|
|
|
21
21
|
export type MappedVitals = {
|
|
22
22
|
code: string;
|
|
23
|
-
interpretation:
|
|
23
|
+
interpretation: ObservationInterpretation;
|
|
24
24
|
recordedDate: string | Date;
|
|
25
25
|
value: number;
|
|
26
26
|
encounterId: string;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
export type FHIRInterpretation = 'Critically Low' | 'Critically High' | 'High' | 'Low' | 'Normal';
|
|
30
|
+
|
|
29
31
|
export interface FHIRObservationResource {
|
|
30
32
|
resourceType: string;
|
|
31
33
|
id: string;
|
|
@@ -82,13 +84,23 @@ export interface FHIRObservationResource {
|
|
|
82
84
|
hasMember?: Array<{
|
|
83
85
|
reference: string;
|
|
84
86
|
}>;
|
|
87
|
+
interpretation?: Array<{
|
|
88
|
+
coding: Array<{
|
|
89
|
+
code: string;
|
|
90
|
+
display: FHIRInterpretation;
|
|
91
|
+
system: string;
|
|
92
|
+
}>;
|
|
93
|
+
text: string;
|
|
94
|
+
}>;
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
export interface PatientVitalsAndBiometrics {
|
|
88
98
|
id: string;
|
|
89
99
|
date: string;
|
|
90
100
|
systolic?: number;
|
|
101
|
+
systolicRenderInterpretation?: ObservationInterpretation;
|
|
91
102
|
diastolic?: number;
|
|
103
|
+
diastolicRenderInterpretation?: ObservationInterpretation;
|
|
92
104
|
bloodPressureRenderInterpretation?: ObservationInterpretation;
|
|
93
105
|
pulse?: number;
|
|
94
106
|
pulseRenderInterpretation?: ObservationInterpretation;
|
|
@@ -161,25 +161,30 @@ const VitalsHeader: React.FC<VitalsHeaderProps> = ({ patientUuid, hideLinks = fa
|
|
|
161
161
|
latestVitals?.diastolic,
|
|
162
162
|
config?.concepts,
|
|
163
163
|
conceptRanges,
|
|
164
|
+
latestVitals?.systolicRenderInterpretation,
|
|
165
|
+
latestVitals?.diastolicRenderInterpretation,
|
|
164
166
|
)}
|
|
165
167
|
unitName={t('bp', 'BP')}
|
|
166
168
|
unitSymbol={(latestVitals?.systolic && conceptUnits.get(config.concepts.systolicBloodPressureUuid)) ?? ''}
|
|
167
169
|
value={`${latestVitals?.systolic ?? '--'} / ${latestVitals?.diastolic ?? '--'}`}
|
|
168
170
|
/>
|
|
169
171
|
<VitalsHeaderItem
|
|
170
|
-
interpretation={
|
|
171
|
-
latestVitals?.
|
|
172
|
-
getReferenceRangesForConcept(config.concepts.pulseUuid, conceptRanges)
|
|
173
|
-
|
|
172
|
+
interpretation={
|
|
173
|
+
latestVitals?.pulseRenderInterpretation ??
|
|
174
|
+
assessValue(latestVitals?.pulse, getReferenceRangesForConcept(config.concepts.pulseUuid, conceptRanges))
|
|
175
|
+
}
|
|
174
176
|
unitName={t('heartRate', 'Heart rate')}
|
|
175
177
|
unitSymbol={(latestVitals?.pulse && conceptUnits.get(config.concepts.pulseUuid)) ?? ''}
|
|
176
178
|
value={latestVitals?.pulse ?? '--'}
|
|
177
179
|
/>
|
|
178
180
|
<VitalsHeaderItem
|
|
179
|
-
interpretation={
|
|
180
|
-
latestVitals?.
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
interpretation={
|
|
182
|
+
latestVitals?.respiratoryRateRenderInterpretation ??
|
|
183
|
+
assessValue(
|
|
184
|
+
latestVitals?.respiratoryRate,
|
|
185
|
+
getReferenceRangesForConcept(config.concepts.respiratoryRateUuid, conceptRanges),
|
|
186
|
+
)
|
|
187
|
+
}
|
|
183
188
|
unitName={t('respiratoryRate', 'R. rate')}
|
|
184
189
|
unitSymbol={
|
|
185
190
|
(latestVitals?.respiratoryRate && conceptUnits.get(config.concepts.respiratoryRateUuid)) ?? ''
|
|
@@ -187,19 +192,25 @@ const VitalsHeader: React.FC<VitalsHeaderProps> = ({ patientUuid, hideLinks = fa
|
|
|
187
192
|
value={latestVitals?.respiratoryRate ?? '--'}
|
|
188
193
|
/>
|
|
189
194
|
<VitalsHeaderItem
|
|
190
|
-
interpretation={
|
|
191
|
-
latestVitals?.
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
interpretation={
|
|
196
|
+
latestVitals?.spo2RenderInterpretation ??
|
|
197
|
+
assessValue(
|
|
198
|
+
latestVitals?.spo2,
|
|
199
|
+
getReferenceRangesForConcept(config.concepts.oxygenSaturationUuid, conceptRanges),
|
|
200
|
+
)
|
|
201
|
+
}
|
|
194
202
|
unitName={t('spo2', 'SpO2')}
|
|
195
203
|
unitSymbol={(latestVitals?.spo2 && conceptUnits.get(config.concepts.oxygenSaturationUuid)) ?? ''}
|
|
196
204
|
value={latestVitals?.spo2 ?? '--'}
|
|
197
205
|
/>
|
|
198
206
|
<VitalsHeaderItem
|
|
199
|
-
interpretation={
|
|
200
|
-
latestVitals?.
|
|
201
|
-
|
|
202
|
-
|
|
207
|
+
interpretation={
|
|
208
|
+
latestVitals?.temperatureRenderInterpretation ??
|
|
209
|
+
assessValue(
|
|
210
|
+
latestVitals?.temperature,
|
|
211
|
+
getReferenceRangesForConcept(config.concepts.temperatureUuid, conceptRanges),
|
|
212
|
+
)
|
|
213
|
+
}
|
|
203
214
|
unitName={t('temperatureAbbreviated', 'Temp')}
|
|
204
215
|
unitSymbol={(latestVitals?.temperature && conceptUnits.get(config.concepts.temperatureUuid)) ?? ''}
|
|
205
216
|
value={latestVitals?.temperature ?? '--'}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
mockVitalsConfig,
|
|
13
13
|
} from '__mocks__';
|
|
14
14
|
import { configSchema, type ConfigObject } from '../config-schema';
|
|
15
|
-
import { useVitalsAndBiometrics } from '../common';
|
|
15
|
+
import { type PatientVitalsAndBiometrics, useVitalsAndBiometrics } from '../common';
|
|
16
16
|
import VitalsHeader from './vitals-header.component';
|
|
17
17
|
|
|
18
18
|
const testProps = {
|
|
@@ -260,4 +260,98 @@ describe('VitalsHeader', () => {
|
|
|
260
260
|
expect(screen.queryByRole('link', { name: /vitals history/i })).not.toBeInTheDocument();
|
|
261
261
|
expect(screen.queryByRole('button', { name: /record vitals/i })).not.toBeInTheDocument();
|
|
262
262
|
});
|
|
263
|
+
|
|
264
|
+
it('uses backend interpretation without recalculating', async () => {
|
|
265
|
+
// Pulse 240 would normally be calculated as "critically_high" (>= 230)
|
|
266
|
+
// Temperature 41 would normally be calculated as "high" (> 37.5 but < 43)
|
|
267
|
+
// SpO2 70 would normally be calculated as "critically_low" (< 95)
|
|
268
|
+
// Respiratory Rate 5 would normally be calculated as "critically_low" (< 12)
|
|
269
|
+
// Backend sends the interpretation for all vitals as "normal", except for Respiratory Rate which is "critically_low" (< 12)
|
|
270
|
+
// It should use backend's interpretation and NOT recalculate
|
|
271
|
+
const vitalsWithConflictingInterpretation: PatientVitalsAndBiometrics[] = [
|
|
272
|
+
{
|
|
273
|
+
id: '0',
|
|
274
|
+
date: '2021-05-19T04:26:51.000Z',
|
|
275
|
+
pulse: 240,
|
|
276
|
+
temperature: 41,
|
|
277
|
+
respiratoryRate: 5,
|
|
278
|
+
diastolic: 145,
|
|
279
|
+
systolic: 240,
|
|
280
|
+
spo2: 70,
|
|
281
|
+
diastolicRenderInterpretation: 'normal',
|
|
282
|
+
systolicRenderInterpretation: 'normal',
|
|
283
|
+
bloodPressureRenderInterpretation: 'normal',
|
|
284
|
+
pulseRenderInterpretation: 'normal',
|
|
285
|
+
temperatureRenderInterpretation: 'normal',
|
|
286
|
+
respiratoryRateRenderInterpretation: 'critically_low',
|
|
287
|
+
spo2RenderInterpretation: 'normal',
|
|
288
|
+
},
|
|
289
|
+
];
|
|
290
|
+
|
|
291
|
+
mockUseVitalsAndBiometrics.mockReturnValue({
|
|
292
|
+
data: vitalsWithConflictingInterpretation,
|
|
293
|
+
} as ReturnType<typeof useVitalsAndBiometrics>);
|
|
294
|
+
|
|
295
|
+
renderWithSwr(<VitalsHeader {...testProps} />);
|
|
296
|
+
|
|
297
|
+
await waitForLoadingToFinish();
|
|
298
|
+
|
|
299
|
+
expect(getByTextWithMarkup(/BP\s*240 \/ 145\s*mmHg/i)).toBeInTheDocument();
|
|
300
|
+
expect(getByTextWithMarkup(/Heart rate\s*240\s*beats\/min/i)).toBeInTheDocument();
|
|
301
|
+
expect(getByTextWithMarkup(/Temp\s*41\s*DEG C/i)).toBeInTheDocument();
|
|
302
|
+
expect(getByTextWithMarkup(/R\. Rate\s*5\s*breaths\/min/i)).toBeInTheDocument();
|
|
303
|
+
expect(getByTextWithMarkup(/SpO2\s*70\s*/i)).toBeInTheDocument();
|
|
304
|
+
|
|
305
|
+
expect(screen.getAllByTitle(/abnormal value/i)).toHaveLength(1);
|
|
306
|
+
expect(screen.getByTitle(/abnormal value/i)).toHaveClass('critically-low');
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
it('recalculates interpretation when backend does not provide interpretation', async () => {
|
|
310
|
+
// All vitals are abnormal, and backend does not provide interpretation for any of them.
|
|
311
|
+
// It should fallback to recalculating and mark them as abnormal.
|
|
312
|
+
const vitalsWithoutInterpretation: PatientVitalsAndBiometrics[] = [
|
|
313
|
+
{
|
|
314
|
+
id: '0',
|
|
315
|
+
date: '2021-05-19T04:26:51.000Z',
|
|
316
|
+
pulse: 240, // should be marked as "critically_high"
|
|
317
|
+
temperature: 41, // should be marked as "high"
|
|
318
|
+
respiratoryRate: 5, // should be marked as "low"
|
|
319
|
+
diastolic: 145,
|
|
320
|
+
systolic: 240, // blood pressure should be marked as "high"
|
|
321
|
+
spo2: 70, // should be marked as "low"
|
|
322
|
+
},
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
mockUseVitalsAndBiometrics.mockReturnValue({
|
|
326
|
+
data: vitalsWithoutInterpretation,
|
|
327
|
+
} as ReturnType<typeof useVitalsAndBiometrics>);
|
|
328
|
+
|
|
329
|
+
renderWithSwr(<VitalsHeader {...testProps} />);
|
|
330
|
+
|
|
331
|
+
await waitForLoadingToFinish();
|
|
332
|
+
|
|
333
|
+
expect(getByTextWithMarkup(/BP\s*240 \/ 145\s*mmHg/i)).toBeInTheDocument();
|
|
334
|
+
expect(getByTextWithMarkup(/Heart rate\s*240\s*beats\/min/i)).toBeInTheDocument();
|
|
335
|
+
expect(getByTextWithMarkup(/Temp\s*41\s*DEG C/i)).toBeInTheDocument();
|
|
336
|
+
expect(getByTextWithMarkup(/R\. Rate\s*5\s*breaths\/min/i)).toBeInTheDocument();
|
|
337
|
+
expect(getByTextWithMarkup(/SpO2\s*70\s*/i)).toBeInTheDocument();
|
|
338
|
+
|
|
339
|
+
const abnormalValueElements = screen.getAllByTitle(/abnormal value/i);
|
|
340
|
+
expect(abnormalValueElements).toHaveLength(5);
|
|
341
|
+
|
|
342
|
+
const lowElements = abnormalValueElements.filter((element) => {
|
|
343
|
+
return element.className === 'low';
|
|
344
|
+
});
|
|
345
|
+
expect(lowElements).toHaveLength(2);
|
|
346
|
+
|
|
347
|
+
const highElements = abnormalValueElements.filter((element) => {
|
|
348
|
+
return element.className === 'high';
|
|
349
|
+
});
|
|
350
|
+
expect(highElements).toHaveLength(2);
|
|
351
|
+
|
|
352
|
+
const criticallyHighElements = abnormalValueElements.filter((element) => {
|
|
353
|
+
return element.className === 'critically-high';
|
|
354
|
+
});
|
|
355
|
+
expect(criticallyHighElements).toHaveLength(1);
|
|
356
|
+
});
|
|
263
357
|
});
|