@openmrs/esm-ward-app 9.1.1-pre.6550 → 9.1.1
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/1326.js +1 -1
- package/dist/1369.js +1 -1
- package/dist/1663.js +1 -1
- package/dist/1741.js +1 -1
- package/dist/1776.js +1 -1
- package/dist/2557.js +1 -1
- package/dist/2728.js +1 -1
- package/dist/283.js +1 -1
- package/dist/3365.js +1 -1
- package/dist/3413.js +1 -1
- package/dist/3737.js +1 -1
- package/dist/3982.js +1 -1
- package/dist/5734.js +1 -1
- package/dist/5885.js +1 -1
- package/dist/6012.js +1 -1
- package/dist/7179.js +1 -1
- package/dist/7524.js +1 -1
- package/dist/7661.js +1 -1
- package/dist/7886.js +1 -1
- package/dist/8501.js +1 -1
- package/dist/8522.js +1 -1
- package/dist/89.js +1 -1
- package/dist/9045.js +1 -1
- package/dist/9117.js +1 -1
- package/dist/9294.js +1 -1
- package/dist/9775.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-ward-app.js +1 -1
- package/dist/openmrs-esm-ward-app.js.buildmanifest.json +49 -49
- package/dist/openmrs-esm-ward-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +3 -4
package/dist/5885.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[5885],{14568:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(30977),a=t.n(r),i=t(95924),o=t.n(i)()(a());o.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__maternal-ward-patient-card__motherChildBedDivider___1dB85{background-color:#fff;color:#525252;padding:.125rem;display:flex;align-items:center;justify-content:space-between}.-esm-ward__maternal-ward-patient-card__motherChildBedDividerLine___NXm0e{height:1px;width:30%;border-top:1px dashed #161616}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-view/materal-ward/maternal-ward-patient-card.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CCzDF,sEACE,qBDFM,CCGN,aDCQ,CAAA,eEIG,CDHX,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0EACE,UAAA,CACA,SAAA,CACA,6BAAA",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@openmrs/esm-styleguide/src/vars';\n@use '@carbon/type';\n\n.motherChildBedDivider {\n background-color: vars.$ui-02;\n color: vars.$text-02;\n padding: layout.$spacing-01;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.motherChildBedDividerLine {\n height: 1px;\n width: 30%;\n border-top: 1px dashed vars.$ui-05;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),o.locals={motherChildBedDivider:"-esm-ward__maternal-ward-patient-card__motherChildBedDivider___1dB85",motherChildBedDividerLine:"-esm-ward__maternal-ward-patient-card__motherChildBedDividerLine___NXm0e"};const l=o},35885:(e,n,t)=>{t.r(n),t.d(n,{default:()=>ce});var r=t(90380),a=t.n(r),i=t(83437),o=t(83773),l=t(93150);function s(e){var n,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=(n="".concat(i.restBaseUrl,"/emrapi/maternal/mothersAndChildren"),new URL((0,i.makeUrl)(n),window.location.toString())),o=e.mothers,l=e.children,s=e.requireChildBornDuringMothersActiveVisit,d=e.requireChildHasActiveVisit,c=e.requireMotherHasActiveVisit,u=!0,p=!1,m=void 0;try{for(var h,b=(null!=o?o:[])[Symbol.iterator]();!(u=(h=b.next()).done);u=!0){var g=h.value;a.searchParams.append("mother",g)}}catch(e){p=!0,m=e}finally{try{u||null==b.return||b.return()}finally{if(p)throw m}}var v,f,A,y=!0,$=!1,w=void 0;try{for(var C,E=(null!=l?l:[])[Symbol.iterator]();!(y=(C=E.next()).done);y=!0){var _=C.value;a.searchParams.append("child",_)}}catch(e){$=!0,w=e}finally{try{y||null==E.return||E.return()}finally{if($)throw w}}return a.searchParams.append("requireMotherHasActiveVisit",null!==(v=null==c?void 0:c.toString())&&void 0!==v?v:"false"),a.searchParams.append("requireChildHasActiveVisit",null!==(f=null==d?void 0:d.toString())&&void 0!==f?f:"false"),a.searchParams.append("requireChildBornDuringMothersActiveVisit",null!==(A=null==s?void 0:s.toString())&&void 0!==A?A:"false"),r&&a.searchParams.append("v",r),(0,i.useOpenmrsFetchAll)(t?a:null)}var d="custom:(childAdmission,mother:(person,identifiers:full,uuid),child:(person,identifiers:full,uuid),motherAdmission)",c=t(77493),u=t(35487),p=t(53373),m=t.n(p),h=t(90317),b=t(59198),g=t(91480),v=t(36110),f=t(97019),A=t(37538);const y=function(e){var n,t=e.id,r=e.patient,i=e.visit,o=(0,u.UG)("coloredObsTags",t),s=null!=o?o:{},d=s.conceptUuid,c=s.summaryLabel,p=s.summaryLabelColor,m=(0,b.e)({patient:r.uuid,concept:d},null!=d,g.Fx),y=m.data,$=m.isLoading,w=(0,l.useTranslation)().t,C=(0,g.uk)(null!==(n=null==o?void 0:o.tags)&&void 0!==n?n:[]);if($)return a().createElement("div",{className:A.A.wardPatientCardRow},a().createElement(v.A,null));var E,_,k=null==y?void 0:y.filter(function(e){var n;return(null===(n=e.encounter.visit)||void 0===n?void 0:n.uuid)==(null==i?void 0:i.uuid)}),B=null!=c?w(c):null==k||null===(_=k[0])||void 0===_||null===(E=_.concept)||void 0===E?void 0:E.display,x=[],P=null==k?void 0:k.map(function(e){var n=e.value,t=n.display,r=n.uuid,i=null==C?void 0:C.get(r);return i?a().createElement(f.A,{tooltipContent:(0,g.Fe)(e,w)},a().createElement(h.vwO,{type:i,key:"ward-coded-obs-tag-".concat(e.uuid)},t)):(x.push(a().createElement("div",{key:r},t," (",(0,g.Fe)(e,w),")")),null)}).filter(function(e){return null!=e});return(null==P?void 0:P.length)>0||x.length>0?a().createElement("div",{className:A.A.wardPatientCardRow},a().createElement("span",{className:A.A.wardPatientObsLabel},P,x.length>0?a().createElement(f.A,{tooltipContent:x},a().createElement(h.vwO,{type:p},w("countItems","{{count}} {{item}}",{count:x.length,item:B}))):null)):null};var $=t(85132),w=t(92182);const C=function(e){var n,t,r=e.patient,i=e.id,o=null==r||null===(n=r.person)||void 0===n?void 0:n.preferredAddress,l=(0,u.UG)("patientAddress",i);return a().createElement(a().Fragment,null,null==l||null===(t=l.fields)||void 0===t?void 0:t.map(function(e,n){return(null==o?void 0:o[e])?a().createElement("div",{key:n},null==o?void 0:o[e]):a().createElement("div",{key:n})}))};var E=t(7928),_=t(56546),k=t(83183),B=t(86901);const x=function(e){var n=e.wardPatient,t=n.patient,r=n.bed,i=n.visit,o=n.inpatientAdmission,l=(null!=o?o:{}).firstAdmissionOrTransferEncounter;return a().createElement("div",{className:m()(A.A.wardPatientCardRow,A.A.wardPatientCardHeader)},r?a().createElement(w.A,{bed:r}):null,a().createElement(_.A,{patient:t}),a().createElement(E.A,{id:"patient-identifier",patient:t}),a().createElement($.A,{patient:t}),a().createElement(C,{id:"patient-address",patient:t}),a().createElement(k.A,{id:"admission-reason",patient:t,visit:i}),a().createElement(B.A,{firstAdmissionOrTransferEncounter:l}))};var P=t(72591),O=t.n(P),N=t(1740),D=t.n(N),I=t(88128),R=t.n(I),M=t(30855),L=t.n(M),S=t(93051),T=t.n(S),q=t(73656),F=t.n(q),H=t(14568),G={};G.styleTagTransform=F(),G.setAttributes=L(),G.insert=R().bind(null,"head"),G.domAPI=D(),G.insertStyleElement=T(),O()(H.A,G);const U=H.A&&H.A.locals?H.A.locals:void 0,V=function(e){var n,t=e.inpatientAdmission,r=null==t||null===(n=t.encounterAssigningToCurrentInpatientLocation.location)||void 0===n?void 0:n.display;return r?a().createElement("div",null,a().createElement("span",null,r)):a().createElement(a().Fragment,null)};var j=t(48621),W={};W.styleTagTransform=F(),W.setAttributes=L(),W.insert=R().bind(null,"head"),W.domAPI=D(),W.insertStyleElement=T(),O()(j.A,W);const X=j.A&&j.A.locals?j.A.locals:void 0;var Y=function(e){var n=e.otherPatient,t=e.otherPatientAdmission,r=e.isOtherPatientTheMother?i.MotherIcon:i.BabyIcon;return a().createElement("div",{key:n.uuid,className:m()(X.motherOrBabyRow,A.A.wardPatientCardRow)},a().createElement("div",{className:X.motherOrBabyIconDiv},a().createElement(r,{className:X.motherOrBabyIcon,size:24})),a().createElement("div",{className:m()(X.motherOrBabyRowElementsDiv,A.A.dotSeparatedChildren)},a().createElement(_.A,{patient:n}),a().createElement(E.A,{id:"patient-identifier",patient:n}),a().createElement($.A,{patient:n}),a().createElement(V,{inpatientAdmission:t})))};const z=function(e){var n,t=e.wardPatient,r=e.childrenOfWardPatientInSameBed,o=t.patient,l=(null!==(n=(0,i.useAppContext)("maternal-ward-view-context"))&&void 0!==n?n:{}).motherChildRelationships,s=null!=l?l:{},d=s.childrenByMotherUuid,c=s.motherByChildUuid,u=null==c?void 0:c.get(o.uuid),p=null==d?void 0:d.get(o.uuid),m=null==p?void 0:p.filter(function(e){return!(null==r?void 0:r.some(function(n){return n.patient.uuid==e.patient.uuid}))});return a().createElement(a().Fragment,null,u&&a().createElement(Y,{otherPatient:u.patient,otherPatientAdmission:u.currentAdmission,isOtherPatientTheMother:!0}),null==m?void 0:m.map(function(e){return a().createElement(Y,{key:e.patient.uuid,otherPatient:e.patient,otherPatientAdmission:e.currentAdmission,isOtherPatientTheMother:!1})}))};var J=t(92058),Q=t(1248),Z=t(77);function K(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var ee=function(){var e=(0,l.useTranslation)().t;return a().createElement("div",{className:U.motherChildBedDivider},a().createElement("div",{className:U.motherChildBedDividerLine}),a().createElement(h.vwO,{type:"purple"},e("motherChildBedShare","Mother / Child")),a().createElement("div",{className:U.motherChildBedDividerLine}))};const ne=function(e){var n=e.wardPatient,t=e.childrenOfWardPatientInSameBed,r=n.patient,i=n.visit,o=n.bed,l=n.inpatientAdmission,s=(null!=l?l:{}).encounterAssigningToCurrentInpatientLocation,d=a().createElement(a().Fragment,null,a().createElement(Q.A,{wardPatient:n},a().createElement(x,{wardPatient:n}),a().createElement("div",{className:m()(A.A.wardPatientCardRow,A.A.dotSeparatedChildren)},a().createElement(Z.A,{encounterAssigningToCurrentInpatientLocation:s}),a().createElement(k.A,{id:"gravida",patient:r,visit:i})),a().createElement(J.A,{id:"pending-items",wardPatient:n}),a().createElement(y,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){K(e,n,t[n])})}return e}({id:"pregnancy-complications"},n)),a().createElement(z,e)),null==t?void 0:t.map(function(e){return a().createElement(a().Fragment,{key:e.patient.uuid},a().createElement(ee,null),a().createElement(Q.A,{wardPatient:e},a().createElement(x,{wardPatient:e}),a().createElement(J.A,{id:"pending-items",wardPatient:e})))}));return o?d:a().createElement("div",{className:A.A.unassignedPatient},a().createElement("div",{key:"unassigned-bed-pt-"+n.patient.uuid},d))},te=function(e){var n,t=null!=e?e:{},r=t.motherByChildUuid,o=t.isLoading,l=(null!==(n=(0,i.useAppContext)("ward-view-context"))&&void 0!==n?n:{}).wardPatientGroupDetails,s=null!=l?l:{},d=s.bedLayouts,p=s.wardAdmittedPatientsWithBed,m=null==d?void 0:d.map(function(e){var n=e.patients,t=(0,u.yZ)(e),i=new Map,l=n.map(function(e){var n=null==p?void 0:p.get(e.uuid);if(n){var r=n.patient,a=n.visit,i=n.currentInpatientRequest;return{patient:r,visit:a,bed:t,inpatientAdmission:n,inpatientRequest:i||null}}return{patient:e,visit:null,bed:t,inpatientAdmission:null,inpatientRequest:null}}).filter(function(e){var t,a=e.patient.uuid,o=(null!==(t=null==r?void 0:r.get(a))&&void 0!==t?t:{}).patient,l=n.some(function(e){return e.uuid==(null==o?void 0:o.uuid)});return l&&(i.has(o.uuid)||i.set(o.uuid,[]),i.get(o.uuid).push(e)),!l}).map(function(e){return a().createElement(ne,{key:e.patient.uuid,wardPatient:e,childrenOfWardPatientInSameBed:i.get(e.patient.uuid)})});return a().createElement(c.A,{key:t.uuid,bed:t,patientCards:l,isLoadingDivider:o})});return a().createElement(a().Fragment,null,m)};var re=t(18359),ae=t(60607);function ie(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}const oe=function(){var e,n=(null!==(e=(0,i.useAppContext)("ward-view-context"))&&void 0!==e?e:{}).wardPatientGroupDetails,t=(0,l.useTranslation)().t,r=(null!=n?n:{}).inpatientRequestResponse,o=null!=r?r:{},s=o.inpatientRequests,d=o.isLoading,c=o.error;return d?a().createElement(v.A,null):c?a().createElement(i.ErrorState,{headerTitle:t("admissionRequests","Admission requests"),error:c}):a().createElement(a().Fragment,null,null==s?void 0:s.map(function(e,n){var t={patient:e.patient,visit:e.visit,bed:null,inpatientRequest:e,inpatientAdmission:null};return a().createElement(ae.A,{key:"admission-request-card-".concat(n),wardPatient:t},a().createElement(y,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ie(e,n,t[n])})}return e}({id:"pregnancy-complications"},t)),a().createElement(z,{wardPatient:t,childrenOfWardPatientInSameBed:[]}),a().createElement(re.A,{id:"admission-request-note",wardPatient:t}))}))},le=function(){var e,n=(null!==(e=(0,i.useAppContext)("ward-view-context"))&&void 0!==e?e:{}).wardPatientGroupDetails,t=(null!=n?n:{}).wardUnassignedPatientsList,r=null==t?void 0:t.map(function(e){return a().createElement(ne,{wardPatient:{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:e,inpatientRequest:e.currentInpatientRequest},childrenOfWardPatientInSameBed:[],key:e.patient.uuid})});return a().createElement(a().Fragment,null,r)};var se=t(75546),de=t(18010);const ce=function(){var e=(0,o.u)();(0,i.useDefineAppContext)("ward-view-context",{wardPatientGroupDetails:e,WardPatientHeader:x});var n=e.allWardPatientUuids,t=e.isLoading,c=function(e,n){var t=(0,l.useTranslation)().t,a={children:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!0},o=s({mothers:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!0},n&&e.length>0,d),c=o.data,u=o.isLoading,p=o.error,m=s(a,n&&e.length>0,d),h=m.data,b=m.isLoading,g=m.error;return p&&(0,i.showNotification)({title:t("errorLoadingChildren","Error loading children info"),kind:"error",critical:!0,description:null==p?void 0:p.message}),g&&(0,i.showNotification)({title:t("errorLoadingMother","Error loading mother info"),kind:"error",critical:!0,description:null==g?void 0:g.message}),(0,r.useMemo)(function(){var e=new Map,n=new Map,t=u||b,r=!0,a=!1,i=void 0;try{for(var o,l=(null!=h?h:[])[Symbol.iterator]();!(r=(o=l.next()).done);r=!0){var s=o.value,d=s.child,p=s.childAdmission,m=s.mother,g=s.motherAdmission;e.set(d.uuid,{patient:m,currentAdmission:g}),n.has(m.uuid)||n.set(m.uuid,[]),n.get(m.uuid).push({patient:d,currentAdmission:p})}}catch(e){a=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw i}}var v=!0,f=!1,A=void 0;try{for(var y,$=function(){var t=y.value,r=t.child,a=t.childAdmission,i=t.mother,o=t.motherAdmission;e.set(r.uuid,{patient:i,currentAdmission:o}),n.has(i.uuid)||n.set(i.uuid,[]);var l=n.get(i.uuid);l.some(function(e){return e.patient.uuid==r.uuid})||l.push({patient:r,currentAdmission:a})},w=(null!=c?c:[])[Symbol.iterator]();!(v=(y=w.next()).done);v=!0)$()}catch(e){f=!0,A=e}finally{try{v||null==w.return||w.return()}finally{if(f)throw A}}return{motherByChildUuid:e,childrenByMotherUuid:n,isLoading:t}},[c,h,u,b])}(Array.from(n),!t);(0,i.useDefineAppContext)("maternal-ward-view-context",{motherChildRelationships:c});var u=a().createElement(te,c),p=a().createElement(le,null),m=a().createElement(oe,null);return a().createElement(a().Fragment,null,a().createElement(de.A,{wardPendingPatients:m}),a().createElement(se.A,{wardBeds:u,wardUnassignedPatients:p}))}},48621:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(30977),a=t.n(r),i=t(95924),o=t.n(i)()(a());o.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__mother-child-row__motherOrBabyRow___9fHo5{display:flex}.-esm-ward__mother-child-row__motherOrBabyRowElementsDiv___bHVH7{flex:1}.-esm-ward__mother-child-row__motherOrBabyIconDiv___mENJC{display:flex;align-items:center}.-esm-ward__mother-child-row__motherOrBabyIcon___8SN9a{padding:.25rem;border-radius:50%;background-color:#e0e0e0;margin-right:.5rem}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-patient-card/card-rows/mother-child-row.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DF,sDACE,YAAA,CAGF,iEACE,MAAA,CAGF,0DACE,YAAA,CACA,kBAAA,CAGF,uDACE,cCDW,CDEX,iBAAA,CACA,wBDMO,CCLP,kBCCW",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.motherOrBabyRow {\n display: flex;\n}\n\n.motherOrBabyRowElementsDiv {\n flex: 1;\n}\n\n.motherOrBabyIconDiv {\n display: flex;\n align-items: center;\n}\n\n.motherOrBabyIcon {\n padding: layout.$spacing-02;\n border-radius: 50%;\n background-color: $grey-2;\n margin-right: layout.$spacing-03;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),o.locals={motherOrBabyRow:"-esm-ward__mother-child-row__motherOrBabyRow___9fHo5",motherOrBabyRowElementsDiv:"-esm-ward__mother-child-row__motherOrBabyRowElementsDiv___bHVH7",motherOrBabyIconDiv:"-esm-ward__mother-child-row__motherOrBabyIconDiv___mENJC",motherOrBabyIcon:"-esm-ward__mother-child-row__motherOrBabyIcon___8SN9a"};const l=o}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[5885],{14568:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(30977),a=t.n(r),i=t(95924),o=t.n(i)()(a());o.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__maternal-ward-patient-card__motherChildBedDivider___1dB85{background-color:#fff;color:#525252;padding:.125rem;display:flex;align-items:center;justify-content:space-between}.-esm-ward__maternal-ward-patient-card__motherChildBedDividerLine___NXm0e{height:1px;width:30%;border-top:1px dashed #161616}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-view/materal-ward/maternal-ward-patient-card.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CCzDF,sEACE,qBDFM,CCGN,aDCQ,CAAA,eEIG,CDHX,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0EACE,UAAA,CACA,SAAA,CACA,6BAAA",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@openmrs/esm-styleguide/src/vars';\n@use '@carbon/type';\n\n.motherChildBedDivider {\n background-color: vars.$ui-02;\n color: vars.$text-02;\n padding: layout.$spacing-01;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.motherChildBedDividerLine {\n height: 1px;\n width: 30%;\n border-top: 1px dashed vars.$ui-05;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),o.locals={motherChildBedDivider:"-esm-ward__maternal-ward-patient-card__motherChildBedDivider___1dB85",motherChildBedDividerLine:"-esm-ward__maternal-ward-patient-card__motherChildBedDividerLine___NXm0e"};const l=o},35885:(e,n,t)=>{t.r(n),t.d(n,{default:()=>ce});var r=t(90380),a=t.n(r),i=t(54440),o=t(83773),l=t(93150);function s(e){var n,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=(n="".concat(i.restBaseUrl,"/emrapi/maternal/mothersAndChildren"),new URL((0,i.makeUrl)(n),window.location.toString())),o=e.mothers,l=e.children,s=e.requireChildBornDuringMothersActiveVisit,d=e.requireChildHasActiveVisit,c=e.requireMotherHasActiveVisit,u=!0,p=!1,m=void 0;try{for(var h,b=(null!=o?o:[])[Symbol.iterator]();!(u=(h=b.next()).done);u=!0){var g=h.value;a.searchParams.append("mother",g)}}catch(e){p=!0,m=e}finally{try{u||null==b.return||b.return()}finally{if(p)throw m}}var v,f,A,y=!0,$=!1,w=void 0;try{for(var C,E=(null!=l?l:[])[Symbol.iterator]();!(y=(C=E.next()).done);y=!0){var _=C.value;a.searchParams.append("child",_)}}catch(e){$=!0,w=e}finally{try{y||null==E.return||E.return()}finally{if($)throw w}}return a.searchParams.append("requireMotherHasActiveVisit",null!==(v=null==c?void 0:c.toString())&&void 0!==v?v:"false"),a.searchParams.append("requireChildHasActiveVisit",null!==(f=null==d?void 0:d.toString())&&void 0!==f?f:"false"),a.searchParams.append("requireChildBornDuringMothersActiveVisit",null!==(A=null==s?void 0:s.toString())&&void 0!==A?A:"false"),r&&a.searchParams.append("v",r),(0,i.useOpenmrsFetchAll)(t?a:null)}var d="custom:(childAdmission,mother:(person,identifiers:full,uuid),child:(person,identifiers:full,uuid),motherAdmission)",c=t(77493),u=t(35487),p=t(53373),m=t.n(p),h=t(90317),b=t(59198),g=t(91480),v=t(36110),f=t(97019),A=t(37538);const y=function(e){var n,t=e.id,r=e.patient,i=e.visit,o=(0,u.UG)("coloredObsTags",t),s=null!=o?o:{},d=s.conceptUuid,c=s.summaryLabel,p=s.summaryLabelColor,m=(0,b.e)({patient:r.uuid,concept:d},null!=d,g.Fx),y=m.data,$=m.isLoading,w=(0,l.useTranslation)().t,C=(0,g.uk)(null!==(n=null==o?void 0:o.tags)&&void 0!==n?n:[]);if($)return a().createElement("div",{className:A.A.wardPatientCardRow},a().createElement(v.A,null));var E,_,k=null==y?void 0:y.filter(function(e){var n;return(null===(n=e.encounter.visit)||void 0===n?void 0:n.uuid)==(null==i?void 0:i.uuid)}),B=null!=c?w(c):null==k||null===(_=k[0])||void 0===_||null===(E=_.concept)||void 0===E?void 0:E.display,x=[],P=null==k?void 0:k.map(function(e){var n=e.value,t=n.display,r=n.uuid,i=null==C?void 0:C.get(r);return i?a().createElement(f.A,{tooltipContent:(0,g.Fe)(e,w)},a().createElement(h.vwO,{type:i,key:"ward-coded-obs-tag-".concat(e.uuid)},t)):(x.push(a().createElement("div",{key:r},t," (",(0,g.Fe)(e,w),")")),null)}).filter(function(e){return null!=e});return(null==P?void 0:P.length)>0||x.length>0?a().createElement("div",{className:A.A.wardPatientCardRow},a().createElement("span",{className:A.A.wardPatientObsLabel},P,x.length>0?a().createElement(f.A,{tooltipContent:x},a().createElement(h.vwO,{type:p},w("countItems","{{count}} {{item}}",{count:x.length,item:B}))):null)):null};var $=t(85132),w=t(92182);const C=function(e){var n,t,r=e.patient,i=e.id,o=null==r||null===(n=r.person)||void 0===n?void 0:n.preferredAddress,l=(0,u.UG)("patientAddress",i);return a().createElement(a().Fragment,null,null==l||null===(t=l.fields)||void 0===t?void 0:t.map(function(e,n){return(null==o?void 0:o[e])?a().createElement("div",{key:n},null==o?void 0:o[e]):a().createElement("div",{key:n})}))};var E=t(7928),_=t(56546),k=t(83183),B=t(86901);const x=function(e){var n=e.wardPatient,t=n.patient,r=n.bed,i=n.visit,o=n.inpatientAdmission,l=(null!=o?o:{}).firstAdmissionOrTransferEncounter;return a().createElement("div",{className:m()(A.A.wardPatientCardRow,A.A.wardPatientCardHeader)},r?a().createElement(w.A,{bed:r}):null,a().createElement(_.A,{patient:t}),a().createElement(E.A,{id:"patient-identifier",patient:t}),a().createElement($.A,{patient:t}),a().createElement(C,{id:"patient-address",patient:t}),a().createElement(k.A,{id:"admission-reason",patient:t,visit:i}),a().createElement(B.A,{firstAdmissionOrTransferEncounter:l}))};var P=t(72591),O=t.n(P),N=t(1740),D=t.n(N),I=t(88128),R=t.n(I),M=t(30855),L=t.n(M),S=t(93051),T=t.n(S),q=t(73656),F=t.n(q),H=t(14568),G={};G.styleTagTransform=F(),G.setAttributes=L(),G.insert=R().bind(null,"head"),G.domAPI=D(),G.insertStyleElement=T(),O()(H.A,G);const U=H.A&&H.A.locals?H.A.locals:void 0,V=function(e){var n,t=e.inpatientAdmission,r=null==t||null===(n=t.encounterAssigningToCurrentInpatientLocation.location)||void 0===n?void 0:n.display;return r?a().createElement("div",null,a().createElement("span",null,r)):a().createElement(a().Fragment,null)};var j=t(48621),W={};W.styleTagTransform=F(),W.setAttributes=L(),W.insert=R().bind(null,"head"),W.domAPI=D(),W.insertStyleElement=T(),O()(j.A,W);const X=j.A&&j.A.locals?j.A.locals:void 0;var Y=function(e){var n=e.otherPatient,t=e.otherPatientAdmission,r=e.isOtherPatientTheMother?i.MotherIcon:i.BabyIcon;return a().createElement("div",{key:n.uuid,className:m()(X.motherOrBabyRow,A.A.wardPatientCardRow)},a().createElement("div",{className:X.motherOrBabyIconDiv},a().createElement(r,{className:X.motherOrBabyIcon,size:24})),a().createElement("div",{className:m()(X.motherOrBabyRowElementsDiv,A.A.dotSeparatedChildren)},a().createElement(_.A,{patient:n}),a().createElement(E.A,{id:"patient-identifier",patient:n}),a().createElement($.A,{patient:n}),a().createElement(V,{inpatientAdmission:t})))};const z=function(e){var n,t=e.wardPatient,r=e.childrenOfWardPatientInSameBed,o=t.patient,l=(null!==(n=(0,i.useAppContext)("maternal-ward-view-context"))&&void 0!==n?n:{}).motherChildRelationships,s=null!=l?l:{},d=s.childrenByMotherUuid,c=s.motherByChildUuid,u=null==c?void 0:c.get(o.uuid),p=null==d?void 0:d.get(o.uuid),m=null==p?void 0:p.filter(function(e){return!(null==r?void 0:r.some(function(n){return n.patient.uuid==e.patient.uuid}))});return a().createElement(a().Fragment,null,u&&a().createElement(Y,{otherPatient:u.patient,otherPatientAdmission:u.currentAdmission,isOtherPatientTheMother:!0}),null==m?void 0:m.map(function(e){return a().createElement(Y,{key:e.patient.uuid,otherPatient:e.patient,otherPatientAdmission:e.currentAdmission,isOtherPatientTheMother:!1})}))};var J=t(92058),Q=t(1248),Z=t(77);function K(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var ee=function(){var e=(0,l.useTranslation)().t;return a().createElement("div",{className:U.motherChildBedDivider},a().createElement("div",{className:U.motherChildBedDividerLine}),a().createElement(h.vwO,{type:"purple"},e("motherChildBedShare","Mother / Child")),a().createElement("div",{className:U.motherChildBedDividerLine}))};const ne=function(e){var n=e.wardPatient,t=e.childrenOfWardPatientInSameBed,r=n.patient,i=n.visit,o=n.bed,l=n.inpatientAdmission,s=(null!=l?l:{}).encounterAssigningToCurrentInpatientLocation,d=a().createElement(a().Fragment,null,a().createElement(Q.A,{wardPatient:n},a().createElement(x,{wardPatient:n}),a().createElement("div",{className:m()(A.A.wardPatientCardRow,A.A.dotSeparatedChildren)},a().createElement(Z.A,{encounterAssigningToCurrentInpatientLocation:s}),a().createElement(k.A,{id:"gravida",patient:r,visit:i})),a().createElement(J.A,{id:"pending-items",wardPatient:n}),a().createElement(y,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){K(e,n,t[n])})}return e}({id:"pregnancy-complications"},n)),a().createElement(z,e)),null==t?void 0:t.map(function(e){return a().createElement(a().Fragment,{key:e.patient.uuid},a().createElement(ee,null),a().createElement(Q.A,{wardPatient:e},a().createElement(x,{wardPatient:e}),a().createElement(J.A,{id:"pending-items",wardPatient:e})))}));return o?d:a().createElement("div",{className:A.A.unassignedPatient},a().createElement("div",{key:"unassigned-bed-pt-"+n.patient.uuid},d))},te=function(e){var n,t=null!=e?e:{},r=t.motherByChildUuid,o=t.isLoading,l=(null!==(n=(0,i.useAppContext)("ward-view-context"))&&void 0!==n?n:{}).wardPatientGroupDetails,s=null!=l?l:{},d=s.bedLayouts,p=s.wardAdmittedPatientsWithBed,m=null==d?void 0:d.map(function(e){var n=e.patients,t=(0,u.yZ)(e),i=new Map,l=n.map(function(e){var n=null==p?void 0:p.get(e.uuid);if(n){var r=n.patient,a=n.visit,i=n.currentInpatientRequest;return{patient:r,visit:a,bed:t,inpatientAdmission:n,inpatientRequest:i||null}}return{patient:e,visit:null,bed:t,inpatientAdmission:null,inpatientRequest:null}}).filter(function(e){var t,a=e.patient.uuid,o=(null!==(t=null==r?void 0:r.get(a))&&void 0!==t?t:{}).patient,l=n.some(function(e){return e.uuid==(null==o?void 0:o.uuid)});return l&&(i.has(o.uuid)||i.set(o.uuid,[]),i.get(o.uuid).push(e)),!l}).map(function(e){return a().createElement(ne,{key:e.patient.uuid,wardPatient:e,childrenOfWardPatientInSameBed:i.get(e.patient.uuid)})});return a().createElement(c.A,{key:t.uuid,bed:t,patientCards:l,isLoadingDivider:o})});return a().createElement(a().Fragment,null,m)};var re=t(18359),ae=t(60607);function ie(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}const oe=function(){var e,n=(null!==(e=(0,i.useAppContext)("ward-view-context"))&&void 0!==e?e:{}).wardPatientGroupDetails,t=(0,l.useTranslation)().t,r=(null!=n?n:{}).inpatientRequestResponse,o=null!=r?r:{},s=o.inpatientRequests,d=o.isLoading,c=o.error;return d?a().createElement(v.A,null):c?a().createElement(i.ErrorState,{headerTitle:t("admissionRequests","Admission requests"),error:c}):a().createElement(a().Fragment,null,null==s?void 0:s.map(function(e,n){var t={patient:e.patient,visit:e.visit,bed:null,inpatientRequest:e,inpatientAdmission:null};return a().createElement(ae.A,{key:"admission-request-card-".concat(n),wardPatient:t},a().createElement(y,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ie(e,n,t[n])})}return e}({id:"pregnancy-complications"},t)),a().createElement(z,{wardPatient:t,childrenOfWardPatientInSameBed:[]}),a().createElement(re.A,{id:"admission-request-note",wardPatient:t}))}))},le=function(){var e,n=(null!==(e=(0,i.useAppContext)("ward-view-context"))&&void 0!==e?e:{}).wardPatientGroupDetails,t=(null!=n?n:{}).wardUnassignedPatientsList,r=null==t?void 0:t.map(function(e){return a().createElement(ne,{wardPatient:{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:e,inpatientRequest:e.currentInpatientRequest},childrenOfWardPatientInSameBed:[],key:e.patient.uuid})});return a().createElement(a().Fragment,null,r)};var se=t(75546),de=t(18010);const ce=function(){var e=(0,o.u)();(0,i.useDefineAppContext)("ward-view-context",{wardPatientGroupDetails:e,WardPatientHeader:x});var n=e.allWardPatientUuids,t=e.isLoading,c=function(e,n){var t=(0,l.useTranslation)().t,a={children:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!0},o=s({mothers:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!0},n&&e.length>0,d),c=o.data,u=o.isLoading,p=o.error,m=s(a,n&&e.length>0,d),h=m.data,b=m.isLoading,g=m.error;return p&&(0,i.showNotification)({title:t("errorLoadingChildren","Error loading children info"),kind:"error",critical:!0,description:null==p?void 0:p.message}),g&&(0,i.showNotification)({title:t("errorLoadingMother","Error loading mother info"),kind:"error",critical:!0,description:null==g?void 0:g.message}),(0,r.useMemo)(function(){var e=new Map,n=new Map,t=u||b,r=!0,a=!1,i=void 0;try{for(var o,l=(null!=h?h:[])[Symbol.iterator]();!(r=(o=l.next()).done);r=!0){var s=o.value,d=s.child,p=s.childAdmission,m=s.mother,g=s.motherAdmission;e.set(d.uuid,{patient:m,currentAdmission:g}),n.has(m.uuid)||n.set(m.uuid,[]),n.get(m.uuid).push({patient:d,currentAdmission:p})}}catch(e){a=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw i}}var v=!0,f=!1,A=void 0;try{for(var y,$=function(){var t=y.value,r=t.child,a=t.childAdmission,i=t.mother,o=t.motherAdmission;e.set(r.uuid,{patient:i,currentAdmission:o}),n.has(i.uuid)||n.set(i.uuid,[]);var l=n.get(i.uuid);l.some(function(e){return e.patient.uuid==r.uuid})||l.push({patient:r,currentAdmission:a})},w=(null!=c?c:[])[Symbol.iterator]();!(v=(y=w.next()).done);v=!0)$()}catch(e){f=!0,A=e}finally{try{v||null==w.return||w.return()}finally{if(f)throw A}}return{motherByChildUuid:e,childrenByMotherUuid:n,isLoading:t}},[c,h,u,b])}(Array.from(n),!t);(0,i.useDefineAppContext)("maternal-ward-view-context",{motherChildRelationships:c});var u=a().createElement(te,c),p=a().createElement(le,null),m=a().createElement(oe,null);return a().createElement(a().Fragment,null,a().createElement(de.A,{wardPendingPatients:m}),a().createElement(se.A,{wardBeds:u,wardUnassignedPatients:p}))}},48621:(e,n,t)=>{t.d(n,{A:()=>l});var r=t(30977),a=t.n(r),i=t(95924),o=t.n(i)()(a());o.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__mother-child-row__motherOrBabyRow___9fHo5{display:flex}.-esm-ward__mother-child-row__motherOrBabyRowElementsDiv___bHVH7{flex:1}.-esm-ward__mother-child-row__motherOrBabyIconDiv___mENJC{display:flex;align-items:center}.-esm-ward__mother-child-row__motherOrBabyIcon___8SN9a{padding:.25rem;border-radius:50%;background-color:#e0e0e0;margin-right:.5rem}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-patient-card/card-rows/mother-child-row.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DF,sDACE,YAAA,CAGF,iEACE,MAAA,CAGF,0DACE,YAAA,CACA,kBAAA,CAGF,uDACE,cCDW,CDEX,iBAAA,CACA,wBDMO,CCLP,kBCCW",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.motherOrBabyRow {\n display: flex;\n}\n\n.motherOrBabyRowElementsDiv {\n flex: 1;\n}\n\n.motherOrBabyIconDiv {\n display: flex;\n align-items: center;\n}\n\n.motherOrBabyIcon {\n padding: layout.$spacing-02;\n border-radius: 50%;\n background-color: $grey-2;\n margin-right: layout.$spacing-03;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),o.locals={motherOrBabyRow:"-esm-ward__mother-child-row__motherOrBabyRow___9fHo5",motherOrBabyRowElementsDiv:"-esm-ward__mother-child-row__motherOrBabyRowElementsDiv___bHVH7",motherOrBabyIconDiv:"-esm-ward__mother-child-row__motherOrBabyIconDiv___mENJC",motherOrBabyIcon:"-esm-ward__mother-child-row__motherOrBabyIcon___8SN9a"};const l=o}}]);
|
package/dist/6012.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 6012.js.LICENSE.txt */
|
|
2
|
-
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[3373,6012],{11340:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var i="@openmrs/esm-ward-app"},16012:(e,t,n)=>{"use strict";n.r(t),n.d(t,{admissionRequestWorkspace:()=>A,admissionRequestsWorkspaceSideRailIcon:()=>R,admitPatientFormWorkspace:()=>b,cancelAdmissionRequestWorkspace:()=>U,clinicalFormWorkspaceSideRailIcon:()=>O,createAdmissionEncounterWorkspace:()=>q,createAdmissionEncounterWorkspaceSideRailIcon:()=>W,defaultWardView:()=>D,importTranslation:()=>y,maternalWardView:()=>N,patientClinicalFormsWorkspace:()=>P,patientDischargeWorkspace:()=>I,patientDischargeWorkspaceSideRailIcon:()=>C,patientTransferAndSwapWorkspace:()=>j,patientTransferAndSwapWorkspaceSiderailIcon:()=>L,patientTransferRequestWorkspace:()=>S,root:()=>m,startupApp:()=>E,wardDashboardLink:()=>_,wardPatientActionButtonExtension:()=>v,wardPatientNotesActionButtonExtension:()=>k,wardPatientNotesWorkspace:()=>T,wardPatientWorkspace:()=>w,wardPatientWorkspaceBanner:()=>B,wardView:()=>g});var i=n(83437),r={patientCardElements:{_description:"Configuration of various patient card elements. Each configured element must have a unique id, defined in the ward React component being used.",obs:{_type:i.Type.Array,_default:[],_description:"Configures obs values to display.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:i.Type.UUID,_description:"Identifies the concept to use to identify the desired observations."},label:{_type:i.Type.String,_default:"",_description:"Optional. The custom label or i18n key to the translated label to display. If not provided, defaults to the concept's name. (Note that this can be set to an empty string to not show a label)"},orderBy:{_type:i.Type.String,_default:"descending",_description:"One of 'ascending' or 'descending', specifying whether to display the obs by obsDatetime ascendingly or descendingly.",_validators:[i.validators.oneOf(["ascending","descending"])]},limit:{_type:i.Type.Number,_default:1,_description:"If set to a number greater than one, this will show multiple obs for this concept, which will appear as a list. Set to 0 for unlimited."},onlyWithinCurrentVisit:{_type:i.Type.Boolean,_default:!1,_description:"Optional. If true, limits display to only observations within current visit. Defaults to false"}}},pendingItems:{_type:i.Type.Array,_default:[{id:"pending-items",orders:{orderTypes:[{label:"Labs",uuid:"52a447d3-a64a-11e3-9aeb-50e549534c5e"}]},showPendingItems:!0}],_description:"Configures pending orders and transfers to display.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},orders:{orderTypes:{_type:i.Type.Array,_description:"Configures pending orders and transfers to display.",_elements:{uuid:{_type:i.Type.UUID,_description:"Identifies the order type."},label:{_type:i.Type.String,_default:"",_description:"The label or i18n key to the translated label to display. If not provided, defaults to 'Orders'"}}}},showPendingItems:{_type:i.Type.Boolean,_description:"Optional. If true, pending items (e.g., number of pending orders) will be displayed on the patient card."}}},patientIdentifier:{_type:i.Type.Array,_default:[{id:"patient-identifier",showIdentifierLabel:!1}],_description:"Configures patient identifier to display. An unconfigured element displays the preferred identifier.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},showIdentifierLabel:{_type:i.Type.Boolean,_description:'If true, the identifier type (eg: "OpenMRS ID") is shown along with the identifier itself. Defaults to false'}}},patientAddress:{_type:i.Type.Array,_default:[{id:"patient-address",fields:["cityVillage","country"]}],_description:"Configures patient address elements.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},fields:{_type:i.Type.Array,_description:"The fields of the address to display",_elements:{_type:i.Type.String,_validators:[i.validators.oneOf(["cityVillage","stateProvince","country","postalCode","countyDistrict","latitude","longitude","address1","address2","address3","address4","address5","address6","address7","address8","address9","address10","address11","address12","address13","address14","address15"])]}}}},admissionRequestNote:{_type:i.Type.Array,_default:[{id:"admission-request-note",conceptUuid:"161011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}],_description:"Configures admission request notes to display.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:i.Type.UUID,_description:"Required. Identifies the concept for the admission request note."}}},coloredObsTags:{_type:i.Type.Array,_default:[],_description:"Configures observation values to display as Carbon tags.",_elements:{conceptUuid:{_type:i.Type.UUID,_default:"1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",_description:"Required. Identifies the concept to use to identify the desired observations."},summaryLabel:{_type:i.Type.String,_default:"",_description:"Optional. The custom label or i18n key to the translated label to display for the summary tag. The summary tag shows the count of the number of answers that are present but not configured to show as their own tags. If not provided, defaults to the name of the concept."},summaryLabelI18nModule:{_type:i.Type.String,_default:"",_description:"Optional. The custom module to use for translation of the summary label"},summaryLabelColor:{_type:i.Type.String,_default:"",_description:"The color of the summary tag. See https://react.carbondesignsystem.com/?path=/docs/components-tag--overview for a list of supported colors"},tags:{_type:i.Type.Array,_default:[],_description:"An array specifying concept sets and color. Observations with coded values that are members of the specified concept sets will be displayed as their own tags with the specified color. Any observation with coded values not belonging to any concept sets specified will be summarized as a count in the summary tag. If a concept set is listed multiple times, the first matching applied-to rule takes precedence.",_elements:{color:{_type:i.Type.String,_description:"Color of the tag. See https://react.carbondesignsystem.com/?path=/docs/components-tag--overview for a list of supported colors."},appliedToConceptSets:{_type:i.Type.Array,_description:"The concept sets which the color applies to. Observations with coded values that are members of the specified concept sets will be displayed as their own tag with the specified color. If an observation's coded value belongs to multiple concept sets, the first matching applied-to rule takes precedence.",_elements:{_type:i.Type.UUID}}}}}}},wards:{_type:i.Type.Array,_default:[{id:"default-ward"}],_description:"Configuration of what type of ward to use at different ward locations.",_elements:{id:{_type:i.Type.String,_description:'The ward type to use. Currently, "default-ward" and "maternal-ward" are supported. This string also serves as the extension slot name for the ward view.'},appliedTo:{_type:i.Type.Array,_description:"Optional. Conditions under which this card definition should be used. If not provided, the configuration is applied to all wards.",_elements:{location:{_type:i.Type.UUID,_default:"",_description:"The UUID of the location. If not provided, applies to all wards."}}}}},hideWorkspaceVitalsLinks:{_type:i.Type.Boolean,_default:!1,_description:"Configure whether to hide vital history and record vital links in the ward patient workspace."}},s=n(11340),o=n(90380),a=n.n(o),d=n(53373),c=n.n(d),l=n(8877),p=n(93150);function u(e){var t=e.dashboardLinkConfig,n=(0,p.useTranslation)().t,r=t.name,s=t.title,d=(0,l.useLocation)(),u="".concat(window.spaBase,"/home"),f=(0,o.useMemo)(function(){var e=d.pathname.split("/home"),t=e[e.length-1];return decodeURIComponent(t)},[d.pathname]);return a().createElement(i.ConfigurableLink,{className:c()("cds--side-nav__link",{"active-left-nav-link":f.match(r)}),to:"".concat(u,"/").concat(r)},n(s))}var f,y=n(84767),h={featureName:"ward",moduleName:s.A},m=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(9775)]).then(n.bind(n,99775))},h),_=(0,i.getSyncLifecycle)((f={name:"ward",title:"wards"},function(){return a().createElement(l.BrowserRouter,null,a().createElement(u,{dashboardLinkConfig:f}))}),h),g=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(7524)]).then(n.bind(n,27524))},h),A=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(3737)]).then(n.bind(n,23737))},h),b=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(5434),n.e(2728)]).then(n.bind(n,12728))},h),w=(0,i.getAsyncLifecycle)(function(){return n.e(8501).then(n.bind(n,88501))},h),T=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(9045)]).then(n.bind(n,49045))},h),v=(0,i.getAsyncLifecycle)(function(){return n.e(89).then(n.bind(n,20089))},h),k=(0,i.getAsyncLifecycle)(function(){return n.e(7886).then(n.bind(n,57886))},h),j=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(7661),n.e(3365)]).then(n.bind(n,23365))},h),I=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(283)]).then(n.bind(n,80283))},h),L=(0,i.getAsyncLifecycle)(function(){return n.e(3413).then(n.bind(n,23413))},h),S=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(7661),n.e(2948)]).then(n.bind(n,12948))},h),C=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(8622),n.e(3982)]).then(n.bind(n,33982))},h),P=(0,i.getAsyncLifecycle)(function(){return n.e(1663).then(n.bind(n,71663))},h),U=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(2557)]).then(n.bind(n,2557))},h),O=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(1899),n.e(1741)]).then(n.bind(n,71741))},h),R=(0,i.getAsyncLifecycle)(function(){return n.e(8522).then(n.bind(n,48522))},h),W=(0,i.getAsyncLifecycle)(function(){return n.e(9117).then(n.bind(n,59117))},h),q=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(5434),n.e(7179)]).then(n.bind(n,27179))},h),D=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(1369),n.e(9294),n.e(8010),n.e(5434),n.e(8394),n.e(5734),n.e(1326)]).then(n.bind(n,61326))},{featureName:"default-ward-view",moduleName:s.A,swrConfig:{refreshInterval:6e4}}),N=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(1369),n.e(9294),n.e(8010),n.e(5434),n.e(8394),n.e(5734),n.e(5885)]).then(n.bind(n,35885))},{featureName:"maternal-ward-view",moduleName:s.A,swrConfig:{refreshInterval:6e4}}),B=(0,i.getAsyncLifecycle)(function(){return n.e(1776).then(n.bind(n,81776))},h);function E(){(0,i.registerBreadcrumbs)([]),(0,i.defineConfigSchema)(s.A,r),(0,i.registerFeatureFlag)("bedmanagement-module","Bed management module","Enables features related to bed management / assignment. Requires the backend bed management module to be installed.")}},53373:(e,t)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,s(n)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)i.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},84767:(e,t,n)=>{var i={"./am.json":[81197,1197],"./ar.json":[14132,4132],"./ar_SY.json":[37617,7617],"./bn.json":[77159,7159],"./de.json":[34944,4944],"./en.json":[34300,4300],"./en_US.json":[59569,9569],"./es.json":[93099,3099],"./es_MX.json":[88349,8349],"./fr.json":[94055,4055],"./he.json":[84652,4652],"./hi.json":[36840,6840],"./hi_IN.json":[55442,5442],"./id.json":[72690,2690],"./it.json":[9538,9538],"./ka.json":[70795,795],"./km.json":[54335,4335],"./ku.json":[9895,9895],"./ky.json":[88163,8163],"./lg.json":[64618,4618],"./ne.json":[12146,2146],"./pl.json":[41119,1119],"./pt.json":[96679,6679],"./pt_BR.json":[36468,6468],"./qu.json":[35173,5173],"./ro_RO.json":[46022,6022],"./ru_RU.json":[60986,986],"./si.json":[56859,6859],"./sw.json":[89913,9913],"./sw_KE.json":[88618,8618],"./tr.json":[55241,5241],"./tr_TR.json":[99900,9900],"./uk.json":[60723,723],"./uz.json":[43584,3584],"./uz@Latn.json":[27097,7097],"./uz_UZ.json":[70890,890],"./vi.json":[79214,9214],"./zh.json":[35661,5661],"./zh_CN.json":[99879,9879]};function r(e){if(!n.o(i,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=i[e],r=t[0];return n.e(t[1]).then(()=>n(r))}r.keys=()=>Object.keys(i),r.id=84767,e.exports=r}}]);
|
|
2
|
+
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[3373,6012],{11340:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var i="@openmrs/esm-ward-app"},16012:(e,t,n)=>{"use strict";n.r(t),n.d(t,{admissionRequestWorkspace:()=>A,admissionRequestsWorkspaceSideRailIcon:()=>R,admitPatientFormWorkspace:()=>b,cancelAdmissionRequestWorkspace:()=>U,clinicalFormWorkspaceSideRailIcon:()=>O,createAdmissionEncounterWorkspace:()=>q,createAdmissionEncounterWorkspaceSideRailIcon:()=>W,defaultWardView:()=>D,importTranslation:()=>y,maternalWardView:()=>N,patientClinicalFormsWorkspace:()=>P,patientDischargeWorkspace:()=>I,patientDischargeWorkspaceSideRailIcon:()=>C,patientTransferAndSwapWorkspace:()=>j,patientTransferAndSwapWorkspaceSiderailIcon:()=>L,patientTransferRequestWorkspace:()=>S,root:()=>m,startupApp:()=>E,wardDashboardLink:()=>_,wardPatientActionButtonExtension:()=>v,wardPatientNotesActionButtonExtension:()=>k,wardPatientNotesWorkspace:()=>T,wardPatientWorkspace:()=>w,wardPatientWorkspaceBanner:()=>B,wardView:()=>g});var i=n(54440),r={patientCardElements:{_description:"Configuration of various patient card elements. Each configured element must have a unique id, defined in the ward React component being used.",obs:{_type:i.Type.Array,_default:[],_description:"Configures obs values to display.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:i.Type.UUID,_description:"Identifies the concept to use to identify the desired observations."},label:{_type:i.Type.String,_default:"",_description:"Optional. The custom label or i18n key to the translated label to display. If not provided, defaults to the concept's name. (Note that this can be set to an empty string to not show a label)"},orderBy:{_type:i.Type.String,_default:"descending",_description:"One of 'ascending' or 'descending', specifying whether to display the obs by obsDatetime ascendingly or descendingly.",_validators:[i.validators.oneOf(["ascending","descending"])]},limit:{_type:i.Type.Number,_default:1,_description:"If set to a number greater than one, this will show multiple obs for this concept, which will appear as a list. Set to 0 for unlimited."},onlyWithinCurrentVisit:{_type:i.Type.Boolean,_default:!1,_description:"Optional. If true, limits display to only observations within current visit. Defaults to false"}}},pendingItems:{_type:i.Type.Array,_default:[{id:"pending-items",orders:{orderTypes:[{label:"Labs",uuid:"52a447d3-a64a-11e3-9aeb-50e549534c5e"}]},showPendingItems:!0}],_description:"Configures pending orders and transfers to display.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},orders:{orderTypes:{_type:i.Type.Array,_description:"Configures pending orders and transfers to display.",_elements:{uuid:{_type:i.Type.UUID,_description:"Identifies the order type."},label:{_type:i.Type.String,_default:"",_description:"The label or i18n key to the translated label to display. If not provided, defaults to 'Orders'"}}}},showPendingItems:{_type:i.Type.Boolean,_description:"Optional. If true, pending items (e.g., number of pending orders) will be displayed on the patient card."}}},patientIdentifier:{_type:i.Type.Array,_default:[{id:"patient-identifier",showIdentifierLabel:!1}],_description:"Configures patient identifier to display. An unconfigured element displays the preferred identifier.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},showIdentifierLabel:{_type:i.Type.Boolean,_description:'If true, the identifier type (eg: "OpenMRS ID") is shown along with the identifier itself. Defaults to false'}}},patientAddress:{_type:i.Type.Array,_default:[{id:"patient-address",fields:["cityVillage","country"]}],_description:"Configures patient address elements.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},fields:{_type:i.Type.Array,_description:"The fields of the address to display",_elements:{_type:i.Type.String,_validators:[i.validators.oneOf(["cityVillage","stateProvince","country","postalCode","countyDistrict","latitude","longitude","address1","address2","address3","address4","address5","address6","address7","address8","address9","address10","address11","address12","address13","address14","address15"])]}}}},admissionRequestNote:{_type:i.Type.Array,_default:[{id:"admission-request-note",conceptUuid:"161011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}],_description:"Configures admission request notes to display.",_elements:{id:{_type:i.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:i.Type.UUID,_description:"Required. Identifies the concept for the admission request note."}}},coloredObsTags:{_type:i.Type.Array,_default:[],_description:"Configures observation values to display as Carbon tags.",_elements:{conceptUuid:{_type:i.Type.UUID,_default:"1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",_description:"Required. Identifies the concept to use to identify the desired observations."},summaryLabel:{_type:i.Type.String,_default:"",_description:"Optional. The custom label or i18n key to the translated label to display for the summary tag. The summary tag shows the count of the number of answers that are present but not configured to show as their own tags. If not provided, defaults to the name of the concept."},summaryLabelI18nModule:{_type:i.Type.String,_default:"",_description:"Optional. The custom module to use for translation of the summary label"},summaryLabelColor:{_type:i.Type.String,_default:"",_description:"The color of the summary tag. See https://react.carbondesignsystem.com/?path=/docs/components-tag--overview for a list of supported colors"},tags:{_type:i.Type.Array,_default:[],_description:"An array specifying concept sets and color. Observations with coded values that are members of the specified concept sets will be displayed as their own tags with the specified color. Any observation with coded values not belonging to any concept sets specified will be summarized as a count in the summary tag. If a concept set is listed multiple times, the first matching applied-to rule takes precedence.",_elements:{color:{_type:i.Type.String,_description:"Color of the tag. See https://react.carbondesignsystem.com/?path=/docs/components-tag--overview for a list of supported colors."},appliedToConceptSets:{_type:i.Type.Array,_description:"The concept sets which the color applies to. Observations with coded values that are members of the specified concept sets will be displayed as their own tag with the specified color. If an observation's coded value belongs to multiple concept sets, the first matching applied-to rule takes precedence.",_elements:{_type:i.Type.UUID}}}}}}},wards:{_type:i.Type.Array,_default:[{id:"default-ward"}],_description:"Configuration of what type of ward to use at different ward locations.",_elements:{id:{_type:i.Type.String,_description:'The ward type to use. Currently, "default-ward" and "maternal-ward" are supported. This string also serves as the extension slot name for the ward view.'},appliedTo:{_type:i.Type.Array,_description:"Optional. Conditions under which this card definition should be used. If not provided, the configuration is applied to all wards.",_elements:{location:{_type:i.Type.UUID,_default:"",_description:"The UUID of the location. If not provided, applies to all wards."}}}}},hideWorkspaceVitalsLinks:{_type:i.Type.Boolean,_default:!1,_description:"Configure whether to hide vital history and record vital links in the ward patient workspace."}},s=n(11340),o=n(90380),a=n.n(o),d=n(53373),c=n.n(d),l=n(8877),p=n(93150);function u(e){var t=e.dashboardLinkConfig,n=(0,p.useTranslation)().t,r=t.name,s=t.title,d=(0,l.useLocation)(),u="".concat(window.spaBase,"/home"),f=(0,o.useMemo)(function(){var e=d.pathname.split("/home"),t=e[e.length-1];return decodeURIComponent(t)},[d.pathname]);return a().createElement(i.ConfigurableLink,{className:c()("cds--side-nav__link",{"active-left-nav-link":f.match(r)}),to:"".concat(u,"/").concat(r)},n(s))}var f,y=n(84767),h={featureName:"ward",moduleName:s.A},m=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(9775)]).then(n.bind(n,99775))},h),_=(0,i.getSyncLifecycle)((f={name:"ward",title:"wards"},function(){return a().createElement(l.BrowserRouter,null,a().createElement(u,{dashboardLinkConfig:f}))}),h),g=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(7524)]).then(n.bind(n,27524))},h),A=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(3737)]).then(n.bind(n,23737))},h),b=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(5434),n.e(2728)]).then(n.bind(n,12728))},h),w=(0,i.getAsyncLifecycle)(function(){return n.e(8501).then(n.bind(n,88501))},h),T=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(9045)]).then(n.bind(n,49045))},h),v=(0,i.getAsyncLifecycle)(function(){return n.e(89).then(n.bind(n,20089))},h),k=(0,i.getAsyncLifecycle)(function(){return n.e(7886).then(n.bind(n,57886))},h),j=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(7661),n.e(3365)]).then(n.bind(n,23365))},h),I=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(283)]).then(n.bind(n,80283))},h),L=(0,i.getAsyncLifecycle)(function(){return n.e(3413).then(n.bind(n,23413))},h),S=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(7661),n.e(2948)]).then(n.bind(n,12948))},h),C=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(8622),n.e(3982)]).then(n.bind(n,33982))},h),P=(0,i.getAsyncLifecycle)(function(){return n.e(1663).then(n.bind(n,71663))},h),U=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(9559),n.e(8010),n.e(2557)]).then(n.bind(n,2557))},h),O=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(1899),n.e(1741)]).then(n.bind(n,71741))},h),R=(0,i.getAsyncLifecycle)(function(){return n.e(8522).then(n.bind(n,48522))},h),W=(0,i.getAsyncLifecycle)(function(){return n.e(9117).then(n.bind(n,59117))},h),q=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(8010),n.e(5434),n.e(7179)]).then(n.bind(n,27179))},h),D=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(1369),n.e(9294),n.e(8010),n.e(5434),n.e(8394),n.e(5734),n.e(1326)]).then(n.bind(n,61326))},{featureName:"default-ward-view",moduleName:s.A,swrConfig:{refreshInterval:6e4}}),N=(0,i.getAsyncLifecycle)(function(){return Promise.all([n.e(3144),n.e(8622),n.e(4739),n.e(1369),n.e(9294),n.e(8010),n.e(5434),n.e(8394),n.e(5734),n.e(5885)]).then(n.bind(n,35885))},{featureName:"maternal-ward-view",moduleName:s.A,swrConfig:{refreshInterval:6e4}}),B=(0,i.getAsyncLifecycle)(function(){return n.e(1776).then(n.bind(n,81776))},h);function E(){(0,i.registerBreadcrumbs)([]),(0,i.defineConfigSchema)(s.A,r),(0,i.registerFeatureFlag)("bedmanagement-module","Bed management module","Enables features related to bed management / assignment. Requires the backend bed management module to be installed.")}},53373:(e,t)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,s(n)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)i.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},84767:(e,t,n)=>{var i={"./am.json":[81197,1197],"./ar.json":[14132,4132],"./ar_SY.json":[37617,7617],"./bn.json":[77159,7159],"./de.json":[34944,4944],"./en.json":[34300,4300],"./en_US.json":[59569,9569],"./es.json":[93099,3099],"./es_MX.json":[88349,8349],"./fr.json":[94055,4055],"./he.json":[84652,4652],"./hi.json":[36840,6840],"./hi_IN.json":[55442,5442],"./id.json":[72690,2690],"./it.json":[9538,9538],"./ka.json":[70795,795],"./km.json":[54335,4335],"./ku.json":[9895,9895],"./ky.json":[88163,8163],"./lg.json":[64618,4618],"./ne.json":[12146,2146],"./pl.json":[41119,1119],"./pt.json":[96679,6679],"./pt_BR.json":[36468,6468],"./qu.json":[35173,5173],"./ro_RO.json":[46022,6022],"./ru_RU.json":[60986,986],"./si.json":[56859,6859],"./sw.json":[89913,9913],"./sw_KE.json":[88618,8618],"./tr.json":[55241,5241],"./tr_TR.json":[99900,9900],"./uk.json":[60723,723],"./uz.json":[43584,3584],"./uz@Latn.json":[27097,7097],"./uz_UZ.json":[70890,890],"./vi.json":[79214,9214],"./zh.json":[35661,5661],"./zh_CN.json":[99879,9879]};function r(e){if(!n.o(i,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=i[e],r=t[0];return n.e(t[1]).then(()=>n(r))}r.keys=()=>Object.keys(i),r.id=84767,e.exports=r}}]);
|
package/dist/7179.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 7179.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[7179],{13002:(e,n,t)=>{t.d(n,{E:()=>s,R_:()=>o,Tb:()=>u,tf:()=>d});var r=t(83437),i=t(65980),a=t(92891);function o(){var e=(0,a.A)().location,n=(0,r.useSession)().currentProvider,t=(0,i.A)(),o=t.emrConfiguration,s=t.isLoadingEmrConfiguration,d=t.errorFetchingEmrConfiguration;return{createEncounter:function(t,i,a){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],d={patient:t.uuid,encounterType:i,location:null==e?void 0:e.uuid,encounterProviders:[{provider:null==n?void 0:n.uuid,encounterRole:o.clinicianEncounterRole.uuid}],obs:s,visit:a};return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/encounter"),{method:"POST",headers:{"content-type":"application/json"},body:d})},emrConfiguration:o,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:d}}function s(){var e=o(),n=e.createEncounter,t=e.emrConfiguration;return{admitPatient:function(e,r,i){var a="ADMIT"===r?t.admissionEncounterType:"TRANSFER"===r?t.transferWithinHospitalEncounterType:null;return n(e,a,i)},isLoadingEmrConfiguration:e.isLoadingEmrConfiguration,errorFetchingEmrConfiguration:e.errorFetchingEmrConfiguration}}function d(e,n,t){return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/beds/").concat(e),{method:"POST",headers:{"content-type":"application/json"},body:{patientUuid:n,encounterUuid:t}})}function u(e,n){return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/beds/").concat(e,"?patientUuid=").concat(n),{method:"DELETE"})}},27179:(e,n,t)=>{t.r(n),t.d(n,{default:()=>A});var r=t(90380),i=t.n(r),a=t(93150),o=t(90317),s=t(83437),d=t(83209),u=t(42880);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["ADMIT","TRANSFER"],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"custom:(dispositionLocation,dispositionType,disposition,dispositionEncounter:full,patient:(uuid,identifiers,voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate)),dispositionObsGroup,visit)",r=new URLSearchParams;r.set("dispositionType",n.join(",")),r.set("patients",null==e?void 0:e.join(",")),r.set("v",t);var i=(0,s.useOpenmrsFetchAll)((null==e?void 0:e.length)>0?"".concat(s.restBaseUrl,"/emrapi/inpatient/request?").concat(r.toString()):null);return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){c(e,n,t[n])})}return e}({inpatientRequests:i.data},function(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(i,["data"]))}var f=t(88010),p=t.n(f);function m(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom:(uuid,identifiers,voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate))",t=p()(e?"".concat(s.restBaseUrl,"/patient/").concat(e,"?v=").concat(n):null,s.openmrsFetch),i=t.data,a=function(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(t,["data"]),o=(0,r.useMemo)(function(){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){m(e,n,t[n])})}return e}({patient:null==i?void 0:i.data},a)},[i,a]);return o}var v=t(92891),b=t(99244),h=t(81776);function y(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){y(e,n,t[n])})}return e}const A=function(e){var n=e.patientUuid,t=e.handleReturnToSearchList,r=e.closeWorkspaceWithSavedChanges,c=(0,v.A)().location,f=g(n),p=f.patient,m=f.isLoading,y=f.error,A=(0,s.useVisit)(n),w=A.activeVisit,k=A.isLoading,T=A.error,C=(0,a.useTranslation)().t,S=(0,d.r)(n),P=S.data,O=S.isLoading,L=S.error,R=(0,u.k)([n]),$=R.data,U=R.isLoading,D=R.error,F=l([n]),I=F.inpatientRequests,_=F.isLoading,j=F.error,x=y||T||L||D||j;if(m||k||O||U||_)return i().createElement(o.rrI,null);if(x)return i().createElement("div",null,i().createElement(o.jeF,{kind:"error",lowContrast:!0,title:C("errorLoadingPatientInfo","Error loading patient info")}),i().createElement(o.$nd,{kind:"ghost",renderIcon:function(e){return i().createElement(s.ArrowLeftIcon,E({size:24},e))},iconDescription:C("backToSearchResults","Back to search results"),size:"sm",onClick:function(){return null==t?void 0:t()}},i().createElement("span",null,C("backToSearchResults","Back to search results"))));var B,V,N,W=P.data.results[0],M=(null==W||null===(B=W.physicalLocation)||void 0===B?void 0:B.uuid)==c.uuid,q=(null===(N=$[0])||void 0===N||null===(V=N.currentInpatientLocation)||void 0===V?void 0:V.uuid)==c.uuid,G=$[0]&&!q,H={patient:p,visit:w,bed:M?{id:W.bedId,bedNumber:W.bedNumber,bedType:W.bedType}:null,inpatientAdmission:$[0],inpatientRequest:null};return i().createElement("div",null,i().createElement(h.default,{wardPatient:H}),w?i().createElement("div",null,q&&i().createElement(o.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:C("patientAlreadyAdmittedToCurrentLocation","Patient already admitted to current location")}),G&&i().createElement(o.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:C("patientCurrentlyAdmittedToWardLocation","Patient currently admitted to {{wardLocation}}",{wardLocation:$[0].currentInpatientLocation.display})}),I[0]&&i().createElement(o.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:C("patientHasPendingAdmissionRequest","Patient already has a pending admission request to location {{location}}",{location:I[0].dispositionLocation.display})}),i().createElement(b.A,{wardPatient:H,dispositionType:$[0]?"TRANSFER":"ADMIT",onAdmitPatientSuccess:function(){return r()},disabled:q})):i().createElement("div",null,C("patienthasNoActiveVisit","Patient has no active visit")),i().createElement(o.$nd,{kind:"ghost",renderIcon:function(e){return i().createElement(s.ArrowLeftIcon,E({size:24},e))},iconDescription:C("backToSearchResults","Back to search results"),size:"sm",onClick:function(){return null==t?void 0:t()}},i().createElement("span",null,C("backToSearchResults","Back to search results"))))}},42880:(e,n,t)=>{t.d(n,{k:()=>i});var r=t(83437);function i(e){var n=(null==e?void 0:e.length)>0,t=new URLSearchParams;t.append("v","custom:(visit,patient:(uuid,identifiers:(uuid,display,identifier,identifierType),voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate)),encounterAssigningToCurrentInpatientLocation:(encounterDatetime),currentInpatientRequest:(dispositionLocation,dispositionType,disposition:(uuid,display),dispositionEncounter:(uuid,display),dispositionObsGroup:(uuid,display),visit:(uuid),patient:(uuid)),firstAdmissionOrTransferEncounter:(encounterDatetime),currentInpatientLocation,)");var i=!0,a=!1,o=void 0;try{for(var s,d=(null!=e?e:[])[Symbol.iterator]();!(i=(s=d.next()).done);i=!0){var u=s.value;t.append("patients",u)}}catch(e){a=!0,o=e}finally{try{i||null==d.return||d.return()}finally{if(a)throw o}}return(0,r.useOpenmrsFetchAll)(n?"".concat(r.restBaseUrl,"/emrapi/inpatient/admission?").concat(t.toString()):null)}},58139:(e,n,t)=>{e.exports=t(93296)},65980:(e,n,t)=>{t.d(n,{A:()=>d});var r=t(83437),i=t(90380),a=t(88010),o=t.n(a),s="custom:".concat([["metadataSourceName","ref"],["orderingProviderEncounterRole","ref"],["supportsTransferLocationTag","(uuid,display,name,links)"],["unknownLocation","ref"],["denyAdmissionConcept","ref"],["admissionForm","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["consultFreeTextCommentsConcept","ref"],["sameAsConceptMapType","ref"],["testPatientPersonAttributeType","ref"],["admissionDecisionConcept","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["checkInEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["suppressedDiagnosisConcepts","ref"],["primaryIdentifierType","ref"],["nonDiagnosisConceptSets","ref"],["fullPrivilegeLevel","ref"],["unknownProvider","ref"],["diagnosisSets","ref"],["personImageDirectory","ref"],["visitNoteEncounterType","ref"],["inpatientNoteEncounterType","ref"],["transferRequestEncounterType","ref"],["consultEncounterType","ref"],["diagnosisMetadata","ref"],["narrowerThanConceptMapType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["patientDiedConcept","ref"],["emrApiConceptSource","ref"],["lastViewedPatientSizeLimit","ref"],["identifierTypesToSearch","ref"],["telephoneAttributeType","ref"],["checkInClerkEncounterRole","ref"],["dischargeForm","ref"],["unknownCauseOfDeathConcept","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["atFacilityVisitType","ref"],["visitExpireHours","ref"],["admissionEncounterType","ref"],["motherChildRelationshipType","ref"],["dispositions","ref"],["dispositionDescriptor","ref"],["highPrivilegeLevel","ref"],["supportsLoginLocationTag","(uuid,display,name,links)"],["unknownPatientPersonAttributeType","ref"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["transferForm","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["admissionDecisionConcept","ref"],["denyAdmissionConcept","ref"]].map(function(e){return e.join(":")}).join(","));function d(){var e=o()("".concat(r.restBaseUrl,"/emrapi/configuration?v=").concat(s),r.openmrsFetch);return(0,i.useMemo)(function(){var n;return{emrConfiguration:null===(n=e.data)||void 0===n?void 0:n.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}},[e])}},71123:(e,n,t)=>{t.d(n,{Ay:()=>u,BE:()=>d});var r=t(90380),i=t(58139),a=t(55434);const o=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e)}),s={dedupe:!0},d=a.OBJECT.defineProperty(a.SWRConfig,"defaultValue",{value:a.defaultConfig}),u=(0,a.withArgs)((e,n,t)=>{const{cache:d,compare:u,suspense:c,fallbackData:l,revalidateOnMount:f,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:v,keepPreviousData:b}=t,[h,y,E,A]=a.SWRGlobalState.get(d),[w,k]=(0,a.serialize)(e),T=(0,r.useRef)(!1),C=(0,r.useRef)(!1),S=(0,r.useRef)(w),P=(0,r.useRef)(n),O=(0,r.useRef)(t),L=()=>O.current,R=()=>L().isVisible()&&L().isOnline(),[$,U,D,F]=(0,a.createCacheHelper)(d,w),I=(0,r.useRef)({}).current,_=(0,a.isUndefined)(l)?t.fallback[w]:l,j=(e,n)=>{for(const t in I){const r=t;if("data"===r){if(!u(e[r],n[r])){if(!(0,a.isUndefined)(e[r]))return!1;if(!u(H,n[r]))return!1}}else if(n[r]!==e[r])return!1}return!0},x=(0,r.useMemo)(()=>{const e=!!w&&!!n&&((0,a.isUndefined)(f)?!L().isPaused()&&!c&&(!!(0,a.isUndefined)(p)||p):f),t=n=>{const t=(0,a.mergeObjects)(n);return delete t._k,e?{isValidating:!0,isLoading:!0,...t}:t},r=$(),i=F(),o=t(r),s=r===i?o:t(i);let d=o;return[()=>{const e=t($());return j(e,d)?(d.data=e.data,d.isLoading=e.isLoading,d.isValidating=e.isValidating,d.error=e.error,d):(d=e,e)},()=>s]},[d,w]),B=(0,i.useSyncExternalStore)((0,r.useCallback)(e=>D(w,(n,t)=>{j(t,n)||e()}),[d,w]),x[0],x[1]),V=!T.current,N=h[w]&&h[w].length>0,W=B.data,M=(0,a.isUndefined)(W)?_:W,q=B.error,G=(0,r.useRef)(M),H=b?(0,a.isUndefined)(W)?G.current:W:M,z=!(N&&!(0,a.isUndefined)(q))&&(V&&!(0,a.isUndefined)(f)?f:!L().isPaused()&&(c?!(0,a.isUndefined)(M)&&p:(0,a.isUndefined)(M)||p)),K=!!(w&&n&&V&&z),Y=(0,a.isUndefined)(B.isValidating)?K:B.isValidating,J=(0,a.isUndefined)(B.isLoading)?K:B.isLoading,Q=(0,r.useCallback)(async e=>{const n=P.current;if(!w||!n||C.current||L().isPaused())return!1;let r,i,o=!0;const s=e||{},d=!E[w]||!s.dedupe,c=()=>a.IS_REACT_LEGACY?!C.current&&w===S.current&&T.current:w===S.current,l={isValidating:!1,isLoading:!1},f=()=>{U(l)},p=()=>{const e=E[w];e&&e[1]===i&&delete E[w]},m={isValidating:!0};(0,a.isUndefined)($().data)&&(m.isLoading=!0);try{if(d&&(U(m),t.loadingTimeout&&(0,a.isUndefined)($().data)&&setTimeout(()=>{o&&c()&&L().onLoadingSlow(w,t)},t.loadingTimeout),E[w]=[n(k),(0,a.getTimestamp)()]),[r,i]=E[w],r=await r,d&&setTimeout(p,t.dedupingInterval),!E[w]||E[w][1]!==i)return d&&c()&&L().onDiscarded(w),!1;l.error=a.UNDEFINED;const e=y[w];if(!(0,a.isUndefined)(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return f(),d&&c()&&L().onDiscarded(w),!1;const s=$().data;l.data=u(s,r)?s:r,d&&c()&&L().onSuccess(r,w,t)}catch(e){p();const n=L(),{shouldRetryOnError:t}=n;n.isPaused()||(l.error=e,d&&c()&&(n.onError(e,w,n),(!0===t||(0,a.isFunction)(t)&&t(e))&&(L().revalidateOnFocus&&L().revalidateOnReconnect&&!R()||n.onErrorRetry(e,w,n,e=>{const n=h[w];n&&n[0]&&n[0](a.revalidateEvents.ERROR_REVALIDATE_EVENT,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))))}return o=!1,f(),!0},[w,d]),X=(0,r.useCallback)((...e)=>(0,a.internalMutate)(d,S.current,...e),[]);if((0,a.useIsomorphicLayoutEffect)(()=>{P.current=n,O.current=t,(0,a.isUndefined)(W)||(G.current=W)}),(0,a.useIsomorphicLayoutEffect)(()=>{if(!w)return;const e=Q.bind(a.UNDEFINED,s);let n=0;const t=(0,a.subscribeCallback)(w,h,(t,r={})=>{if(t==a.revalidateEvents.FOCUS_EVENT){const t=Date.now();L().revalidateOnFocus&&t>n&&R()&&(n=t+L().focusThrottleInterval,e())}else if(t==a.revalidateEvents.RECONNECT_EVENT)L().revalidateOnReconnect&&R()&&e();else{if(t==a.revalidateEvents.MUTATE_EVENT)return Q();if(t==a.revalidateEvents.ERROR_REVALIDATE_EVENT)return Q(r)}});return C.current=!1,S.current=w,T.current=!0,U({_k:k}),z&&((0,a.isUndefined)(M)||a.IS_SERVER?e():(0,a.rAF)(e)),()=>{C.current=!0,t()}},[w]),(0,a.useIsomorphicLayoutEffect)(()=>{let e;function n(){const n=(0,a.isFunction)(m)?m($().data):m;n&&-1!==e&&(e=setTimeout(t,n))}function t(){$().error||!g&&!L().isVisible()||!v&&!L().isOnline()?n():Q(s).then(n)}return n(),()=>{e&&(clearTimeout(e),e=-1)}},[m,g,v,w]),(0,r.useDebugValue)(H),c&&(0,a.isUndefined)(M)&&w){if(!a.IS_REACT_LEGACY&&a.IS_SERVER)throw new Error("Fallback data is required when using suspense in SSR.");P.current=n,O.current=t,C.current=!1;const e=A[w];if(!(0,a.isUndefined)(e)){const n=X(e);o(n)}if(!(0,a.isUndefined)(q))throw q;{const e=Q(s);(0,a.isUndefined)(H)||(e.status="fulfilled",e.value=!0),o(e)}}return{mutate:X,get data(){return I.data=!0,H},get error(){return I.error=!0,q},get isValidating(){return I.isValidating=!0,Y},get isLoading(){return I.isLoading=!0,J}}})},71296:(e,n,t)=>{t.d(n,{A:()=>s});var r=t(30977),i=t.n(r),a=t(95924),o=t.n(a)()(i());o.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__style__wardWorkspacePatientBanner___2KnUU>div{background:#f4f4f4}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-workspace/patient-banner/style.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DA,0DACE,kBDFI",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.wardWorkspacePatientBanner {\n > div {\n background: $ui-01;\n }\n}\n"],sourceRoot:""}]),o.locals={wardWorkspacePatientBanner:"-esm-ward__style__wardWorkspacePatientBanner___2KnUU"};const s=o},81776:(e,n,t)=>{t.r(n),t.d(n,{default:()=>A});var r=t(83437),i=t(90380),a=t.n(i),o=t(72591),s=t.n(o),d=t(1740),u=t.n(d),c=t(88128),l=t.n(c),f=t(30855),p=t.n(f),m=t(93051),g=t.n(m),v=t(73656),b=t.n(v),h=t(71296),y={};y.styleTagTransform=b(),y.setAttributes=p(),y.insert=l().bind(null,"head"),y.domAPI=u(),y.insertStyleElement=g(),s()(h.A,y);const E=h.A&&h.A.locals?h.A.locals:void 0,A=function(e){var n,t=e.wardPatient,i=(null!=t?t:{}).patient,o=(null!==(n=(0,r.useAppContext)("ward-view-context"))&&void 0!==n?n:{}).WardPatientHeader;return i?o?a().createElement("div",{className:E.wardWorkspacePatientBanner},a().createElement(o,{wardPatient:t})):a().createElement(a().Fragment,null):(console.warn("Patient details were not received by the ward workspace"),null)}},83209:(e,n,t)=>{t.d(n,{r:()=>a});var r=t(83437),i=t(71123);function a(e){var n="".concat(r.restBaseUrl,"/beds?patientUuid=").concat(e);return(0,i.Ay)(n,r.openmrsFetch)}},92891:(e,n,t)=>{t.d(n,{A:()=>s});var r=t(83437),i=t(8877),a=t(88010),o=t.n(a);function s(){var e=(0,i.useParams)().locationUuid,n=(0,r.useSession)().sessionLocation,t=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom:(display,uuid)";return o()(e?"".concat(r.restBaseUrl,"/location/").concat(e,"?v=").concat(n):null,r.openmrsFetch)}(e||null),a=t.data,s=t.isLoading,d=t.error,u=e&&d;return{location:e?null==a?void 0:a.data:n,isLoadingLocation:s,errorFetchingLocation:d,invalidLocation:u}}},93296:(e,n,t)=>{var r=t(90380),i="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,d=r.useDebugValue;function u(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!i(e,t)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),r=a({inst:{value:t,getSnapshot:n}}),i=r[0].inst,c=r[1];return s(function(){i.value=t,i.getSnapshot=n,u(i)&&c({inst:i})},[e,t,n]),o(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),d(t),t};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},99244:(e,n,t)=>{t.d(n,{A:()=>c});var r=t(90317),i=t(83437),a=t(90380),o=t.n(a),s=t(93150),d=t(92891),u=t(13002);const c=function(e){var n,t=e.wardPatient,a=e.onAdmitPatientSuccess,c=e.disabled,l=e.dispositionType,f=null!=t?t:{},p=f.patient,m=f.visit,g=f.bed,v=(0,s.useTranslation)().t,b=(0,d.A)().location,h="tablet"===(0,i.useLayoutType)()?"lg":"md",y=(null!==(n=(0,i.useAppContext)("ward-view-context"))&&void 0!==n?n:{}).wardPatientGroupDetails,E=(0,u.E)(),A=E.admitPatient,w=E.isLoadingEmrConfiguration,k=E.errorFetchingEmrConfiguration,T=(0,i.useFeatureFlag)("bedmanagement-module"),C=w||k||c;return o().createElement(r.$nd,{kind:"ghost",renderIcon:i.ArrowRightIcon,size:h,disabled:C,onClick:function(){T&&!g?(0,i.launchWorkspace)("admit-patient-form-workspace",{wardPatient:t}):A(p,l,m.uuid).then(function(e){e&&(null==e?void 0:e.ok)&&(0,i.showSnackbar)({kind:"success",title:v("patientAdmittedSuccessfully","Patient admitted successfully"),subtitle:v("patientAdmittedWoBed","Patient admitted successfully to {{location}}",{location:null==b?void 0:b.display})})},function(e){(0,i.showSnackbar)({kind:"error",title:v("errorCreatingEncounter","Failed to admit patient"),subtitle:e.message})}).finally(function(){var e;null==y||null===(e=y.mutate)||void 0===e||e.call(y),a()})}},"ADMIT"==l||C?v("admitPatient","Admit patient"):v("transferPatient","Transfer patient"))}}}]);
|
|
2
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[7179],{13002:(e,n,t)=>{t.d(n,{E:()=>s,R_:()=>o,Tb:()=>u,tf:()=>d});var r=t(54440),i=t(65980),a=t(92891);function o(){var e=(0,a.A)().location,n=(0,r.useSession)().currentProvider,t=(0,i.A)(),o=t.emrConfiguration,s=t.isLoadingEmrConfiguration,d=t.errorFetchingEmrConfiguration;return{createEncounter:function(t,i,a){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],d={patient:t.uuid,encounterType:i,location:null==e?void 0:e.uuid,encounterProviders:[{provider:null==n?void 0:n.uuid,encounterRole:o.clinicianEncounterRole.uuid}],obs:s,visit:a};return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/encounter"),{method:"POST",headers:{"content-type":"application/json"},body:d})},emrConfiguration:o,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:d}}function s(){var e=o(),n=e.createEncounter,t=e.emrConfiguration;return{admitPatient:function(e,r,i){var a="ADMIT"===r?t.admissionEncounterType:"TRANSFER"===r?t.transferWithinHospitalEncounterType:null;return n(e,a,i)},isLoadingEmrConfiguration:e.isLoadingEmrConfiguration,errorFetchingEmrConfiguration:e.errorFetchingEmrConfiguration}}function d(e,n,t){return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/beds/").concat(e),{method:"POST",headers:{"content-type":"application/json"},body:{patientUuid:n,encounterUuid:t}})}function u(e,n){return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/beds/").concat(e,"?patientUuid=").concat(n),{method:"DELETE"})}},27179:(e,n,t)=>{t.r(n),t.d(n,{default:()=>A});var r=t(90380),i=t.n(r),a=t(93150),o=t(90317),s=t(54440),d=t(83209),u=t(42880);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["ADMIT","TRANSFER"],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"custom:(dispositionLocation,dispositionType,disposition,dispositionEncounter:full,patient:(uuid,identifiers,voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate)),dispositionObsGroup,visit)",r=new URLSearchParams;r.set("dispositionType",n.join(",")),r.set("patients",null==e?void 0:e.join(",")),r.set("v",t);var i=(0,s.useOpenmrsFetchAll)((null==e?void 0:e.length)>0?"".concat(s.restBaseUrl,"/emrapi/inpatient/request?").concat(r.toString()):null);return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){c(e,n,t[n])})}return e}({inpatientRequests:i.data},function(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(i,["data"]))}var f=t(88010),p=t.n(f);function m(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom:(uuid,identifiers,voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate))",t=p()(e?"".concat(s.restBaseUrl,"/patient/").concat(e,"?v=").concat(n):null,s.openmrsFetch),i=t.data,a=function(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(t,["data"]),o=(0,r.useMemo)(function(){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){m(e,n,t[n])})}return e}({patient:null==i?void 0:i.data},a)},[i,a]);return o}var v=t(92891),b=t(99244),h=t(81776);function y(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){y(e,n,t[n])})}return e}const A=function(e){var n=e.patientUuid,t=e.handleReturnToSearchList,r=e.closeWorkspaceWithSavedChanges,c=(0,v.A)().location,f=g(n),p=f.patient,m=f.isLoading,y=f.error,A=(0,s.useVisit)(n),w=A.activeVisit,k=A.isLoading,T=A.error,C=(0,a.useTranslation)().t,S=(0,d.r)(n),P=S.data,O=S.isLoading,L=S.error,R=(0,u.k)([n]),$=R.data,U=R.isLoading,D=R.error,F=l([n]),I=F.inpatientRequests,_=F.isLoading,j=F.error,x=y||T||L||D||j;if(m||k||O||U||_)return i().createElement(o.rrI,null);if(x)return i().createElement("div",null,i().createElement(o.jeF,{kind:"error",lowContrast:!0,title:C("errorLoadingPatientInfo","Error loading patient info")}),i().createElement(o.$nd,{kind:"ghost",renderIcon:function(e){return i().createElement(s.ArrowLeftIcon,E({size:24},e))},iconDescription:C("backToSearchResults","Back to search results"),size:"sm",onClick:function(){return null==t?void 0:t()}},i().createElement("span",null,C("backToSearchResults","Back to search results"))));var B,V,N,W=P.data.results[0],M=(null==W||null===(B=W.physicalLocation)||void 0===B?void 0:B.uuid)==c.uuid,q=(null===(N=$[0])||void 0===N||null===(V=N.currentInpatientLocation)||void 0===V?void 0:V.uuid)==c.uuid,G=$[0]&&!q,H={patient:p,visit:w,bed:M?{id:W.bedId,bedNumber:W.bedNumber,bedType:W.bedType}:null,inpatientAdmission:$[0],inpatientRequest:null};return i().createElement("div",null,i().createElement(h.default,{wardPatient:H}),w?i().createElement("div",null,q&&i().createElement(o.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:C("patientAlreadyAdmittedToCurrentLocation","Patient already admitted to current location")}),G&&i().createElement(o.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:C("patientCurrentlyAdmittedToWardLocation","Patient currently admitted to {{wardLocation}}",{wardLocation:$[0].currentInpatientLocation.display})}),I[0]&&i().createElement(o.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:C("patientHasPendingAdmissionRequest","Patient already has a pending admission request to location {{location}}",{location:I[0].dispositionLocation.display})}),i().createElement(b.A,{wardPatient:H,dispositionType:$[0]?"TRANSFER":"ADMIT",onAdmitPatientSuccess:function(){return r()},disabled:q})):i().createElement("div",null,C("patienthasNoActiveVisit","Patient has no active visit")),i().createElement(o.$nd,{kind:"ghost",renderIcon:function(e){return i().createElement(s.ArrowLeftIcon,E({size:24},e))},iconDescription:C("backToSearchResults","Back to search results"),size:"sm",onClick:function(){return null==t?void 0:t()}},i().createElement("span",null,C("backToSearchResults","Back to search results"))))}},42880:(e,n,t)=>{t.d(n,{k:()=>i});var r=t(54440);function i(e){var n=(null==e?void 0:e.length)>0,t=new URLSearchParams;t.append("v","custom:(visit,patient:(uuid,identifiers:(uuid,display,identifier,identifierType),voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate)),encounterAssigningToCurrentInpatientLocation:(encounterDatetime),currentInpatientRequest:(dispositionLocation,dispositionType,disposition:(uuid,display),dispositionEncounter:(uuid,display),dispositionObsGroup:(uuid,display),visit:(uuid),patient:(uuid)),firstAdmissionOrTransferEncounter:(encounterDatetime),currentInpatientLocation,)");var i=!0,a=!1,o=void 0;try{for(var s,d=(null!=e?e:[])[Symbol.iterator]();!(i=(s=d.next()).done);i=!0){var u=s.value;t.append("patients",u)}}catch(e){a=!0,o=e}finally{try{i||null==d.return||d.return()}finally{if(a)throw o}}return(0,r.useOpenmrsFetchAll)(n?"".concat(r.restBaseUrl,"/emrapi/inpatient/admission?").concat(t.toString()):null)}},58139:(e,n,t)=>{e.exports=t(93296)},65980:(e,n,t)=>{t.d(n,{A:()=>d});var r=t(54440),i=t(90380),a=t(88010),o=t.n(a),s="custom:".concat([["metadataSourceName","ref"],["orderingProviderEncounterRole","ref"],["supportsTransferLocationTag","(uuid,display,name,links)"],["unknownLocation","ref"],["denyAdmissionConcept","ref"],["admissionForm","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["consultFreeTextCommentsConcept","ref"],["sameAsConceptMapType","ref"],["testPatientPersonAttributeType","ref"],["admissionDecisionConcept","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["checkInEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["suppressedDiagnosisConcepts","ref"],["primaryIdentifierType","ref"],["nonDiagnosisConceptSets","ref"],["fullPrivilegeLevel","ref"],["unknownProvider","ref"],["diagnosisSets","ref"],["personImageDirectory","ref"],["visitNoteEncounterType","ref"],["inpatientNoteEncounterType","ref"],["transferRequestEncounterType","ref"],["consultEncounterType","ref"],["diagnosisMetadata","ref"],["narrowerThanConceptMapType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["patientDiedConcept","ref"],["emrApiConceptSource","ref"],["lastViewedPatientSizeLimit","ref"],["identifierTypesToSearch","ref"],["telephoneAttributeType","ref"],["checkInClerkEncounterRole","ref"],["dischargeForm","ref"],["unknownCauseOfDeathConcept","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["atFacilityVisitType","ref"],["visitExpireHours","ref"],["admissionEncounterType","ref"],["motherChildRelationshipType","ref"],["dispositions","ref"],["dispositionDescriptor","ref"],["highPrivilegeLevel","ref"],["supportsLoginLocationTag","(uuid,display,name,links)"],["unknownPatientPersonAttributeType","ref"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["transferForm","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["admissionDecisionConcept","ref"],["denyAdmissionConcept","ref"]].map(function(e){return e.join(":")}).join(","));function d(){var e=o()("".concat(r.restBaseUrl,"/emrapi/configuration?v=").concat(s),r.openmrsFetch);return(0,i.useMemo)(function(){var n;return{emrConfiguration:null===(n=e.data)||void 0===n?void 0:n.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}},[e])}},71123:(e,n,t)=>{t.d(n,{Ay:()=>u,BE:()=>d});var r=t(90380),i=t(58139),a=t(55434);const o=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e)}),s={dedupe:!0},d=a.OBJECT.defineProperty(a.SWRConfig,"defaultValue",{value:a.defaultConfig}),u=(0,a.withArgs)((e,n,t)=>{const{cache:d,compare:u,suspense:c,fallbackData:l,revalidateOnMount:f,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:v,keepPreviousData:b}=t,[h,y,E,A]=a.SWRGlobalState.get(d),[w,k]=(0,a.serialize)(e),T=(0,r.useRef)(!1),C=(0,r.useRef)(!1),S=(0,r.useRef)(w),P=(0,r.useRef)(n),O=(0,r.useRef)(t),L=()=>O.current,R=()=>L().isVisible()&&L().isOnline(),[$,U,D,F]=(0,a.createCacheHelper)(d,w),I=(0,r.useRef)({}).current,_=(0,a.isUndefined)(l)?t.fallback[w]:l,j=(e,n)=>{for(const t in I){const r=t;if("data"===r){if(!u(e[r],n[r])){if(!(0,a.isUndefined)(e[r]))return!1;if(!u(H,n[r]))return!1}}else if(n[r]!==e[r])return!1}return!0},x=(0,r.useMemo)(()=>{const e=!!w&&!!n&&((0,a.isUndefined)(f)?!L().isPaused()&&!c&&(!!(0,a.isUndefined)(p)||p):f),t=n=>{const t=(0,a.mergeObjects)(n);return delete t._k,e?{isValidating:!0,isLoading:!0,...t}:t},r=$(),i=F(),o=t(r),s=r===i?o:t(i);let d=o;return[()=>{const e=t($());return j(e,d)?(d.data=e.data,d.isLoading=e.isLoading,d.isValidating=e.isValidating,d.error=e.error,d):(d=e,e)},()=>s]},[d,w]),B=(0,i.useSyncExternalStore)((0,r.useCallback)(e=>D(w,(n,t)=>{j(t,n)||e()}),[d,w]),x[0],x[1]),V=!T.current,N=h[w]&&h[w].length>0,W=B.data,M=(0,a.isUndefined)(W)?_:W,q=B.error,G=(0,r.useRef)(M),H=b?(0,a.isUndefined)(W)?G.current:W:M,z=!(N&&!(0,a.isUndefined)(q))&&(V&&!(0,a.isUndefined)(f)?f:!L().isPaused()&&(c?!(0,a.isUndefined)(M)&&p:(0,a.isUndefined)(M)||p)),K=!!(w&&n&&V&&z),Y=(0,a.isUndefined)(B.isValidating)?K:B.isValidating,J=(0,a.isUndefined)(B.isLoading)?K:B.isLoading,Q=(0,r.useCallback)(async e=>{const n=P.current;if(!w||!n||C.current||L().isPaused())return!1;let r,i,o=!0;const s=e||{},d=!E[w]||!s.dedupe,c=()=>a.IS_REACT_LEGACY?!C.current&&w===S.current&&T.current:w===S.current,l={isValidating:!1,isLoading:!1},f=()=>{U(l)},p=()=>{const e=E[w];e&&e[1]===i&&delete E[w]},m={isValidating:!0};(0,a.isUndefined)($().data)&&(m.isLoading=!0);try{if(d&&(U(m),t.loadingTimeout&&(0,a.isUndefined)($().data)&&setTimeout(()=>{o&&c()&&L().onLoadingSlow(w,t)},t.loadingTimeout),E[w]=[n(k),(0,a.getTimestamp)()]),[r,i]=E[w],r=await r,d&&setTimeout(p,t.dedupingInterval),!E[w]||E[w][1]!==i)return d&&c()&&L().onDiscarded(w),!1;l.error=a.UNDEFINED;const e=y[w];if(!(0,a.isUndefined)(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return f(),d&&c()&&L().onDiscarded(w),!1;const s=$().data;l.data=u(s,r)?s:r,d&&c()&&L().onSuccess(r,w,t)}catch(e){p();const n=L(),{shouldRetryOnError:t}=n;n.isPaused()||(l.error=e,d&&c()&&(n.onError(e,w,n),(!0===t||(0,a.isFunction)(t)&&t(e))&&(L().revalidateOnFocus&&L().revalidateOnReconnect&&!R()||n.onErrorRetry(e,w,n,e=>{const n=h[w];n&&n[0]&&n[0](a.revalidateEvents.ERROR_REVALIDATE_EVENT,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))))}return o=!1,f(),!0},[w,d]),X=(0,r.useCallback)((...e)=>(0,a.internalMutate)(d,S.current,...e),[]);if((0,a.useIsomorphicLayoutEffect)(()=>{P.current=n,O.current=t,(0,a.isUndefined)(W)||(G.current=W)}),(0,a.useIsomorphicLayoutEffect)(()=>{if(!w)return;const e=Q.bind(a.UNDEFINED,s);let n=0;const t=(0,a.subscribeCallback)(w,h,(t,r={})=>{if(t==a.revalidateEvents.FOCUS_EVENT){const t=Date.now();L().revalidateOnFocus&&t>n&&R()&&(n=t+L().focusThrottleInterval,e())}else if(t==a.revalidateEvents.RECONNECT_EVENT)L().revalidateOnReconnect&&R()&&e();else{if(t==a.revalidateEvents.MUTATE_EVENT)return Q();if(t==a.revalidateEvents.ERROR_REVALIDATE_EVENT)return Q(r)}});return C.current=!1,S.current=w,T.current=!0,U({_k:k}),z&&((0,a.isUndefined)(M)||a.IS_SERVER?e():(0,a.rAF)(e)),()=>{C.current=!0,t()}},[w]),(0,a.useIsomorphicLayoutEffect)(()=>{let e;function n(){const n=(0,a.isFunction)(m)?m($().data):m;n&&-1!==e&&(e=setTimeout(t,n))}function t(){$().error||!g&&!L().isVisible()||!v&&!L().isOnline()?n():Q(s).then(n)}return n(),()=>{e&&(clearTimeout(e),e=-1)}},[m,g,v,w]),(0,r.useDebugValue)(H),c&&(0,a.isUndefined)(M)&&w){if(!a.IS_REACT_LEGACY&&a.IS_SERVER)throw new Error("Fallback data is required when using suspense in SSR.");P.current=n,O.current=t,C.current=!1;const e=A[w];if(!(0,a.isUndefined)(e)){const n=X(e);o(n)}if(!(0,a.isUndefined)(q))throw q;{const e=Q(s);(0,a.isUndefined)(H)||(e.status="fulfilled",e.value=!0),o(e)}}return{mutate:X,get data(){return I.data=!0,H},get error(){return I.error=!0,q},get isValidating(){return I.isValidating=!0,Y},get isLoading(){return I.isLoading=!0,J}}})},71296:(e,n,t)=>{t.d(n,{A:()=>s});var r=t(30977),i=t.n(r),a=t(95924),o=t.n(a)()(i());o.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__style__wardWorkspacePatientBanner___2KnUU>div{background:#f4f4f4}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-workspace/patient-banner/style.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DA,0DACE,kBDFI",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.wardWorkspacePatientBanner {\n > div {\n background: $ui-01;\n }\n}\n"],sourceRoot:""}]),o.locals={wardWorkspacePatientBanner:"-esm-ward__style__wardWorkspacePatientBanner___2KnUU"};const s=o},81776:(e,n,t)=>{t.r(n),t.d(n,{default:()=>A});var r=t(54440),i=t(90380),a=t.n(i),o=t(72591),s=t.n(o),d=t(1740),u=t.n(d),c=t(88128),l=t.n(c),f=t(30855),p=t.n(f),m=t(93051),g=t.n(m),v=t(73656),b=t.n(v),h=t(71296),y={};y.styleTagTransform=b(),y.setAttributes=p(),y.insert=l().bind(null,"head"),y.domAPI=u(),y.insertStyleElement=g(),s()(h.A,y);const E=h.A&&h.A.locals?h.A.locals:void 0,A=function(e){var n,t=e.wardPatient,i=(null!=t?t:{}).patient,o=(null!==(n=(0,r.useAppContext)("ward-view-context"))&&void 0!==n?n:{}).WardPatientHeader;return i?o?a().createElement("div",{className:E.wardWorkspacePatientBanner},a().createElement(o,{wardPatient:t})):a().createElement(a().Fragment,null):(console.warn("Patient details were not received by the ward workspace"),null)}},83209:(e,n,t)=>{t.d(n,{r:()=>a});var r=t(54440),i=t(71123);function a(e){var n="".concat(r.restBaseUrl,"/beds?patientUuid=").concat(e);return(0,i.Ay)(n,r.openmrsFetch)}},92891:(e,n,t)=>{t.d(n,{A:()=>s});var r=t(54440),i=t(8877),a=t(88010),o=t.n(a);function s(){var e=(0,i.useParams)().locationUuid,n=(0,r.useSession)().sessionLocation,t=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom:(display,uuid)";return o()(e?"".concat(r.restBaseUrl,"/location/").concat(e,"?v=").concat(n):null,r.openmrsFetch)}(e||null),a=t.data,s=t.isLoading,d=t.error,u=e&&d;return{location:e?null==a?void 0:a.data:n,isLoadingLocation:s,errorFetchingLocation:d,invalidLocation:u}}},93296:(e,n,t)=>{var r=t(90380),i="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,d=r.useDebugValue;function u(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!i(e,t)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),r=a({inst:{value:t,getSnapshot:n}}),i=r[0].inst,c=r[1];return s(function(){i.value=t,i.getSnapshot=n,u(i)&&c({inst:i})},[e,t,n]),o(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),d(t),t};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},99244:(e,n,t)=>{t.d(n,{A:()=>c});var r=t(90317),i=t(54440),a=t(90380),o=t.n(a),s=t(93150),d=t(92891),u=t(13002);const c=function(e){var n,t=e.wardPatient,a=e.onAdmitPatientSuccess,c=e.disabled,l=e.dispositionType,f=null!=t?t:{},p=f.patient,m=f.visit,g=f.bed,v=(0,s.useTranslation)().t,b=(0,d.A)().location,h="tablet"===(0,i.useLayoutType)()?"lg":"md",y=(null!==(n=(0,i.useAppContext)("ward-view-context"))&&void 0!==n?n:{}).wardPatientGroupDetails,E=(0,u.E)(),A=E.admitPatient,w=E.isLoadingEmrConfiguration,k=E.errorFetchingEmrConfiguration,T=(0,i.useFeatureFlag)("bedmanagement-module"),C=w||k||c;return o().createElement(r.$nd,{kind:"ghost",renderIcon:i.ArrowRightIcon,size:h,disabled:C,onClick:function(){T&&!g?(0,i.launchWorkspace)("admit-patient-form-workspace",{wardPatient:t}):A(p,l,m.uuid).then(function(e){e&&(null==e?void 0:e.ok)&&(0,i.showSnackbar)({kind:"success",title:v("patientAdmittedSuccessfully","Patient admitted successfully"),subtitle:v("patientAdmittedWoBed","Patient admitted successfully to {{location}}",{location:null==b?void 0:b.display})})},function(e){(0,i.showSnackbar)({kind:"error",title:v("errorCreatingEncounter","Failed to admit patient"),subtitle:e.message})}).finally(function(){var e;null==y||null===(e=y.mutate)||void 0===e||e.call(y),a()})}},"ADMIT"==l||C?v("admitPatient","Admit patient"):v("transferPatient","Transfer patient"))}}}]);
|
package/dist/7524.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[7524],{19108:(n,e,a)=>{a.d(e,{A:()=>c});var r=a(30977),t=a.n(r),i=a(95924),o=a.n(i)()(t());o.push([n.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__ward-view__wardView___FbpB2{background-color:#e4e4e4;display:flex;flex-direction:column;padding:0 1rem}.-esm-ward__ward-view__wardView___FbpB2.-esm-ward__ward-view__verticalTiling___As-Jz{height:calc(100vh - var(--omrs-topnav-height))}.-esm-ward__ward-view__wardViewMain___jYzEv{background-color:#e4e4e4;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));display:grid;gap:1rem}.-esm-ward__ward-view__wardViewMain___jYzEv.-esm-ward__ward-view__verticalTiling___As-Jz{display:block;column-width:280px;overflow-x:auto;height:calc(100% - 4rem)}.-esm-ward__ward-view__wardViewMain___jYzEv.-esm-ward__ward-view__verticalTiling___As-Jz>div{break-inside:avoid;margin-bottom:10px}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-view/ward-view.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DF,wCACE,wBAAA,CACA,YAAA,CACA,qBAAA,CACA,cAAA,CAEA,qFACE,8CAAA,CAIJ,4CACE,wBAAA,CACA,2DAAA,CACA,YAAA,CACA,QCaW,CDXX,yFACE,aAAA,CACA,kBAAA,CACA,eAAA,CACA,wBAAA,CAEA,6FACE,kBAAA,CACA,kBAAA",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.wardView {\n background-color: #e4e4e4;\n display: flex;\n flex-direction: column;\n padding: 0 layout.$spacing-05;\n\n &.verticalTiling {\n height: calc(100vh - var(--omrs-topnav-height));\n }\n}\n\n.wardViewMain {\n background-color: #e4e4e4;\n grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n display: grid;\n gap: layout.$spacing-05;\n\n &.verticalTiling {\n display: block;\n column-width: 280px;\n overflow-x: auto;\n height: calc(100% - 4rem);\n\n > div {\n break-inside: avoid;\n margin-bottom: 10px;\n }\n }\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),o.locals={wardView:"-esm-ward__ward-view__wardView___FbpB2",verticalTiling:"-esm-ward__ward-view__verticalTiling___As-Jz",wardViewMain:"-esm-ward__ward-view__wardViewMain___jYzEv"};const c=o},27524:(n,e,a)=>{a.r(e),a.d(e,{default:()=>g});var r=a(90317),t=a(83437),i=a(53373),o=a.n(i),c=a(90380),u=a.n(c),d=a(93150),l=a(92891),s=a(35487),p=a(90102);const g=function(){var n=(0,l.A)(),e=n.isLoadingLocation,a=n.invalidLocation,i=n.location,c=(0,d.useTranslation)().t,g=null==i?void 0:i.uuid,m=(0,s.k9)(g);if(e)return u().createElement(u().Fragment,null);if(a)return u().createElement(r.jeF,{kind:"error",title:c("invalidLocationSpecified","Invalid location specified")});var b=m.id;return u().createElement("div",{className:o()(p.A.wardView,p.A.verticalTiling)},u().createElement(t.ExtensionSlot,{name:b}))}},35487:(n,e,a)=>{a.d(e,{Jk:()=>s,U1:()=>l,UG:()=>g,eD:()=>d,j3:()=>p,k9:()=>m,yZ:()=>u});var r=a(83437),t=a(90380),i=a(93150);function o(n,e){(null==e||e>n.length)&&(e=n.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=n[a];return r}function c(n){return function(n){if(Array.isArray(n))return o(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return o(n,e);var a=Object.prototype.toString.call(n).slice(8,-1);return"Object"===a&&n.constructor&&(a=n.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(n,e):void 0}}(n)||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 u(n){return{id:n.bedId,uuid:n.bedUuid,bedNumber:n.bedNumber,bedType:n.bedType,row:n.rowNumber,column:n.columnNumber,status:n.status}}function d(n,e){if(null==n||0==n.length)return{patients:"--",freeBeds:"--",capacity:"--"};var a,r=n.length,t=r-n.filter(function(n){return n.patients.length>0}).length,i=0!=r?Math.trunc(e.totalPatientsCount/r*100):0;return{patients:null!==(a=null==e?void 0:e.totalPatientsCount.toString())&&void 0!==a?a:"--",freeBeds:t.toString(),capacity:i.toString()}}function l(n,e,a,r,t){var i,o=function(n){var e=new Map,a=!0,r=!1,t=void 0;try{for(var i,o=(null!=n?n:[])[Symbol.iterator]();!(a=(i=o.next()).done);a=!0){var c=i.value;c&&e.set(c.patient.uuid,c)}}catch(n){r=!0,t=n}finally{try{a||null==o.return||o.return()}finally{if(r)throw t}}return e}(c(null!=n?n:[]).concat(c(null!=r?r:[]))),u=new Map,d=new Map,l=e&&function(n){var e=new Intl.Collator([],{numeric:!0});return n.bedLayouts.filter(function(n){return n.bedId}).sort(function(n,a){return e.compare(n.bedNumber,a.bedNumber)})}(e),s=new Set,p=0;null==l||l.map(function(n){n.patients.map(function(n){var e,a=o.get(n.uuid);if(s.add(n.uuid),(null==a||null===(e=a.currentInpatientLocation)||void 0===e?void 0:e.uuid)==t.uuid){var r;u.set(n.uuid,a);var i=null===(r=a.currentInpatientRequest)||void 0===r?void 0:r.dispositionType;"TRANSFER"!=i&&"DISCHARGE"!=i||p++}else d.set(n.uuid,n)})});var g=null!==(i=null==n?void 0:n.filter(function(n){return s.add(n.patient.uuid),!u.has(n.patient.uuid)&&!d.has(n.patient.uuid)}))&&void 0!==i?i:[],m=s.size,b=!0,f=!1,A=void 0;try{for(var v,w=(null!=a?a:[])[Symbol.iterator]();!(b=(v=w.next()).done);b=!0){var y=v.value;y&&s.add(y.patient.uuid)}}catch(n){f=!0,A=n}finally{try{b||null==w.return||w.return()}finally{if(f)throw A}}return{wardAdmittedPatientsWithBed:u,wardUnadmittedPatientsWithBed:d,wardPatientPendingCount:p,bedLayouts:l,wardUnassignedPatientsList:g,allWardPatientUuids:s,totalPatientsCount:m,inpatientAdmissionsByPatientUuid:o}}function s(n,e){switch(n){case"patients":return e("patients","Patients");case"freeBeds":return e("freeBeds","Free beds");case"capacity":return e("capacity","Capacity");case"pendingOut":return e("pendingOut","Pending out")}}function p(n,e,a){switch(n){case"patients":return e("patientsMetricValue","{{ metricValue }}",{metricValue:a});case"freeBeds":return e("freeBedsMetricValue","{{ metricValue }}",{metricValue:a});case"capacity":return e("capacityMetricValue","{{ metricValue }} %",{metricValue:a});case"pendingOut":return e("pendingOutMetricValue","{{ metricValue }}",{metricValue:a})}}function g(n,e){var a=(0,r.useConfig)(),t=(0,i.useTranslation)().t;try{var o,c;return null==a||null===(c=a.patientCardElements)||void 0===c||null===(o=c[n])||void 0===o?void 0:o.find(function(n){return(null==n?void 0:n.id)==e})}catch(a){return(0,r.showNotification)({title:t("errorConfiguringPatientCard","Error configuring patient card"),kind:"error",critical:!0,description:t("errorConfiguringPatientCardMessage","Unable to find configuration for {{elementType}}, id: {{id}}",{elementType:n,id:e})}),null}}function m(n){var e=(0,r.useConfig)().wards;return(0,t.useMemo)(function(){return null==e?void 0:e.find(function(e){var a;return null==e.appliedTo||0==(null===(a=e.appliedTo)||void 0===a?void 0:a.length)||e.appliedTo.some(function(e){return e.location==n})})},[e,n])||(console.warn("No ward card configuration has `appliedTo` criteria that matches the current location. Using the default configuration."),{id:"default-ward"})}},90102:(n,e,a)=>{a.d(e,{A:()=>A});var r=a(72591),t=a.n(r),i=a(1740),o=a.n(i),c=a(88128),u=a.n(c),d=a(30855),l=a.n(d),s=a(93051),p=a.n(s),g=a(73656),m=a.n(g),b=a(19108),f={};f.styleTagTransform=m(),f.setAttributes=l(),f.insert=u().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),t()(b.A,f);const A=b.A&&b.A.locals?b.A.locals:void 0},92891:(n,e,a)=>{a.d(e,{A:()=>c});var r=a(83437),t=a(8877),i=a(88010),o=a.n(i);function c(){var n=(0,t.useParams)().locationUuid,e=(0,r.useSession)().sessionLocation,a=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom:(display,uuid)";return o()(n?"".concat(r.restBaseUrl,"/location/").concat(n,"?v=").concat(e):null,r.openmrsFetch)}(n||null),i=a.data,c=a.isLoading,u=a.error,d=n&&u;return{location:n?null==i?void 0:i.data:e,isLoadingLocation:c,errorFetchingLocation:u,invalidLocation:d}}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([[7524],{19108:(n,e,a)=>{a.d(e,{A:()=>c});var r=a(30977),t=a.n(r),i=a(95924),o=a.n(i)()(t());o.push([n.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-ward__ward-view__wardView___FbpB2{background-color:#e4e4e4;display:flex;flex-direction:column;padding:0 1rem}.-esm-ward__ward-view__wardView___FbpB2.-esm-ward__ward-view__verticalTiling___As-Jz{height:calc(100vh - var(--omrs-topnav-height))}.-esm-ward__ward-view__wardViewMain___jYzEv{background-color:#e4e4e4;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));display:grid;gap:1rem}.-esm-ward__ward-view__wardViewMain___jYzEv.-esm-ward__ward-view__verticalTiling___As-Jz{display:block;column-width:280px;overflow-x:auto;height:calc(100% - 4rem)}.-esm-ward__ward-view__wardViewMain___jYzEv.-esm-ward__ward-view__verticalTiling___As-Jz>div{break-inside:avoid;margin-bottom:10px}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/ward-view/ward-view.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DF,wCACE,wBAAA,CACA,YAAA,CACA,qBAAA,CACA,cAAA,CAEA,qFACE,8CAAA,CAIJ,4CACE,wBAAA,CACA,2DAAA,CACA,YAAA,CACA,QCaW,CDXX,yFACE,aAAA,CACA,kBAAA,CACA,eAAA,CACA,wBAAA,CAEA,6FACE,kBAAA,CACA,kBAAA",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.wardView {\n background-color: #e4e4e4;\n display: flex;\n flex-direction: column;\n padding: 0 layout.$spacing-05;\n\n &.verticalTiling {\n height: calc(100vh - var(--omrs-topnav-height));\n }\n}\n\n.wardViewMain {\n background-color: #e4e4e4;\n grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n display: grid;\n gap: layout.$spacing-05;\n\n &.verticalTiling {\n display: block;\n column-width: 280px;\n overflow-x: auto;\n height: calc(100% - 4rem);\n\n > div {\n break-inside: avoid;\n margin-bottom: 10px;\n }\n }\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),o.locals={wardView:"-esm-ward__ward-view__wardView___FbpB2",verticalTiling:"-esm-ward__ward-view__verticalTiling___As-Jz",wardViewMain:"-esm-ward__ward-view__wardViewMain___jYzEv"};const c=o},27524:(n,e,a)=>{a.r(e),a.d(e,{default:()=>g});var r=a(90317),t=a(54440),i=a(53373),o=a.n(i),c=a(90380),u=a.n(c),d=a(93150),l=a(92891),s=a(35487),p=a(90102);const g=function(){var n=(0,l.A)(),e=n.isLoadingLocation,a=n.invalidLocation,i=n.location,c=(0,d.useTranslation)().t,g=null==i?void 0:i.uuid,m=(0,s.k9)(g);if(e)return u().createElement(u().Fragment,null);if(a)return u().createElement(r.jeF,{kind:"error",title:c("invalidLocationSpecified","Invalid location specified")});var b=m.id;return u().createElement("div",{className:o()(p.A.wardView,p.A.verticalTiling)},u().createElement(t.ExtensionSlot,{name:b}))}},35487:(n,e,a)=>{a.d(e,{Jk:()=>s,U1:()=>l,UG:()=>g,eD:()=>d,j3:()=>p,k9:()=>m,yZ:()=>u});var r=a(54440),t=a(90380),i=a(93150);function o(n,e){(null==e||e>n.length)&&(e=n.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=n[a];return r}function c(n){return function(n){if(Array.isArray(n))return o(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return o(n,e);var a=Object.prototype.toString.call(n).slice(8,-1);return"Object"===a&&n.constructor&&(a=n.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(n,e):void 0}}(n)||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 u(n){return{id:n.bedId,uuid:n.bedUuid,bedNumber:n.bedNumber,bedType:n.bedType,row:n.rowNumber,column:n.columnNumber,status:n.status}}function d(n,e){if(null==n||0==n.length)return{patients:"--",freeBeds:"--",capacity:"--"};var a,r=n.length,t=r-n.filter(function(n){return n.patients.length>0}).length,i=0!=r?Math.trunc(e.totalPatientsCount/r*100):0;return{patients:null!==(a=null==e?void 0:e.totalPatientsCount.toString())&&void 0!==a?a:"--",freeBeds:t.toString(),capacity:i.toString()}}function l(n,e,a,r,t){var i,o=function(n){var e=new Map,a=!0,r=!1,t=void 0;try{for(var i,o=(null!=n?n:[])[Symbol.iterator]();!(a=(i=o.next()).done);a=!0){var c=i.value;c&&e.set(c.patient.uuid,c)}}catch(n){r=!0,t=n}finally{try{a||null==o.return||o.return()}finally{if(r)throw t}}return e}(c(null!=n?n:[]).concat(c(null!=r?r:[]))),u=new Map,d=new Map,l=e&&function(n){var e=new Intl.Collator([],{numeric:!0});return n.bedLayouts.filter(function(n){return n.bedId}).sort(function(n,a){return e.compare(n.bedNumber,a.bedNumber)})}(e),s=new Set,p=0;null==l||l.map(function(n){n.patients.map(function(n){var e,a=o.get(n.uuid);if(s.add(n.uuid),(null==a||null===(e=a.currentInpatientLocation)||void 0===e?void 0:e.uuid)==t.uuid){var r;u.set(n.uuid,a);var i=null===(r=a.currentInpatientRequest)||void 0===r?void 0:r.dispositionType;"TRANSFER"!=i&&"DISCHARGE"!=i||p++}else d.set(n.uuid,n)})});var g=null!==(i=null==n?void 0:n.filter(function(n){return s.add(n.patient.uuid),!u.has(n.patient.uuid)&&!d.has(n.patient.uuid)}))&&void 0!==i?i:[],m=s.size,b=!0,f=!1,A=void 0;try{for(var v,w=(null!=a?a:[])[Symbol.iterator]();!(b=(v=w.next()).done);b=!0){var y=v.value;y&&s.add(y.patient.uuid)}}catch(n){f=!0,A=n}finally{try{b||null==w.return||w.return()}finally{if(f)throw A}}return{wardAdmittedPatientsWithBed:u,wardUnadmittedPatientsWithBed:d,wardPatientPendingCount:p,bedLayouts:l,wardUnassignedPatientsList:g,allWardPatientUuids:s,totalPatientsCount:m,inpatientAdmissionsByPatientUuid:o}}function s(n,e){switch(n){case"patients":return e("patients","Patients");case"freeBeds":return e("freeBeds","Free beds");case"capacity":return e("capacity","Capacity");case"pendingOut":return e("pendingOut","Pending out")}}function p(n,e,a){switch(n){case"patients":return e("patientsMetricValue","{{ metricValue }}",{metricValue:a});case"freeBeds":return e("freeBedsMetricValue","{{ metricValue }}",{metricValue:a});case"capacity":return e("capacityMetricValue","{{ metricValue }} %",{metricValue:a});case"pendingOut":return e("pendingOutMetricValue","{{ metricValue }}",{metricValue:a})}}function g(n,e){var a=(0,r.useConfig)(),t=(0,i.useTranslation)().t;try{var o,c;return null==a||null===(c=a.patientCardElements)||void 0===c||null===(o=c[n])||void 0===o?void 0:o.find(function(n){return(null==n?void 0:n.id)==e})}catch(a){return(0,r.showNotification)({title:t("errorConfiguringPatientCard","Error configuring patient card"),kind:"error",critical:!0,description:t("errorConfiguringPatientCardMessage","Unable to find configuration for {{elementType}}, id: {{id}}",{elementType:n,id:e})}),null}}function m(n){var e=(0,r.useConfig)().wards;return(0,t.useMemo)(function(){return null==e?void 0:e.find(function(e){var a;return null==e.appliedTo||0==(null===(a=e.appliedTo)||void 0===a?void 0:a.length)||e.appliedTo.some(function(e){return e.location==n})})},[e,n])||(console.warn("No ward card configuration has `appliedTo` criteria that matches the current location. Using the default configuration."),{id:"default-ward"})}},90102:(n,e,a)=>{a.d(e,{A:()=>A});var r=a(72591),t=a.n(r),i=a(1740),o=a.n(i),c=a(88128),u=a.n(c),d=a(30855),l=a.n(d),s=a(93051),p=a.n(s),g=a(73656),m=a.n(g),b=a(19108),f={};f.styleTagTransform=m(),f.setAttributes=l(),f.insert=u().bind(null,"head"),f.domAPI=o(),f.insertStyleElement=p(),t()(b.A,f);const A=b.A&&b.A.locals?b.A.locals:void 0},92891:(n,e,a)=>{a.d(e,{A:()=>c});var r=a(54440),t=a(8877),i=a(88010),o=a.n(i);function c(){var n=(0,t.useParams)().locationUuid,e=(0,r.useSession)().sessionLocation,a=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom:(display,uuid)";return o()(n?"".concat(r.restBaseUrl,"/location/").concat(n,"?v=").concat(e):null,r.openmrsFetch)}(n||null),i=a.data,c=a.isLoading,u=a.error,d=n&&u;return{location:n?null==i?void 0:i.data:e,isLoadingLocation:c,errorFetchingLocation:u,invalidLocation:d}}}}]);
|