@ampath/esm-dha-workflow-app 4.0.0-next.132 → 4.0.0-next.133
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/dist/5851.js +1 -1
- package/dist/5851.js.map +1 -1
- package/dist/esm-dha-workflow-app.js.buildmanifest.json +3 -3
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/dashboard/charts/chart.component.tsx +6 -4
- package/src/dashboard/overview/overview.component.scss +3 -0
- package/src/dashboard/overview/overview.component.tsx +21 -2
- package/src/resources/superset.resource.ts +2 -1
package/dist/5851.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_ampath_esm_dha_workflow_app=globalThis.webpackChunk_ampath_esm_dha_workflow_app||[]).push([[5851],{46386:(e,n,t)=>{t.d(n,{A:()=>i});var o=t(72996),r=t.n(o),a=t(70159),c=t.n(a)()(r());c.push([e.id,".-esm-dha-workflow__dashboard-component__container___v92cd{margin:3rem}.-esm-dha-workflow__dashboard-component__tabText___QMBHG{font-size:20px}","",{version:3,sources:["webpack://./src/dashboard/dashboard.component.scss"],names:[],mappings:"AAAA,2DACI,WAAA,CAEJ,yDACI,cAAA",sourcesContent:[".container {\n margin: 3rem;\n}\n.tabText {\n font-size: 20px;\n}\n\n"],sourceRoot:""}]),c.locals={container:"-esm-dha-workflow__dashboard-component__container___v92cd",tabText:"-esm-dha-workflow__dashboard-component__tabText___QMBHG"};const i=c},78542:(e,n,t)=>{t.d(n,{A:()=>i});var o=t(72996),r=t.n(o),a=t(70159),c=t.n(a)()(r());c.push([e.id,".-esm-dha-workflow__chart-component__container___4Ymrz{display:flex;flex-wrap:wrap;gap:1rem;justify-content:space-between;width:85vw;min-height:60vh}.-esm-dha-workflow__chart-component__container___4Ymrz iframe{width:85vw;min-height:85vh}","",{version:3,sources:["webpack://./src/dashboard/charts/chart.component.scss"],names:[],mappings:"AAAA,uDACI,YAAA,CACA,cAAA,CACA,QAAA,CACA,6BAAA,CACA,UAAA,CACA,eAAA,CAGJ,8DACE,UAAA,CACA,eAAA",sourcesContent:[".container {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n justify-content: space-between;\n width: 85vw;\n min-height: 60vh;\n}\n\n.container iframe {\n width: 85vw;\n min-height: 85vh;\n}\n"],sourceRoot:""}]),c.locals={container:"-esm-dha-workflow__chart-component__container___4Ymrz"};const i=c},79369:(e,n,t)=>{t.d(n,{A:()=>i});var o=t(72996),r=t.n(o),a=t(70159),c=t.n(a)()(r());c.push([e.id,".-esm-dha-workflow__overview-component__container___rxZmU{display:flex;width:100%;justify-content:flex-start;flex-wrap:wrap;gap:1rem}.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{border:1px solid gray;border-radius:5px;background-color:#fff;font-weight:bold;flex:0 0 250px;height:5rem;min-width:0}.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__title___mFQ96{display:flex;align-items:center;gap:.5rem;white-space:nowrap}@media(max-width: 1584px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(20% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1456px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(25% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1356px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(25% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1264px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(30% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1095px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(30% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1024px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(50% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 600px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 100%}}h4{font-weight:bold}.-esm-dha-workflow__overview-component__dropdownItem___yjyLG{display:flex;justify-self:flex-end;width:25%;min-width:180px;max-width:280px;margin-top:5rem;margin-bottom:5rem}.-esm-dha-workflow__overview-component__dropdownContainer___-kewt .-esm-dha-workflow__overview-component__cds--list-box__menu-item__option___4cEpM{font-weight:600}.-esm-dha-workflow__overview-component__dropdownContainer___-kewt .-esm-dha-workflow__overview-component__cds--list-box__field___Q7qml{font-weight:600}.-esm-dha-workflow__overview-component__opd___rw2WL{background-color:#2b579a !important}.-esm-dha-workflow__overview-component__completed___OV4q7{background-color:#4caf50 !important}.-esm-dha-workflow__overview-component__uncompleted___3-4Sp{background-color:#ffc107 !important}.-esm-dha-workflow__overview-component__emergencies___mqkVF{background-color:#f08080 !important}.-esm-dha-workflow__overview-component__waitingTime___SiqP4{background-color:#add8e6 !important}.-esm-dha-workflow__overview-component__labs___qR6Gg{background-color:#d3d3d3 !important}.-esm-dha-workflow__overview-component__pharmacy___cRtu0{background-color:#90ee90 !important}.-esm-dha-workflow__overview-component__text___43koE{color:#fff;display:flex;align-items:center;gap:.5rem;white-space:nowrap;font-size:1rem}","",{version:3,sources:["webpack://./src/dashboard/overview/overview.component.scss"],names:[],mappings:"AAAA,0DACI,YAAA,CACA,UAAA,CACA,0BAAA,CACA,cAAA,CACA,QAAA,CAEJ,+GACI,qBAAA,CACA,iBAAA,CACA,qBAAA,CACA,gBAAA,CACA,cAAA,CACA,WAAA,CACA,WAAA,CAGF,gHACA,YAAA,CACA,kBAAA,CACA,SAAA,CACA,kBAAA,CAIF,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAGJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAEF,qDACE,cAAA,CAAA,CAIJ,yBACE,+GACE,aAAA,CAAA,CAKJ,GACI,gBAAA,CAGJ,6DACI,YAAA,CACA,qBAAA,CACA,SAAA,CACA,eAAA,CACA,eAAA,CACA,eAAA,CACA,kBAAA,CAIF,mJACE,eAAA,CAGF,uIACE,eAAA,CAIJ,oDACI,mCAAA,CAEJ,0DACI,mCAAA,CAGJ,4DACI,mCAAA,CAEJ,4DACI,mCAAA,CAGJ,4DACI,mCAAA,CAEJ,qDACE,mCAAA,CAGF,yDACE,mCAAA,CAGF,qDACE,UAAA,CACA,YAAA,CACA,kBAAA,CACA,SAAA,CACA,kBAAA,CACA,cAAA",sourcesContent:[".container {\n display: flex;\n width: 100%;\n justify-content: flex-start;\n flex-wrap: wrap;\n gap: 1rem;\n\n.card {\n border: 1px solid grey;\n border-radius: 5px;\n background-color: white;\n font-weight: bold;\n flex: 0 0 250px;\n height: 5rem;\n min-width: 0;\n }\n\n .title {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n white-space: nowrap;\n}\n}\n\n@media (max-width: 1584px) {\n .container .card {\n flex: 0 0 calc(20% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n@media (max-width: 1456px) {\n .container .card {\n flex: 0 0 calc(25% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1356px) {\n .container .card {\n flex: 0 0 calc(25% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1264px) {\n .container .card {\n flex: 0 0 calc(30% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1095px) {\n .container .card {\n flex: 0 0 calc(30% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1024px) {\n .container .card {\n flex: 0 0 calc(50% - 1rem);\n }\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 600px) {\n .container .card {\n flex: 0 0 100%;\n }\n}\n\n\nh4 {\n font-weight: bold;\n}\n\n.dropdownItem {\n display: flex;\n justify-self: flex-end;\n width: 25%; \n min-width: 180px; \n max-width: 280px;\n margin-top: 5rem;\n margin-bottom: 5rem;\n}\n\n.dropdownContainer {\n .cds--list-box__menu-item__option {\n font-weight: 600; \n }\n\n .cds--list-box__field {\n font-weight: 600; \n }\n}\n\n.opd {\n background-color: #2B579A !important;\n}\n.completed {\n background-color: #4CAF50 !important;\n}\n\n.uncompleted {\n background-color: #FFC107 !important;\n}\n.emergencies {\n background-color: lightcoral !important;\n}\n\n.waitingTime {\n background-color: lightblue !important;\n}\n.labs {\n background-color: lightgrey !important;\n}\n\n.pharmacy {\n background-color: lightgreen !important;\n}\n\n.text {\n color: white;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n white-space: nowrap;\n font-size: 1rem;\n}"],sourceRoot:""}]),c.locals={container:"-esm-dha-workflow__overview-component__container___rxZmU",card:"-esm-dha-workflow__overview-component__card___L-lVb",title:"-esm-dha-workflow__overview-component__title___mFQ96",text:"-esm-dha-workflow__overview-component__text___43koE",dropdownItem:"-esm-dha-workflow__overview-component__dropdownItem___yjyLG",dropdownContainer:"-esm-dha-workflow__overview-component__dropdownContainer___-kewt","cds--list-box__menu-item__option":"-esm-dha-workflow__overview-component__cds--list-box__menu-item__option___4cEpM","cds--list-box__field":"-esm-dha-workflow__overview-component__cds--list-box__field___Q7qml",opd:"-esm-dha-workflow__overview-component__opd___rw2WL",completed:"-esm-dha-workflow__overview-component__completed___OV4q7",uncompleted:"-esm-dha-workflow__overview-component__uncompleted___3-4Sp",emergencies:"-esm-dha-workflow__overview-component__emergencies___mqkVF",waitingTime:"-esm-dha-workflow__overview-component__waitingTime___SiqP4",labs:"-esm-dha-workflow__overview-component__labs___qR6Gg",pharmacy:"-esm-dha-workflow__overview-component__pharmacy___cRtu0"};const i=c},85851:(e,n,t)=>{t.r(n),t.d(n,{default:()=>H});var o=t(16072),r=t.n(o),a=t(2364),c=t(85072),i=t.n(c),l=t(97825),s=t.n(l),m=t(77659),_=t.n(m),u=t(55056),A=t.n(u),d=t(10540),f=t.n(d),w=t(41113),p=t.n(w),h=t(46386),v={};v.styleTagTransform=p(),v.setAttributes=A(),v.insert=_().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=f(),i()(h.A,v);const b=h.A&&h.A.locals?h.A.locals:void 0;var y=t(55576),C=t(59184),x=t(13989),g=t(54535),k=t(99249),E=t(79369),I={};I.styleTagTransform=p(),I.setAttributes=A(),I.insert=_().bind(null,"head"),I.domAPI=s(),I.insertStyleElement=f(),i()(E.A,I);const S=E.A&&E.A.locals?E.A.locals:void 0;var G=t(98347),T=t(25987),F=t(62801);function B(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function j(e){return(n=function(){var n,t,o,r,a;return function(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(c){switch(c.label){case 0:return[4,(0,F.SW)()];case 1:return n=c.sent(),t="".concat(n,"/superset-token"),o=new URLSearchParams({locationUuid:e}).toString(),[4,(0,T.openmrsFetch)("".concat(t,"?").concat(o))];case 2:return(r=c.sent()).ok?[3,4]:[4,r.text()];case 3:throw a=c.sent(),new Error("Failed to fetch guest token: ".concat(r.status," - ").concat(a));case 4:return[4,r.json()];case 5:return[2,c.sent().access_token]}}))},function(){var e=this,t=arguments;return new Promise((function(o,r){var a=n.apply(e,t);function c(e){B(a,o,r,c,i,"next",e)}function i(e){B(a,o,r,c,i,"throw",e)}c(void 0)}))})();var n}var N=t(78542),z={};z.styleTagTransform=p(),z.setAttributes=A(),z.insert=_().bind(null,"head"),z.domAPI=s(),z.insertStyleElement=f(),i()(N.A,z);const U=N.A&&N.A.locals?N.A.locals:void 0;function D(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function P(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function q(e){return function(){var n=this,t=arguments;return new Promise((function(o,r){var a=e.apply(n,t);function c(e){P(a,o,r,c,i,"next",e)}function i(e){P(a,o,r,c,i,"throw",e)}c(void 0)}))}}function J(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}const L=function(){var e,n,t,a=(0,o.useRef)(null),c=(0,T.useSession)().sessionLocation.uuid,i=(n=(0,o.useState)(null),t=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,a=[],c=!0,i=!1;try{for(t=t.call(e);!(c=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);c=!0);}catch(e){i=!0,r=e}finally{try{c||null==t.return||t.return()}finally{if(i)throw r}}return a}}(n,t)||function(e,n){if(e){if("string"==typeof e)return D(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?D(e,n):void 0}}(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=i[0],s=i[1];(0,o.useEffect)((function(){q((function(){var e;return J(this,(function(n){switch(n.label){case 0:return[4,(0,F.E$)()];case 1:return e=n.sent(),s(e),[2]}}))}))()}),[]);var m=document.getElementById("my-superset-container"),_=null==m||null===(e=m.children)||void 0===e?void 0:e[0];return _&&(_.style.width="100%",_.style.height="100%"),(0,o.useEffect)((function(){(0,G.u)({id:"81cc98fd-5195-4404-bf38-2c8cd5509747",supersetDomain:"".concat(l,"/superset"),mountPoint:a.current,fetchGuestToken:function(){return q((function(){return J(this,(function(e){switch(e.label){case 0:return[4,j(c)];case 1:return[2,e.sent()]}}))}))()},dashboardUiConfig:{hideTitle:!0,filters:{expanded:!0}}})}),[l]),r().createElement(r().Fragment,null,r().createElement("div",{id:"my-superset-container",className:U.container,ref:a}))};function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function V(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Z(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,n){if(e){if("string"==typeof e)return O(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?O(e,n):void 0}}const R=function(e){var n,t,c,i,l,s,m,_,u,A=e.triageCount,d=e.consultationCount,f=e.dashboardSummary,w=(V(A).concat(V(d)).filter((function(e){return"WAITING"===e.status||"IN SERVICE"===e.status})).length,_=(0,o.useState)(null),u=2,function(e){if(Array.isArray(e))return e}(_)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,a=[],c=!0,i=!1;try{for(t=t.call(e);!(c=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);c=!0);}catch(e){i=!0,r=e}finally{try{c||null==t.return||t.return()}finally{if(i)throw r}}return a}}(_,u)||Z(_,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=w[0];switch(w[1],null==A?void 0:A.length,null==d?void 0:d.length,p){case"Triage Patients":case"Consultation Patients":case"Walk-In Patients":case"Emergency Patients":break;default:V(null!=A?A:[]).concat(V(null!=d?d:[]))}return r().createElement(r().Fragment,null,r().createElement("div",{className:S.container},r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.opd)},r().createElement("h4",{className:S.text},r().createElement(y.Gp,{size:24}),"Total OPD Visits"),r().createElement("h4",{className:S.text},null!==(n=null==f?void 0:f.total_opd_visits)&&void 0!==n?n:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.completed)},r().createElement("h4",{className:S.text},r().createElement(C._j,{size:20})," Completed Visits"),r().createElement("h4",{className:S.text},null!==(t=null==f?void 0:f.completed_visits)&&void 0!==t?t:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.uncompleted)},r().createElement("h4",{className:S.text},r().createElement(x.gX,{size:20})," Uncompleted visits"),r().createElement("h4",{className:S.text},null!==(c=null==f?void 0:f.uncompleted_visits)&&void 0!==c?c:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.labs)},r().createElement("h4",{className:S.text},r().createElement(C.ZQ,{size:20})," Labs"),r().createElement("h4",{className:S.text},null!==(i=null==f?void 0:f.labs)&&void 0!==i?i:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.pharmacy)},r().createElement("h4",{className:S.text},r().createElement(g.gG,{size:20})," Pharmacy"),r().createElement("h4",{className:S.text},null!==(l=null==f?void 0:f.pharmacy)&&void 0!==l?l:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.emergencies)},r().createElement("h4",{className:S.text},r().createElement(k.vg,{size:20})," Emergencies"),r().createElement("h4",{className:S.text},null!==(s=null==f?void 0:f.emergencies)&&void 0!==s?s:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.waitingTime)},r().createElement("h4",{className:S.text},r().createElement(x.gX,{size:20})," Avg. Waiting Time"),r().createElement("h4",{className:S.text},null!==(m=null==f?void 0:f.average_waiting_minutes)&&void 0!==m?m:0," mins"))),r().createElement(L,null))};function W(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function Q(e){return(n=function(){var n,t,o,r,a;return function(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(c){switch(c.label){case 0:return[4,(0,F.SW)()];case 1:return n=c.sent(),t="".concat(n,"/dashboard-summary"),o=new URLSearchParams({locationUuid:e}).toString(),[4,(0,T.openmrsFetch)("".concat(t,"?").concat(o))];case 2:return(r=c.sent()).ok?[3,4]:[4,r.text()];case 3:throw a=c.sent(),new Error("Failed to fetch dashboard summary: ".concat(r.status," - ").concat(a));case 4:return[4,r.json()];case 5:return[2,c.sent().data]}}))},function(){var e=this,t=arguments;return new Promise((function(o,r){var a=n.apply(e,t);function c(e){W(a,o,r,c,i,"next",e)}function i(e){W(a,o,r,c,i,"throw",e)}c(void 0)}))})();var n}function Y(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function M(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function $(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,a=[],c=!0,i=!1;try{for(t=t.call(e);!(c=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);c=!0);}catch(e){i=!0,r=e}finally{try{c||null==t.return||t.return()}finally{if(i)throw r}}return a}}(e,n)||function(e,n){if(e){if("string"==typeof e)return Y(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Y(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const H=function(){var e=$((0,o.useState)([]),2),n=e[0],t=(e[1],$((0,o.useState)([]),2)),c=t[0],i=(t[1],$((0,o.useState)([]),2)),l=i[0],s=i[1],m=(0,T.useSession)().sessionLocation.uuid;(0,o.useEffect)((function(){_()}),[]);var _=function(){return(e=function(){var e;return function(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(n){switch(n.label){case 0:return[4,Q(m)];case 1:return e=n.sent(),s(e[0]),[2]}}))},function(){var n=this,t=arguments;return new Promise((function(o,r){var a=e.apply(n,t);function c(e){M(a,o,r,c,i,"next",e)}function i(e){M(a,o,r,c,i,"throw",e)}c(void 0)}))})();var e};return r().createElement("div",{className:b.container},r().createElement(a.tUM,null,r().createElement(a.wbY,{contained:!0,scrollDebounceWait:200},r().createElement(a.ozo,null,r().createElement("span",{className:b.tabText},"Overview"))),r().createElement(a.T2N,null,r().createElement(a.KpK,null,r().createElement(R,{triageCount:n,consultationCount:c,dashboardSummary:l})))))}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_ampath_esm_dha_workflow_app=globalThis.webpackChunk_ampath_esm_dha_workflow_app||[]).push([[5851],{46386:(e,n,t)=>{t.d(n,{A:()=>i});var o=t(72996),r=t.n(o),a=t(70159),c=t.n(a)()(r());c.push([e.id,".-esm-dha-workflow__dashboard-component__container___v92cd{margin:3rem}.-esm-dha-workflow__dashboard-component__tabText___QMBHG{font-size:20px}","",{version:3,sources:["webpack://./src/dashboard/dashboard.component.scss"],names:[],mappings:"AAAA,2DACI,WAAA,CAEJ,yDACI,cAAA",sourcesContent:[".container {\n margin: 3rem;\n}\n.tabText {\n font-size: 20px;\n}\n\n"],sourceRoot:""}]),c.locals={container:"-esm-dha-workflow__dashboard-component__container___v92cd",tabText:"-esm-dha-workflow__dashboard-component__tabText___QMBHG"};const i=c},78542:(e,n,t)=>{t.d(n,{A:()=>i});var o=t(72996),r=t.n(o),a=t(70159),c=t.n(a)()(r());c.push([e.id,".-esm-dha-workflow__chart-component__container___4Ymrz{display:flex;flex-wrap:wrap;gap:1rem;justify-content:space-between;width:85vw;min-height:60vh}.-esm-dha-workflow__chart-component__container___4Ymrz iframe{width:85vw;min-height:85vh}","",{version:3,sources:["webpack://./src/dashboard/charts/chart.component.scss"],names:[],mappings:"AAAA,uDACI,YAAA,CACA,cAAA,CACA,QAAA,CACA,6BAAA,CACA,UAAA,CACA,eAAA,CAGJ,8DACE,UAAA,CACA,eAAA",sourcesContent:[".container {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n justify-content: space-between;\n width: 85vw;\n min-height: 60vh;\n}\n\n.container iframe {\n width: 85vw;\n min-height: 85vh;\n}\n"],sourceRoot:""}]),c.locals={container:"-esm-dha-workflow__chart-component__container___4Ymrz"};const i=c},79369:(e,n,t)=>{t.d(n,{A:()=>i});var o=t(72996),r=t.n(o),a=t(70159),c=t.n(a)()(r());c.push([e.id,".-esm-dha-workflow__overview-component__container___rxZmU{display:flex;width:100%;justify-content:flex-start;flex-wrap:wrap;gap:1rem}.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{border:1px solid gray;border-radius:5px;background-color:#fff;font-weight:bold;flex:0 0 250px;height:5rem;min-width:0}.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__title___mFQ96{display:flex;align-items:center;gap:.5rem;white-space:nowrap}@media(max-width: 1584px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(20% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1456px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(25% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1356px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(25% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1264px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(30% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1095px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(30% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 1024px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 calc(50% - 1rem)}.-esm-dha-workflow__overview-component__text___43koE{font-size:1rem}}@media(max-width: 600px){.-esm-dha-workflow__overview-component__container___rxZmU .-esm-dha-workflow__overview-component__card___L-lVb{flex:0 0 100%}}h4{font-weight:bold}.-esm-dha-workflow__overview-component__dropdownItem___yjyLG{display:flex;justify-self:flex-end;width:25%;min-width:180px;max-width:280px;margin-top:5rem;margin-bottom:5rem}.-esm-dha-workflow__overview-component__dropdownContainer___-kewt .-esm-dha-workflow__overview-component__cds--list-box__menu-item__option___4cEpM{font-weight:600}.-esm-dha-workflow__overview-component__dropdownContainer___-kewt .-esm-dha-workflow__overview-component__cds--list-box__field___Q7qml{font-weight:600}.-esm-dha-workflow__overview-component__opd___rw2WL{background-color:#2b579a !important}.-esm-dha-workflow__overview-component__completed___OV4q7{background-color:#4caf50 !important}.-esm-dha-workflow__overview-component__uncompleted___3-4Sp{background-color:#ffc107 !important}.-esm-dha-workflow__overview-component__emergencies___mqkVF{background-color:#f08080 !important}.-esm-dha-workflow__overview-component__waitingTime___SiqP4{background-color:#add8e6 !important}.-esm-dha-workflow__overview-component__labs___qR6Gg{background-color:#d3d3d3 !important}.-esm-dha-workflow__overview-component__pharmacy___cRtu0{background-color:#90ee90 !important}.-esm-dha-workflow__overview-component__text___43koE{color:#fff;display:flex;align-items:center;gap:.5rem;white-space:nowrap;font-size:1rem}.-esm-dha-workflow__overview-component__tabsContainer___HSUVw{margin-top:2rem}","",{version:3,sources:["webpack://./src/dashboard/overview/overview.component.scss"],names:[],mappings:"AAAA,0DACI,YAAA,CACA,UAAA,CACA,0BAAA,CACA,cAAA,CACA,QAAA,CAEJ,+GACI,qBAAA,CACA,iBAAA,CACA,qBAAA,CACA,gBAAA,CACA,cAAA,CACA,WAAA,CACA,WAAA,CAGF,gHACA,YAAA,CACA,kBAAA,CACA,SAAA,CACA,kBAAA,CAIF,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAGJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAGF,qDACE,cAAA,CAAA,CAIJ,0BACE,+GACE,yBAAA,CAEF,qDACE,cAAA,CAAA,CAIJ,yBACE,+GACE,aAAA,CAAA,CAKJ,GACI,gBAAA,CAGJ,6DACI,YAAA,CACA,qBAAA,CACA,SAAA,CACA,eAAA,CACA,eAAA,CACA,eAAA,CACA,kBAAA,CAIF,mJACE,eAAA,CAGF,uIACE,eAAA,CAIJ,oDACI,mCAAA,CAEJ,0DACI,mCAAA,CAGJ,4DACI,mCAAA,CAEJ,4DACI,mCAAA,CAGJ,4DACI,mCAAA,CAEJ,qDACE,mCAAA,CAGF,yDACE,mCAAA,CAGF,qDACE,UAAA,CACA,YAAA,CACA,kBAAA,CACA,SAAA,CACA,kBAAA,CACA,cAAA,CAEF,8DACE,eAAA",sourcesContent:[".container {\n display: flex;\n width: 100%;\n justify-content: flex-start;\n flex-wrap: wrap;\n gap: 1rem;\n\n.card {\n border: 1px solid grey;\n border-radius: 5px;\n background-color: white;\n font-weight: bold;\n flex: 0 0 250px;\n height: 5rem;\n min-width: 0;\n }\n\n .title {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n white-space: nowrap;\n}\n}\n\n@media (max-width: 1584px) {\n .container .card {\n flex: 0 0 calc(20% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n@media (max-width: 1456px) {\n .container .card {\n flex: 0 0 calc(25% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1356px) {\n .container .card {\n flex: 0 0 calc(25% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1264px) {\n .container .card {\n flex: 0 0 calc(30% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1095px) {\n .container .card {\n flex: 0 0 calc(30% - 1rem);\n }\n\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 1024px) {\n .container .card {\n flex: 0 0 calc(50% - 1rem);\n }\n .text {\n font-size: 1rem;\n }\n}\n\n@media (max-width: 600px) {\n .container .card {\n flex: 0 0 100%;\n }\n}\n\n\nh4 {\n font-weight: bold;\n}\n\n.dropdownItem {\n display: flex;\n justify-self: flex-end;\n width: 25%; \n min-width: 180px; \n max-width: 280px;\n margin-top: 5rem;\n margin-bottom: 5rem;\n}\n\n.dropdownContainer {\n .cds--list-box__menu-item__option {\n font-weight: 600; \n }\n\n .cds--list-box__field {\n font-weight: 600; \n }\n}\n\n.opd {\n background-color: #2B579A !important;\n}\n.completed {\n background-color: #4CAF50 !important;\n}\n\n.uncompleted {\n background-color: #FFC107 !important;\n}\n.emergencies {\n background-color: lightcoral !important;\n}\n\n.waitingTime {\n background-color: lightblue !important;\n}\n.labs {\n background-color: lightgrey !important;\n}\n\n.pharmacy {\n background-color: lightgreen !important;\n}\n\n.text {\n color: white;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n white-space: nowrap;\n font-size: 1rem;\n}\n.tabsContainer {\n margin-top: 2rem;\n}"],sourceRoot:""}]),c.locals={container:"-esm-dha-workflow__overview-component__container___rxZmU",card:"-esm-dha-workflow__overview-component__card___L-lVb",title:"-esm-dha-workflow__overview-component__title___mFQ96",text:"-esm-dha-workflow__overview-component__text___43koE",dropdownItem:"-esm-dha-workflow__overview-component__dropdownItem___yjyLG",dropdownContainer:"-esm-dha-workflow__overview-component__dropdownContainer___-kewt","cds--list-box__menu-item__option":"-esm-dha-workflow__overview-component__cds--list-box__menu-item__option___4cEpM","cds--list-box__field":"-esm-dha-workflow__overview-component__cds--list-box__field___Q7qml",opd:"-esm-dha-workflow__overview-component__opd___rw2WL",completed:"-esm-dha-workflow__overview-component__completed___OV4q7",uncompleted:"-esm-dha-workflow__overview-component__uncompleted___3-4Sp",emergencies:"-esm-dha-workflow__overview-component__emergencies___mqkVF",waitingTime:"-esm-dha-workflow__overview-component__waitingTime___SiqP4",labs:"-esm-dha-workflow__overview-component__labs___qR6Gg",pharmacy:"-esm-dha-workflow__overview-component__pharmacy___cRtu0",tabsContainer:"-esm-dha-workflow__overview-component__tabsContainer___HSUVw"};const i=c},85851:(e,n,t)=>{t.r(n),t.d(n,{default:()=>H});var o=t(16072),r=t.n(o),a=t(2364),c=t(85072),i=t.n(c),l=t(97825),s=t.n(l),m=t(77659),_=t.n(m),u=t(55056),A=t.n(u),d=t(10540),f=t.n(d),w=t(41113),p=t.n(w),h=t(46386),v={};v.styleTagTransform=p(),v.setAttributes=A(),v.insert=_().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=f(),i()(h.A,v);const b=h.A&&h.A.locals?h.A.locals:void 0;var y=t(55576),C=t(59184),x=t(13989),g=t(54535),k=t(99249),E=t(79369),I={};I.styleTagTransform=p(),I.setAttributes=A(),I.insert=_().bind(null,"head"),I.domAPI=s(),I.insertStyleElement=f(),i()(E.A,I);const S=E.A&&E.A.locals?E.A.locals:void 0;var G=t(98347),T=t(25987),F=t(62801);function z(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function B(e,n){return(t=function(){var t,o,r,a,c;return function(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(i){switch(i.label){case 0:return[4,(0,F.SW)()];case 1:return t=i.sent(),o="".concat(t,"/superset-token"),r=new URLSearchParams({locationUuid:e,dashboardId:n}).toString(),[4,(0,T.openmrsFetch)("".concat(o,"?").concat(r))];case 2:return(a=i.sent()).ok?[3,4]:[4,a.text()];case 3:throw c=i.sent(),new Error("Failed to fetch guest token: ".concat(a.status," - ").concat(c));case 4:return[4,a.json()];case 5:return[2,i.sent().access_token]}}))},function(){var e=this,n=arguments;return new Promise((function(o,r){var a=t.apply(e,n);function c(e){z(a,o,r,c,i,"next",e)}function i(e){z(a,o,r,c,i,"throw",e)}c(void 0)}))})();var t}var N=t(78542),j={};j.styleTagTransform=p(),j.setAttributes=A(),j.insert=_().bind(null,"head"),j.domAPI=s(),j.insertStyleElement=f(),i()(N.A,j);const U=N.A&&N.A.locals?N.A.locals:void 0;function D(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function P(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function q(e){return function(){var n=this,t=arguments;return new Promise((function(o,r){var a=e.apply(n,t);function c(e){P(a,o,r,c,i,"next",e)}function i(e){P(a,o,r,c,i,"throw",e)}c(void 0)}))}}function J(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}const L=function(e){var n,t,a,c=e.dashboardId,i=(0,o.useRef)(null),l=(0,T.useSession)().sessionLocation.uuid,s=(t=(0,o.useState)(null),a=2,function(e){if(Array.isArray(e))return e}(t)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,a=[],c=!0,i=!1;try{for(t=t.call(e);!(c=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);c=!0);}catch(e){i=!0,r=e}finally{try{c||null==t.return||t.return()}finally{if(i)throw r}}return a}}(t,a)||function(e,n){if(e){if("string"==typeof e)return D(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?D(e,n):void 0}}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=s[0],_=s[1];(0,o.useEffect)((function(){q((function(){var e;return J(this,(function(n){switch(n.label){case 0:return[4,(0,F.E$)()];case 1:return e=n.sent(),_(e),[2]}}))}))()}),[]);var u=document.getElementById("my-superset-container"),A=null==u||null===(n=u.children)||void 0===n?void 0:n[0];return A&&(A.style.width="100%",A.style.height="100%"),(0,o.useEffect)((function(){(0,G.u)({id:c,supersetDomain:"".concat(m,"/superset"),mountPoint:i.current,fetchGuestToken:function(){return q((function(){return J(this,(function(e){switch(e.label){case 0:return[4,B(l,c)];case 1:return[2,e.sent()]}}))}))()},dashboardUiConfig:{hideTitle:!0,filters:{expanded:!0}}})}),[m]),r().createElement(r().Fragment,null,r().createElement("div",{id:"my-superset-container",className:U.container,ref:i}))};function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function V(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||W(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,n){if(e){if("string"==typeof e)return O(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?O(e,n):void 0}}const Z=function(e){var n,t,c,i,l,s,m,_,u,A=e.triageCount,d=e.consultationCount,f=e.dashboardSummary,w=(V(A).concat(V(d)).filter((function(e){return"WAITING"===e.status||"IN SERVICE"===e.status})).length,_=(0,o.useState)(null),u=2,function(e){if(Array.isArray(e))return e}(_)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,a=[],c=!0,i=!1;try{for(t=t.call(e);!(c=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);c=!0);}catch(e){i=!0,r=e}finally{try{c||null==t.return||t.return()}finally{if(i)throw r}}return a}}(_,u)||W(_,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=w[0];switch(w[1],null==A?void 0:A.length,null==d?void 0:d.length,p){case"Triage Patients":case"Consultation Patients":case"Walk-In Patients":case"Emergency Patients":break;default:V(null!=A?A:[]).concat(V(null!=d?d:[]))}return r().createElement(r().Fragment,null,r().createElement("div",{className:S.container},r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.opd)},r().createElement("h4",{className:S.text},r().createElement(y.Gp,{size:24}),"Total OPD Visits"),r().createElement("h4",{className:S.text},null!==(n=null==f?void 0:f.total_opd_visits)&&void 0!==n?n:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.completed)},r().createElement("h4",{className:S.text},r().createElement(C._j,{size:20})," Completed Visits"),r().createElement("h4",{className:S.text},null!==(t=null==f?void 0:f.completed_visits)&&void 0!==t?t:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.uncompleted)},r().createElement("h4",{className:S.text},r().createElement(x.gX,{size:20})," Uncompleted visits"),r().createElement("h4",{className:S.text},null!==(c=null==f?void 0:f.uncompleted_visits)&&void 0!==c?c:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.labs)},r().createElement("h4",{className:S.text},r().createElement(C.ZQ,{size:20})," Labs"),r().createElement("h4",{className:S.text},null!==(i=null==f?void 0:f.labs)&&void 0!==i?i:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.pharmacy)},r().createElement("h4",{className:S.text},r().createElement(g.gG,{size:20})," Pharmacy"),r().createElement("h4",{className:S.text},null!==(l=null==f?void 0:f.pharmacy)&&void 0!==l?l:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.emergencies)},r().createElement("h4",{className:S.text},r().createElement(k.vg,{size:20})," Emergencies"),r().createElement("h4",{className:S.text},null!==(s=null==f?void 0:f.emergencies)&&void 0!==s?s:0)),r().createElement(a.FAs,{className:"".concat(S.card," ").concat(S.waitingTime)},r().createElement("h4",{className:S.text},r().createElement(x.gX,{size:20})," Avg. Waiting Time"),r().createElement("h4",{className:S.text},null!==(m=null==f?void 0:f.average_waiting_minutes)&&void 0!==m?m:0," mins"))),r().createElement("div",{className:S.tabsContainer},r().createElement(a.tUM,null,r().createElement(a.wbY,null,r().createElement(a.ozo,null,"Daily"),r().createElement(a.ozo,null,"Weekly"),r().createElement(a.ozo,null,"Monthly")),r().createElement(a.T2N,null,r().createElement(a.KpK,null,r().createElement(L,{dashboardId:"1bdad7e2-e9a7-4cb5-886c-185f63b2eae0"})),r().createElement(a.KpK,null,r().createElement(L,{dashboardId:"0c59e7cd-2eba-4426-9d52-1db0866e0377"})),r().createElement(a.KpK,null,r().createElement(L,{dashboardId:"fe8606e8-2160-4914-860a-f5abc386d9c1"}))))))};function R(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function M(e){return(n=function(){var n,t,o,r,a;return function(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(c){switch(c.label){case 0:return[4,(0,F.SW)()];case 1:return n=c.sent(),t="".concat(n,"/dashboard-summary"),o=new URLSearchParams({locationUuid:e}).toString(),[4,(0,T.openmrsFetch)("".concat(t,"?").concat(o))];case 2:return(r=c.sent()).ok?[3,4]:[4,r.text()];case 3:throw a=c.sent(),new Error("Failed to fetch dashboard summary: ".concat(r.status," - ").concat(a));case 4:return[4,r.json()];case 5:return[2,c.sent().data]}}))},function(){var e=this,t=arguments;return new Promise((function(o,r){var a=n.apply(e,t);function c(e){R(a,o,r,c,i,"next",e)}function i(e){R(a,o,r,c,i,"throw",e)}c(void 0)}))})();var n}function Y(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function K(e,n,t,o,r,a,c){try{var i=e[a](c),l=i.value}catch(e){return void t(e)}i.done?n(l):Promise.resolve(l).then(o,r)}function Q(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,a=[],c=!0,i=!1;try{for(t=t.call(e);!(c=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);c=!0);}catch(e){i=!0,r=e}finally{try{c||null==t.return||t.return()}finally{if(i)throw r}}return a}}(e,n)||function(e,n){if(e){if("string"==typeof e)return Y(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Y(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const H=function(){var e=Q((0,o.useState)([]),2),n=e[0],t=(e[1],Q((0,o.useState)([]),2)),c=t[0],i=(t[1],Q((0,o.useState)([]),2)),l=i[0],s=i[1],m=(0,T.useSession)().sessionLocation.uuid;(0,o.useEffect)((function(){_()}),[]);var _=function(){return(e=function(){var e;return function(e,n){var t,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,(function(n){switch(n.label){case 0:return[4,M(m)];case 1:return e=n.sent(),s(e[0]),[2]}}))},function(){var n=this,t=arguments;return new Promise((function(o,r){var a=e.apply(n,t);function c(e){K(a,o,r,c,i,"next",e)}function i(e){K(a,o,r,c,i,"throw",e)}c(void 0)}))})();var e};return r().createElement("div",{className:b.container},r().createElement(a.tUM,null,r().createElement(a.wbY,{contained:!0,scrollDebounceWait:200},r().createElement(a.ozo,null,r().createElement("span",{className:b.tabText},"Overview"))),r().createElement(a.T2N,null,r().createElement(a.KpK,null,r().createElement(Z,{triageCount:n,consultationCount:c,dashboardSummary:l})))))}}}]);
|
package/dist/5851.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"5851.js","mappings":"6MAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,kJAAmJ,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,sDAAsD,MAAQ,GAAG,SAAW,kCAAkC,eAAiB,CAAC,+EAA+E,WAAa,MAEnbH,EAAwBI,OAAS,CAChC,UAAa,4DACb,QAAW,2DAEZ,S,sECRIJ,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,iPAAkP,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,yDAAyD,MAAQ,GAAG,SAAW,+FAA+F,eAAiB,CAAC,4NAA4N,WAAa,MAE/tBH,EAAwBI,OAAS,CAChC,UAAa,yDAEd,S,sECPIJ,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,
|
|
1
|
+
{"version":3,"file":"5851.js","mappings":"6MAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,kJAAmJ,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,sDAAsD,MAAQ,GAAG,SAAW,kCAAkC,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ath/esm-dha-workflow-app/./src/dashboard/charts/chart.component.scss","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/overview/overview.component.scss","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/dashboard.component.scss?1f15","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/overview/overview.component.scss?0de4","webpack://@ampath/esm-dha-workflow-app/./src/resources/superset.resource.ts","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/charts/chart.component.scss?536b","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/charts/chart.component.tsx","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/overview/overview.component.tsx","webpack://@ampath/esm-dha-workflow-app/./src/resources/dashboard.resource.ts","webpack://@ampath/esm-dha-workflow-app/./src/dashboard/dashboard.component.tsx"],"names":["___CSS_LOADER_EXPORT___","push","module","id","locals","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","fetchGuestToken","locationUuid","dashboardId","etlBaseUrl","supersetTokenUrl","queryString","response","errorText","getEtlBaseUrl","URLSearchParams","toString","openmrsFetch","ok","text","Error","status","json","access_token","container","ref","useRef","useSession","sessionLocation","uuid","useState","subDomainUrl","setSubDomainUrl","useEffect","url","getSubDomainUrl","document","getElementById","firstChild","children","style","width","height","embedDashboard","supersetDomain","mountPoint","current","dashboardUiConfig","hideTitle","filters","expanded","div","className","styles","dashboardSummary","triageCount","consultationCount","filter","patient","length","selected","Tile","card","opd","h4","UserMultiple","size","total_opd_visits","completed","CheckmarkFilled","completed_visits","uncompleted","Time","uncompleted_visits","labs","Chemistry","pharmacy","Medication","emergencies","Hospital","waitingTime","average_waiting_minutes","tabsContainer","Tabs","TabList","Tab","TabPanels","TabPanel","Chart","getDashBoardSummary","dashboardSummaryUrl","data","triageQueueEntries","consultationQueueEntries","setDashboardSummary","getDashBoardData","res","contained","scrollDebounceWait","span","tabText","Overview"],"sourceRoot":""}
|
|
@@ -999,9 +999,9 @@
|
|
|
999
999
|
"entry": false,
|
|
1000
1000
|
"recorded": false,
|
|
1001
1001
|
"reason": "split chunk (cache group: default)",
|
|
1002
|
-
"size":
|
|
1002
|
+
"size": 53986,
|
|
1003
1003
|
"sizes": {
|
|
1004
|
-
"javascript":
|
|
1004
|
+
"javascript": 53986
|
|
1005
1005
|
},
|
|
1006
1006
|
"names": [],
|
|
1007
1007
|
"idHints": [],
|
|
@@ -1015,7 +1015,7 @@
|
|
|
1015
1015
|
"auxiliaryFiles": [
|
|
1016
1016
|
"5851.js.map"
|
|
1017
1017
|
],
|
|
1018
|
-
"hash": "
|
|
1018
|
+
"hash": "7417297211e0cecb",
|
|
1019
1019
|
"childrenByOrder": {}
|
|
1020
1020
|
},
|
|
1021
1021
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{},"pages":[{"component":"root","route":"dha-workflow","online":true,"offline":true}],"extensions":[{"component":"navLinks","name":"side-nav-workflow-links","slot":"dha-workflow-slot","online":true,"offline":true},{"name":"dha-workflow-dashboard-link","component":"dhaWorkflowDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dashboard","slot":"dha-workflow-dashboard-slot","title":"Dashboard"},"online":true,"offline":true,"order":0},{"component":"dhaWorkflowDashboard","name":"dashboardExt","slot":"dha-workflow-dashboard-slot"},{"name":"registry-dashboard-link","component":"registryDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"registry","slot":"client-registry-dashboard-slot","title":"Registry"},"online":true,"offline":true,"order":1},{"component":"registryExtension","name":"registry","slot":"client-registry-dashboard-slot"},{"name":"triage-dashboard-link","component":"triageDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"triage","slot":"triage-queue-dashboard-slot","title":"Triage"},"online":true,"offline":false},{"component":"triageQueueExtension","name":"triage","slot":"triage-queue-dashboard-slot"},{"name":"consultation-dashboard-link","component":"consultationDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"consultation","slot":"consultation-dashboard-slot","title":"Consultation"},"online":true,"offline":false},{"component":"consultationQueue","name":"consultation","slot":"consultation-dashboard-slot"},{"name":"mnch-dashboard-link","component":"mnchQueueDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"mnch","slot":"mnch-dashboard-slot","title":"MNCH"},"online":true,"offline":true},{"component":"mnchQueueDashboard","name":"mnch","slot":"mnch-dashboard-slot"},{"name":"pharmacy-dashboard-link","component":"pharmacyDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Pharmacy"},"online":true,"offline":true},{"name":"bookings-dashboard-link","component":"bookingsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"bookings","slot":"bookings-dashboard-slot","title":"Bookings"},"online":true,"offline":true},{"component":"bookings","name":"bookings","slot":"bookings-dashboard-slot"},{"name":"service-queue-admin-dashboard-link","component":"serviceQueuesAdminLink","slot":"app-menu-slot","meta":{"name":"service-queue-admin","slot":"service-queue-admin-dashboard-slot","title":"Service Queue Admin"},"online":true,"offline":true},{"component":"serviceQueueAdmin","name":"service-queue-admin","slot":"service-queue-admin-dashboard-slot"},{"name":"admissions-dashboard-link","component":"admissionsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"admissions-dashboard","slot":"admissions-dashboard-slot","title":"Admissions Dashboard"},"online":true,"offline":true},{"component":"admissionsDashboard","name":"admissions-dashboard","slot":"admissions-dashboard-slot"},{"component":"serviceQueueBannerComponent","name":"service-queue-banne","slot":"patient-banner-tags-slot"},{"name":"admissions-summary-dashboard","slot":"patient-chart-dashboard-slot","component":"patientChartAdmissionsLink","meta":{"slot":"patient-chart-admissions-summary-dashboard-slot","path":"Admissions","layoutMode":"anchored"},"online":true,"offline":true},{"name":"admission-details","slot":"patient-chart-admissions-summary-dashboard-slot","component":"patientAdmissionSummary","order":1,"meta":{"title":"Admissions","view":"admissions"},"online":true,"offline":true},{"name":"ampath-billing-dashboard-link","component":"billingDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"billing","slot":"ampath-billing-dashboard-slot","title":"Accounting"},"online":true,"offline":true},{"component":"billingRoot","name":"billing","slot":"ampath-billing-dashboard-slot"},{"name":"ampath-billing-checkin-form","slot":"extra-visit-attribute-slot","component":"visitBillingForm"}],"workspaces":[{"name":"create-order-bill-form-workspace","component":"createOrderBillFormWorkspace","title":"Create order Bill","type":"other-form"}],"modals":[{"name":"sign-off-queue-entry-modal","component":"signOffModal"}],"version":"4.0.0-next.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{},"pages":[{"component":"root","route":"dha-workflow","online":true,"offline":true}],"extensions":[{"component":"navLinks","name":"side-nav-workflow-links","slot":"dha-workflow-slot","online":true,"offline":true},{"name":"dha-workflow-dashboard-link","component":"dhaWorkflowDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dashboard","slot":"dha-workflow-dashboard-slot","title":"Dashboard"},"online":true,"offline":true,"order":0},{"component":"dhaWorkflowDashboard","name":"dashboardExt","slot":"dha-workflow-dashboard-slot"},{"name":"registry-dashboard-link","component":"registryDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"registry","slot":"client-registry-dashboard-slot","title":"Registry"},"online":true,"offline":true,"order":1},{"component":"registryExtension","name":"registry","slot":"client-registry-dashboard-slot"},{"name":"triage-dashboard-link","component":"triageDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"triage","slot":"triage-queue-dashboard-slot","title":"Triage"},"online":true,"offline":false},{"component":"triageQueueExtension","name":"triage","slot":"triage-queue-dashboard-slot"},{"name":"consultation-dashboard-link","component":"consultationDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"consultation","slot":"consultation-dashboard-slot","title":"Consultation"},"online":true,"offline":false},{"component":"consultationQueue","name":"consultation","slot":"consultation-dashboard-slot"},{"name":"mnch-dashboard-link","component":"mnchQueueDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"mnch","slot":"mnch-dashboard-slot","title":"MNCH"},"online":true,"offline":true},{"component":"mnchQueueDashboard","name":"mnch","slot":"mnch-dashboard-slot"},{"name":"pharmacy-dashboard-link","component":"pharmacyDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Pharmacy"},"online":true,"offline":true},{"name":"bookings-dashboard-link","component":"bookingsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"bookings","slot":"bookings-dashboard-slot","title":"Bookings"},"online":true,"offline":true},{"component":"bookings","name":"bookings","slot":"bookings-dashboard-slot"},{"name":"service-queue-admin-dashboard-link","component":"serviceQueuesAdminLink","slot":"app-menu-slot","meta":{"name":"service-queue-admin","slot":"service-queue-admin-dashboard-slot","title":"Service Queue Admin"},"online":true,"offline":true},{"component":"serviceQueueAdmin","name":"service-queue-admin","slot":"service-queue-admin-dashboard-slot"},{"name":"admissions-dashboard-link","component":"admissionsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"admissions-dashboard","slot":"admissions-dashboard-slot","title":"Admissions Dashboard"},"online":true,"offline":true},{"component":"admissionsDashboard","name":"admissions-dashboard","slot":"admissions-dashboard-slot"},{"component":"serviceQueueBannerComponent","name":"service-queue-banne","slot":"patient-banner-tags-slot"},{"name":"admissions-summary-dashboard","slot":"patient-chart-dashboard-slot","component":"patientChartAdmissionsLink","meta":{"slot":"patient-chart-admissions-summary-dashboard-slot","path":"Admissions","layoutMode":"anchored"},"online":true,"offline":true},{"name":"admission-details","slot":"patient-chart-admissions-summary-dashboard-slot","component":"patientAdmissionSummary","order":1,"meta":{"title":"Admissions","view":"admissions"},"online":true,"offline":true},{"name":"ampath-billing-dashboard-link","component":"billingDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"billing","slot":"ampath-billing-dashboard-slot","title":"Accounting"},"online":true,"offline":true},{"component":"billingRoot","name":"billing","slot":"ampath-billing-dashboard-slot"},{"name":"ampath-billing-checkin-form","slot":"extra-visit-attribute-slot","component":"visitBillingForm"}],"workspaces":[{"name":"create-order-bill-form-workspace","component":"createOrderBillFormWorkspace","title":"Create order Bill","type":"other-form"}],"modals":[{"name":"sign-off-queue-entry-modal","component":"signOffModal"}],"version":"4.0.0-next.133"}
|
package/package.json
CHANGED
|
@@ -7,9 +7,11 @@ import { getSubDomainUrl } from '../../shared/utils/get-base-url';
|
|
|
7
7
|
|
|
8
8
|
import styles from './chart.component.scss';
|
|
9
9
|
|
|
10
|
-
interface ChartProps {
|
|
10
|
+
interface ChartProps {
|
|
11
|
+
dashboardId: string;
|
|
12
|
+
}
|
|
11
13
|
|
|
12
|
-
const Chart: React.FC<ChartProps> = () => {
|
|
14
|
+
const Chart: React.FC<ChartProps> = ({ dashboardId }) => {
|
|
13
15
|
const ref = useRef<HTMLDivElement>(null);
|
|
14
16
|
const session = useSession();
|
|
15
17
|
const locationUuid = session.sessionLocation.uuid;
|
|
@@ -33,10 +35,10 @@ const Chart: React.FC<ChartProps> = () => {
|
|
|
33
35
|
|
|
34
36
|
useEffect(() => {
|
|
35
37
|
embedDashboard({
|
|
36
|
-
id:
|
|
38
|
+
id: dashboardId,
|
|
37
39
|
supersetDomain: `${subDomainUrl}/superset`,
|
|
38
40
|
mountPoint: ref.current!,
|
|
39
|
-
fetchGuestToken: async () => await fetchGuestToken(locationUuid),
|
|
41
|
+
fetchGuestToken: async () => await fetchGuestToken(locationUuid, dashboardId),
|
|
40
42
|
dashboardUiConfig: {
|
|
41
43
|
hideTitle: true,
|
|
42
44
|
filters: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FluidDropdown, Tile } from '@carbon/react';
|
|
1
|
+
import { FluidDropdown, Tab, TabList, TabPanel, TabPanels, Tabs, Tile } from '@carbon/react';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { UserMultiple, CheckmarkFilled, Time, Hospital, Chemistry, Medication } from '@carbon/react/icons';
|
|
4
4
|
|
|
@@ -107,7 +107,26 @@ const Overview: React.FC<OverviewProps> = ({ triageCount, consultationCount, das
|
|
|
107
107
|
<h4 className={styles.text}>{dashboardSummary?.average_waiting_minutes ?? 0} mins</h4>
|
|
108
108
|
</Tile>
|
|
109
109
|
</div>
|
|
110
|
-
<
|
|
110
|
+
<div className={styles.tabsContainer}>
|
|
111
|
+
<Tabs>
|
|
112
|
+
<TabList>
|
|
113
|
+
<Tab>Daily</Tab>
|
|
114
|
+
<Tab>Weekly</Tab>
|
|
115
|
+
<Tab>Monthly</Tab>
|
|
116
|
+
</TabList>
|
|
117
|
+
<TabPanels>
|
|
118
|
+
<TabPanel>
|
|
119
|
+
<Chart dashboardId="1bdad7e2-e9a7-4cb5-886c-185f63b2eae0" />
|
|
120
|
+
</TabPanel>
|
|
121
|
+
<TabPanel>
|
|
122
|
+
<Chart dashboardId="0c59e7cd-2eba-4426-9d52-1db0866e0377" />
|
|
123
|
+
</TabPanel>
|
|
124
|
+
<TabPanel>
|
|
125
|
+
<Chart dashboardId="fe8606e8-2160-4914-860a-f5abc386d9c1" />
|
|
126
|
+
</TabPanel>
|
|
127
|
+
</TabPanels>
|
|
128
|
+
</Tabs>
|
|
129
|
+
</div>
|
|
111
130
|
</>
|
|
112
131
|
);
|
|
113
132
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
2
|
import { getEtlBaseUrl } from '../shared/utils/get-base-url';
|
|
3
3
|
|
|
4
|
-
export async function fetchGuestToken(locationUuid: string): Promise<string> {
|
|
4
|
+
export async function fetchGuestToken(locationUuid: string, dashboardId: string): Promise<string> {
|
|
5
5
|
const etlBaseUrl = await getEtlBaseUrl();
|
|
6
6
|
const supersetTokenUrl = `${etlBaseUrl}/superset-token`;
|
|
7
7
|
const params = {
|
|
8
8
|
locationUuid: locationUuid,
|
|
9
|
+
dashboardId: dashboardId,
|
|
9
10
|
};
|
|
10
11
|
const queryString = new URLSearchParams(params).toString();
|
|
11
12
|
const response = await openmrsFetch(`${supersetTokenUrl}?${queryString}`);
|