@openmrs/esm-patient-vitals-app 9.2.3-pre.7249 → 9.2.3-pre.7256
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 +2 -2
- package/dist/1423.js +1 -1
- package/dist/1423.js.map +1 -1
- package/dist/5387.js +1 -1
- package/dist/5387.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 +10 -10
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/biometrics/biometrics-base.component.tsx +4 -9
- package/src/utils.ts +21 -28
- package/src/vitals/vitals-overview.component.tsx +4 -8
- package/src/vitals-and-biometrics-header/vitals-header.component.tsx +4 -3
- package/src/vitals-and-biometrics-header/vitals-header.test.tsx +7 -10
- package/src/vitals-biometrics-form/vitals-biometrics-form.workspace.tsx +2 -0
|
@@ -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(175),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.
|
|
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(175),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.2848",(()=>Promise.all([S.e(831),S.e(1343)]).then((()=>()=>S(831))))),l("@openmrs/esm-patient-common-lib","9.2.3-pre.7249",(()=>Promise.all([S.e(5395),S.e(101),S.e(1343),S.e(5434),S.e(175),S.e(8877)]).then((()=>()=>S(101))))),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))))),3150:()=>v("default","react-i18next",!1,[1,11],(()=>S.e(4641).then((()=>()=>S(4641))))),4936:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,9],(()=>Promise.all([S.e(101),S.e(5434),S.e(8877)]).then((()=>()=>S(101))))),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))))),8877:()=>v("default","react-router-dom",!1,[1,6],(()=>S.e(2913).then((()=>()=>S(2913))))),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={175:[3150,4936,8010,8254],1343:[1343],5387:[6372,8394],5434:[5434],8877:[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(/^(1343|175|5434|8877)$/.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})();
|
|
@@ -189,9 +189,9 @@
|
|
|
189
189
|
"initial": false,
|
|
190
190
|
"entry": false,
|
|
191
191
|
"recorded": false,
|
|
192
|
-
"size":
|
|
192
|
+
"size": 138195,
|
|
193
193
|
"sizes": {
|
|
194
|
-
"javascript":
|
|
194
|
+
"javascript": 138195
|
|
195
195
|
},
|
|
196
196
|
"names": [],
|
|
197
197
|
"idHints": [],
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"auxiliaryFiles": [
|
|
206
206
|
"1423.js.map"
|
|
207
207
|
],
|
|
208
|
-
"hash": "
|
|
208
|
+
"hash": "048ac8afa4b91a87",
|
|
209
209
|
"childrenByOrder": {}
|
|
210
210
|
},
|
|
211
211
|
{
|
|
@@ -706,9 +706,9 @@
|
|
|
706
706
|
"initial": false,
|
|
707
707
|
"entry": false,
|
|
708
708
|
"recorded": false,
|
|
709
|
-
"size":
|
|
709
|
+
"size": 409864,
|
|
710
710
|
"sizes": {
|
|
711
|
-
"javascript":
|
|
711
|
+
"javascript": 409780,
|
|
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": "
|
|
725
|
+
"hash": "b62b7a9e48f2a81c",
|
|
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": "
|
|
844
|
+
"hash": "db28351bc483c84a",
|
|
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":
|
|
1032
|
+
"size": 3575613,
|
|
1033
1033
|
"sizes": {
|
|
1034
1034
|
"consume-shared": 294,
|
|
1035
|
-
"javascript":
|
|
1035
|
+
"javascript": 3552761,
|
|
1036
1036
|
"share-init": 378,
|
|
1037
1037
|
"runtime": 22180
|
|
1038
1038
|
},
|
|
@@ -1049,7 +1049,7 @@
|
|
|
1049
1049
|
"auxiliaryFiles": [
|
|
1050
1050
|
"main.js.map"
|
|
1051
1051
|
],
|
|
1052
|
-
"hash": "
|
|
1052
|
+
"hash": "c5932cf22e3cb642",
|
|
1053
1053
|
"childrenByOrder": {}
|
|
1054
1054
|
},
|
|
1055
1055
|
{
|
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":false},"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.
|
|
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":false},"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.7256"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button, ContentSwitcher, DataTableSkeleton, IconSwitch, InlineLoading } from '@carbon/react';
|
|
4
4
|
import { Add, Analytics, Table } from '@carbon/react/icons';
|
|
5
5
|
import { formatDatetime, parseDate, useConfig, useLayoutType } from '@openmrs/esm-framework';
|
|
6
|
-
import { CardHeader, EmptyState, ErrorState
|
|
7
|
-
import {
|
|
6
|
+
import { CardHeader, EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
|
|
7
|
+
import { useLaunchVitalsAndBiometricsForm } from '../utils';
|
|
8
8
|
import { useVitalsConceptMetadata, useVitalsAndBiometrics, withUnit } from '../common';
|
|
9
9
|
import { type ConfigObject } from '../config-schema';
|
|
10
10
|
import type { BiometricsTableHeader, BiometricsTableRow } from './types';
|
|
@@ -30,12 +30,7 @@ const BiometricsBase: React.FC<BiometricsBaseProps> = ({ patientUuid, pageSize,
|
|
|
30
30
|
const { bmiUnit } = config.biometrics;
|
|
31
31
|
const { data: biometrics, isLoading, error, isValidating } = useVitalsAndBiometrics(patientUuid, 'biometrics');
|
|
32
32
|
const { data: conceptUnits } = useVitalsConceptMetadata();
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const launchBiometricsForm = useCallback(
|
|
36
|
-
() => launchVitalsAndBiometricsForm(currentVisit, config),
|
|
37
|
-
[config, currentVisit],
|
|
38
|
-
);
|
|
33
|
+
const launchBiometricsForm = useLaunchVitalsAndBiometricsForm();
|
|
39
34
|
|
|
40
35
|
const tableHeaders: Array<BiometricsTableHeader> = [
|
|
41
36
|
{
|
package/src/utils.ts
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
3
|
+
import { useLaunchWorkspaceRequiringVisit } from '@openmrs/esm-patient-common-lib';
|
|
3
4
|
import { type ConfigObject } from './config-schema';
|
|
4
5
|
import { patientVitalsBiometricsFormWorkspace } from './constants';
|
|
5
6
|
import { invalidateCachedVitalsAndBiometrics } from './common';
|
|
6
7
|
|
|
7
|
-
/**
|
|
8
|
-
* Launches the for entry workspace with the custom form
|
|
9
|
-
*
|
|
10
|
-
* @param formUuid The form to use
|
|
11
|
-
* @param encounterUuid The current encounter, if any
|
|
12
|
-
* @param formName The name of the form to use
|
|
13
|
-
*/
|
|
14
|
-
export function launchFormEntry(formUuid: string, encounterUuid?: string, formName?: string) {
|
|
15
|
-
launchPatientWorkspace('patient-form-entry-workspace', {
|
|
16
|
-
workspaceTitle: formName,
|
|
17
|
-
formInfo: { formUuid, encounterUuid },
|
|
18
|
-
mutateForm: invalidateCachedVitalsAndBiometrics,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
8
|
/**
|
|
23
9
|
* Launches the appropriate workspace based on the current visit and configuration.
|
|
24
10
|
* @param currentVisit - The current visit.
|
|
25
11
|
* @param config - The configuration object.
|
|
26
12
|
*/
|
|
27
|
-
export function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
export function useLaunchVitalsAndBiometricsForm() {
|
|
14
|
+
const config = useConfig<ConfigObject>();
|
|
15
|
+
const { useFormEngine, formName, formUuid } = config.vitals;
|
|
16
|
+
const launchVitalsAndBiometricsForm = useLaunchWorkspaceRequiringVisit(
|
|
17
|
+
useFormEngine ? 'patient-form-entry-workspace' : patientVitalsBiometricsFormWorkspace,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const launchVitalsAndBiometricsFormNoParams = useCallback(() => {
|
|
21
|
+
const workspaceProps = useFormEngine
|
|
22
|
+
? {
|
|
23
|
+
workspaceTitle: formName,
|
|
24
|
+
formInfo: { formUuid, encounterUuid: '' },
|
|
25
|
+
mutateForm: invalidateCachedVitalsAndBiometrics,
|
|
26
|
+
}
|
|
27
|
+
: {};
|
|
28
|
+
launchVitalsAndBiometricsForm(workspaceProps);
|
|
29
|
+
}, [useFormEngine, formName, formUuid, launchVitalsAndBiometricsForm]);
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
const { formUuid, formName } = config.vitals;
|
|
35
|
-
launchFormEntry(formUuid, '', formName);
|
|
36
|
-
} else {
|
|
37
|
-
launchPatientWorkspace(patientVitalsBiometricsFormWorkspace);
|
|
38
|
-
}
|
|
31
|
+
return launchVitalsAndBiometricsFormNoParams;
|
|
39
32
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { type ChangeEvent,
|
|
1
|
+
import React, { type ChangeEvent, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { useReactToPrint } from 'react-to-print';
|
|
4
4
|
import { Button, ContentSwitcher, DataTableSkeleton, IconSwitch, InlineLoading } from '@carbon/react';
|
|
5
5
|
import { Analytics, Table } from '@carbon/react/icons';
|
|
6
|
-
import { CardHeader, EmptyState, ErrorState
|
|
6
|
+
import { CardHeader, EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
|
|
7
7
|
import {
|
|
8
8
|
AddIcon,
|
|
9
9
|
PrinterIcon,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
useLayoutType,
|
|
16
16
|
} from '@openmrs/esm-framework';
|
|
17
17
|
import type { ConfigObject } from '../config-schema';
|
|
18
|
-
import {
|
|
18
|
+
import { useLaunchVitalsAndBiometricsForm } from '../utils';
|
|
19
19
|
import { useVitalsAndBiometrics, useVitalsConceptMetadata, withUnit } from '../common';
|
|
20
20
|
import type { VitalsTableHeader, VitalsTableRow } from './types';
|
|
21
21
|
import PaginatedVitals from './paginated-vitals.component';
|
|
@@ -37,20 +37,16 @@ const VitalsOverview: React.FC<VitalsOverviewProps> = ({ patientUuid, patient, p
|
|
|
37
37
|
const config = useConfig<ConfigObject>();
|
|
38
38
|
const headerTitle = t('vitals', 'Vitals');
|
|
39
39
|
const [chartView, setChartView] = useState(false);
|
|
40
|
-
const { currentVisit } = useVisitOrOfflineVisit(patientUuid);
|
|
41
40
|
const isTablet = useLayoutType() === 'tablet';
|
|
42
41
|
const [isPrinting, setIsPrinting] = useState(false);
|
|
43
42
|
const contentToPrintRef = useRef(null);
|
|
43
|
+
const launchVitalsBiometricsForm = useLaunchVitalsAndBiometricsForm();
|
|
44
44
|
|
|
45
45
|
const { excludePatientIdentifierCodeTypes } = useConfig();
|
|
46
46
|
const { data: vitals, error, isLoading, isValidating } = useVitalsAndBiometrics(patientUuid);
|
|
47
47
|
const { data: conceptUnits } = useVitalsConceptMetadata();
|
|
48
48
|
const showPrintButton = config.vitals.showPrintButton && !chartView;
|
|
49
49
|
|
|
50
|
-
const launchVitalsBiometricsForm = useCallback(() => {
|
|
51
|
-
launchVitalsAndBiometricsForm(currentVisit, config);
|
|
52
|
-
}, [config, currentVisit]);
|
|
53
|
-
|
|
54
50
|
useEncounterVitalsAndBiometrics('771bbc44-8d45-4ac3-af6e-059814dd7cde');
|
|
55
51
|
const patientDetails = useMemo(() => {
|
|
56
52
|
const getGender = (gender: string): string => {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useVitalsConceptMetadata,
|
|
19
19
|
} from '../common';
|
|
20
20
|
import { type ConfigObject } from '../config-schema';
|
|
21
|
-
import {
|
|
21
|
+
import { useLaunchVitalsAndBiometricsForm } from '../utils';
|
|
22
22
|
import VitalsHeaderItem from './vitals-header-item.component';
|
|
23
23
|
import styles from './vitals-header.scss';
|
|
24
24
|
|
|
@@ -43,13 +43,14 @@ const VitalsHeader: React.FC<VitalsHeaderProps> = ({ patientUuid, hideLinks = fa
|
|
|
43
43
|
const { workspaces } = useWorkspaces();
|
|
44
44
|
|
|
45
45
|
const isWorkspaceOpen = useCallback(() => Boolean(workspaces?.length), [workspaces]);
|
|
46
|
+
const launchForm = useLaunchVitalsAndBiometricsForm();
|
|
46
47
|
|
|
47
48
|
const launchVitalsAndBiometricsForm = useCallback(
|
|
48
49
|
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
49
50
|
event.stopPropagation();
|
|
50
|
-
launchForm(
|
|
51
|
+
launchForm();
|
|
51
52
|
},
|
|
52
|
-
[
|
|
53
|
+
[launchForm],
|
|
53
54
|
);
|
|
54
55
|
|
|
55
56
|
if (isLoading) {
|
|
@@ -22,6 +22,10 @@ const mockUseVitalsAndBiometrics = jest.mocked(useVitalsAndBiometrics);
|
|
|
22
22
|
const mockUseWorkspaces = jest.mocked(useWorkspaces);
|
|
23
23
|
|
|
24
24
|
mockUseWorkspaces.mockReturnValue({ workspaces: [] } as WorkspacesInfo);
|
|
25
|
+
const mockLaunchWorkspaceRequiringVisit = jest.fn();
|
|
26
|
+
const mockUseLaunchWorkspaceRequiringVisit = jest.fn().mockImplementation((name) => {
|
|
27
|
+
return () => mockLaunchWorkspaceRequiringVisit(name);
|
|
28
|
+
});
|
|
25
29
|
|
|
26
30
|
jest.mock('@openmrs/esm-patient-common-lib', () => {
|
|
27
31
|
const originalModule = jest.requireActual('@openmrs/esm-patient-common-lib');
|
|
@@ -30,6 +34,7 @@ jest.mock('@openmrs/esm-patient-common-lib', () => {
|
|
|
30
34
|
...originalModule,
|
|
31
35
|
launchPatientWorkspace: jest.fn(),
|
|
32
36
|
useVisitOrOfflineVisit: jest.fn().mockImplementation(() => ({ currentVisit: mockCurrentVisit })),
|
|
37
|
+
useLaunchWorkspaceRequiringVisit: jest.fn().mockImplementation(() => mockUseLaunchWorkspaceRequiringVisit),
|
|
33
38
|
};
|
|
34
39
|
});
|
|
35
40
|
|
|
@@ -104,8 +109,7 @@ describe('VitalsHeader', () => {
|
|
|
104
109
|
|
|
105
110
|
await user.click(recordVitalsButton);
|
|
106
111
|
|
|
107
|
-
expect(
|
|
108
|
-
expect(mockLaunchPatientWorkspace).toHaveBeenCalledWith(patientVitalsBiometricsFormWorkspace);
|
|
112
|
+
expect(mockUseLaunchWorkspaceRequiringVisit).toHaveBeenCalledTimes(1);
|
|
109
113
|
});
|
|
110
114
|
|
|
111
115
|
it('displays correct overdue tag for vitals 5 days old', async () => {
|
|
@@ -183,14 +187,7 @@ describe('VitalsHeader', () => {
|
|
|
183
187
|
|
|
184
188
|
await user.click(recordVitalsButton);
|
|
185
189
|
|
|
186
|
-
expect(
|
|
187
|
-
formInfo: {
|
|
188
|
-
encounterUuid: '',
|
|
189
|
-
formUuid: '9f26aad4-244a-46ca-be49-1196df1a8c9a',
|
|
190
|
-
},
|
|
191
|
-
workspaceTitle: 'Triage',
|
|
192
|
-
mutateForm: invalidateCachedVitalsAndBiometrics,
|
|
193
|
-
});
|
|
190
|
+
expect(mockUseLaunchWorkspaceRequiringVisit).toHaveBeenCalledTimes(1);
|
|
194
191
|
});
|
|
195
192
|
|
|
196
193
|
it('should show links in vitals header by default', async () => {
|
|
@@ -274,6 +274,7 @@ const VitalsAndBiometricsForm: React.FC<VitalsAndBiometricsFormProps> = ({
|
|
|
274
274
|
if (isLoadingConceptMetadata || isLoadingInitialValues) {
|
|
275
275
|
return (
|
|
276
276
|
<Form className={styles.form}>
|
|
277
|
+
<ExtensionSlot name="visit-context-header-slot" state={{ patientUuid }} />
|
|
277
278
|
<div className={styles.grid}>
|
|
278
279
|
<Stack>
|
|
279
280
|
<Column>
|
|
@@ -305,6 +306,7 @@ const VitalsAndBiometricsForm: React.FC<VitalsAndBiometricsFormProps> = ({
|
|
|
305
306
|
|
|
306
307
|
return (
|
|
307
308
|
<Form className={styles.form} data-openmrs-role="Vitals and Biometrics Form">
|
|
309
|
+
<ExtensionSlot name="visit-context-header-slot" state={{ patientUuid }} />
|
|
308
310
|
<div className={styles.grid}>
|
|
309
311
|
<Stack>
|
|
310
312
|
<Column>
|