@openmrs/esm-ward-app 11.1.1-pre.9898 → 11.1.1-pre.9902
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 +1 -1
- package/dist/1364.js +1 -1
- package/dist/1664.js +1 -1
- package/dist/1780.js +1 -1
- package/dist/2008.js +1 -1
- package/dist/2101.js +1 -1
- package/dist/2495.js +1 -1
- package/dist/2973.js +1 -1
- package/dist/3560.js +1 -1
- package/dist/388.js +1 -1
- package/dist/412.js +1 -1
- package/dist/502.js +1 -1
- package/dist/5296.js +1 -1
- package/dist/582.js +1 -1
- package/dist/6703.js +1 -1
- package/dist/6802.js +1 -1
- package/dist/7249.js +1 -1
- package/dist/833.js +1 -1
- package/dist/8340.js +1 -1
- package/dist/8424.js +1 -1
- package/dist/8493.js +1 -1
- package/dist/9080.js +1 -1
- package/dist/9427.js +1 -1
- package/dist/9471.js +1 -1
- package/dist/992.js +1 -1
- package/dist/9983.js +1 -1
- package/dist/openmrs-esm-ward-app.js +2 -2
- package/dist/openmrs-esm-ward-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
package/dist/1364.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["1364"],{3313(e,a,t){t.r(a),t.d(a,{default:()=>c});var s=t(7125),r=t.n(s),n=t(5921),l=t(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["1364"],{3313(e,a,t){t.r(a),t.d(a,{default:()=>c});var s=t(7125),r=t.n(s),n=t(5921),l=t(3422),i=t(7895),p=t(1378);let c=({workspaceProps:{wardPatient:e,relatedTransferPatients:a},closeWorkspace:t})=>{let{t:s}=(0,n.useTranslation)(),c="TRANSFER"===e.inpatientRequest.dispositionType;return r().createElement(l.Workspace2,{title:c?s("transferElsewhere","Transfer elsewhere"):s("admitElsewhere","Admit elsewhere")},r().createElement("div",{className:"-esm-ward__patient-transfer-request__patientTransferRequestWorkspace___UsUgV"},r().createElement(p.default,{wardPatient:e}),a?.map(e=>r().createElement(p.default,{key:e.patient.uuid,wardPatient:e})),r().createElement(i.A,{wardPatient:e,relatedTransferPatients:a,onSuccess:async()=>{await t({discardUnsavedChanges:!0}),(0,l.closeWorkspaceGroup2)()},onCancel:()=>t(),preSelectRelatedPatients:!0})))}}}]);
|
package/dist/1664.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["1664"],{9235(e,a,n){n.r(a),n.d(a,{default:()=>p});var t=n(7125),r=n.n(t),s=n(5921),o=n(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["1664"],{9235(e,a,n){n.r(a),n.d(a,{default:()=>p});var t=n(7125),r=n.n(t),s=n(5921),o=n(3422);function p(){let{t:e}=(0,s.useTranslation)();return r().createElement(o.ActionMenuButton2,{icon:e=>r().createElement(o.UserAvatarIcon,e),label:e("patient","Patient"),workspaceToLaunch:{workspaceName:"ward-patient-workspace"}})}}}]);
|
package/dist/1780.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["1780"],{866(e,t,n){n.d(t,{A:()=>a});let a={occupiedBed:"-esm-ward__ward-bed__occupiedBed___B0eph",emptyBed:"-esm-ward__ward-bed__emptyBed___NNt7-",skeleton:"-esm-ward__ward-bed__skeleton___UvR9H",emptyBedText:"-esm-ward__ward-bed__emptyBedText___7Ipj7"}},3356(e,t,n){n.d(t,{A:()=>a});let a={wardPatientCard:"-esm-ward__ward-patient-card__wardPatientCard___NjMVe",wardPatientCardButton:"-esm-ward__ward-patient-card__wardPatientCardButton___Xw-ov",activeWardPatientCardButton:"-esm-ward__ward-patient-card__activeWardPatientCardButton___jp465",wardPatientCardRow:"-esm-ward__ward-patient-card__wardPatientCardRow___O-Jht",wardPatientCardPendingItemsRow:"-esm-ward__ward-patient-card__wardPatientCardPendingItemsRow___MzSq2",wardPatientPendingOrdersRow:"-esm-ward__ward-patient-card__wardPatientPendingOrdersRow___rRApd",wardPatientCardExtensionSlot:"-esm-ward__ward-patient-card__wardPatientCardExtensionSlot___WvNzG",wardPatientCardHeader:"-esm-ward__ward-patient-card__wardPatientCardHeader___5a47N",wardPatientCardHeaderBadge:"-esm-ward__ward-patient-card__wardPatientCardHeaderBadge___xnMNB",wardPatientCardDispositionTypeContainer:"-esm-ward__ward-patient-card__wardPatientCardDispositionTypeContainer___yNAdL",wardPatientName:"-esm-ward__ward-patient-card__wardPatientName___w0ALg",wardPatientBedNumber:"-esm-ward__ward-patient-card__wardPatientBedNumber___dxTfe",empty:"-esm-ward__ward-patient-card__empty___fjKgf",bedNumberBox:"-esm-ward__ward-patient-card__bedNumberBox___IUQwS",movementIcon:"-esm-ward__ward-patient-card__movementIcon___D2yrt",cancelTransferRequestButton:"-esm-ward__ward-patient-card__cancelTransferRequestButton___K2Amt",chemistryReferenceIcon:"-esm-ward__ward-patient-card__chemistryReferenceIcon___+cAiI",wardPatientAddress:"-esm-ward__ward-patient-card__wardPatientAddress___4G9m6",wardPatientObsLabel:"-esm-ward__ward-patient-card__wardPatientObsLabel___XO4yd",responsiveTooltip:"-esm-ward__ward-patient-card__responsiveTooltip___p-jmt",dotSeparatedChildren:"-esm-ward__ward-patient-card__dotSeparatedChildren___OdHvX",skeletonText:"-esm-ward__ward-patient-card__skeletonText___E6V6B",unassignedPatient:"-esm-ward__ward-patient-card__unassignedPatient___XyiyN"}},7104(e,t,n){n.d(t,{A:()=>a});let a={wardView:"-esm-ward__ward-view__wardView___rT-JC",verticalTiling:"-esm-ward__ward-view__verticalTiling___L+wuj",wardViewMain:"-esm-ward__ward-view__wardViewMain___8CJRz"}},6377(e,t,n){n.d(t,{A:()=>a});let a={admissionRequestCard:"-esm-ward__admission-request-card__admissionRequestCard___iwYkp",admissionRequestCardHeaderContainer:"-esm-ward__admission-request-card__admissionRequestCardHeaderContainer___Nyxcv",admissionRequestCardHeaderBadge:"-esm-ward__admission-request-card__admissionRequestCardHeaderBadge___NzLS2",admissionRequestCardHeader:"-esm-ward__admission-request-card__admissionRequestCardHeader___feIpm",admissionRequestCardExtensionSlot:"-esm-ward__admission-request-card__admissionRequestCardExtensionSlot___TIVve",admissionEncounterDetails:"-esm-ward__admission-request-card__admissionEncounterDetails___MnhYg",admissionRequestActionBar:"-esm-ward__admission-request-card__admissionRequestActionBar___Yt4EL"}},4808(e,t,n){n.d(t,{A:()=>p});var a=n(7125),r=n.n(a),i=n(866),s=n(3356),d=n(5921);let o=({bed:e})=>{let{t}=(0,d.useTranslation)();return r().createElement("div",{id:`bed-${e.bedNumber}`,className:i.A.emptyBed},r().createElement("span",{className:`${s.A.wardPatientBedNumber} ${s.A.empty}`},e.bedNumber),r().createElement("p",{className:i.A.emptyBedText},t("emptyBed","Empty bed")))};var l=n(5910);let u="-esm-ward__bed-share-divider__bedDividerLine___BSKFi",c=({isLoading:e})=>{let{t}=(0,d.useTranslation)();return r().createElement("div",{className:"-esm-ward__bed-share-divider__bedDivider___UR6jR"},r().createElement("div",{className:u}),e?r().createElement(l.SkeletonText,null):r().createElement(l.Tag,null,t("bedShare","Bed share")),r().createElement("div",{className:u}))},m=({patientCards:e,isLoadingDivider:t,bed:n})=>{let a=e.flatMap((e,n)=>0===n?[e]:[r().createElement(c,{key:`divider-${n}`,isLoading:t}),e]);return r().createElement("div",{id:`bed-${n.bedNumber}`,className:i.A.occupiedBed},a)},p=e=>{let{bed:t,patientCards:n}=e;return n?.length>0?r().createElement(m,e):r().createElement(o,{bed:t})}},3724(e,t,n){n.d(t,{A:()=>o});var a=n(2895),r=n(7125),i=n(4498),s=n.n(i);let d=`custom:${[["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(e=>e.join(":")).join(",")}`;function o(){let e=s()(`${a.restBaseUrl}/emrapi/configuration?v=${d}`,a.openmrsFetch);return(0,r.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}},160(e,t,n){n.d(t,{k:()=>r});var a=n(2895);function r(e){let t=e?.length>0,n=new URLSearchParams;for(let t of(n.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,)"),e??[]))n.append("patients",t);return(0,a.useOpenmrsFetchAll)(t?`${a.restBaseUrl}/emrapi/inpatient/admission?${n.toString()}`:null)}},3102(e,t,n){n.d(t,{e:()=>r});var a=n(2895);function r(e,t=!0,n="default"){let i=new URLSearchParams({...e,v:n}),s=`${a.restBaseUrl}/obs?${i}`;return(0,a.useOpenmrsFetchAll)(t?s:null)}},9656(e,t,n){n.d(t,{A:()=>d});var a=n(2895),r=n(2745),i=n(4498),s=n.n(i);function d(){let{locationUuid:e}=(0,r.useParams)(),{sessionLocation:t}=(0,a.useSession)(),{data:n,isLoading:i,error:d}=function(e,t="custom:(display,uuid)"){return s()(e?`${a.restBaseUrl}/location/${e}?v=${t}`:null,a.openmrsFetch)}(e||null),o=e&&d;return{location:e?n?.data:t,isLoadingLocation:i,errorFetchingLocation:d,invalidLocation:o}}},2488(e,t,n){n.d(t,{u:()=>u});var a=n(7125),r=n(9900),i=n(2895),s=n(8909),d=n.n(s),o=n(9656),l=n(160);function u(){let e=function(e="custom:(ward,totalBeds,occupiedBeds,bedLayouts:(rowNumber,columnNumber,bedNumber,bedId,bedUuid,status,location,patients:(person:full,identifiers,uuid)))"){let{location:t}=(0,o.A)(),n=(0,i.useFeatureFlag)("bedmanagement-module"),a=t?.uuid?`${i.restBaseUrl}/admissionLocation/${t?.uuid}?v=${e}`:null,{data:r,...s}=d()(n?a:null,i.openmrsFetch);return{admissionLocation:r?.data,...s}}(),t=function(){let{location:e}=(0,o.A)();return(0,i.useOpenmrsFetchAll)(e?`${i.restBaseUrl}/emrapi/inpatient/admission?currentInpatientLocation=${e.uuid}&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,)`:null)}(),n=function(e=["ADMIT","TRANSFER"],t="custom:(dispositionLocation,dispositionType,disposition,dispositionEncounter:full,patient:(uuid,identifiers,voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate)),dispositionObsGroup,visit)"){let{location:n}=(0,o.A)(),a=new URLSearchParams;a.set("dispositionType",e.join(",")),a.set("dispositionLocation",n?.uuid),a.set("v",t);let{data:r,...s}=(0,i.useOpenmrsFetchAll)(n?.uuid?`${i.restBaseUrl}/emrapi/inpatient/request?${a.toString()}`:null);return{inpatientRequests:r,...s}}(),{location:s}=(0,o.A)(),{data:u}=t,{admissionLocation:c}=e,{inpatientRequests:m}=n,p=(0,a.useMemo)(()=>{if(!c||!u||!m)return null;{let e=new Set;for(let t of c.bedLayouts)for(let n of t.patients)e.add(n.uuid);for(let t of m)e.add(t.patient.uuid);for(let t of u)e.delete(t.patient.uuid);return e}},[c,u,m]),_=(0,l.k)(p?Array.from(p):null),{data:f}=_;return{...(0,a.useMemo)(()=>({...(0,r.U1)(u,c,m,f,s)}),[c,u,m,f,s]),admissionLocationResponse:e,inpatientAdmissionResponse:t,inpatientRequestResponse:n,isLoading:e.isLoading||t.isLoading||n.isLoading||_.isLoading,async mutate(){await Promise.all([e?.mutate?.(),t?.mutate?.(),n?.mutate?.(),_?.mutate?.()])}}}},5084(e,t,n){n.d(t,{d:()=>r});var a,r=((a={}).PATIENTS="patients",a.FREE_BEDS="freeBeds",a.TOTAL_BEDS="totalBeds",a.PENDING_OUT="pendingOut",a.FEMALES_OF_REPRODUCTIVE_AGE="femalesOfReproductiveAge",a.NEWBORNS="newborns",a)},103(e,t,n){n.d(t,{A:()=>o});var a=n(7125),r=n.n(a),i=n(9900),s=n(3743),d=n(3356);let o=({id:e,wardPatient:t})=>{let{patient:n,visit:a,inpatientAdmission:o}=t,{conceptUuid:l}=(0,i.UG)("admissionRequestNote",e)??{};return null!=o?null:r().createElement("div",{className:d.A.wardPatientCardRow},r().createElement(s.A,{id:e,configOverride:{conceptUuid:l,limit:0,id:"admission-note",onlyWithinCurrentVisit:!0,orderBy:"ascending",label:"Admission Note"},patient:n,visit:a}))}},6213(e,t,n){n.d(t,{A:()=>o});var a=n(7125),r=n.n(a),i=n(9656),s=n(5910),d=n(5921);let o=({wardPatient:e})=>{let{location:t}=(0,i.A)(),{t:n}=(0,d.useTranslation)(),{visit:a,inpatientAdmission:o}=e;return a?o?o.currentInpatientLocation.uuid!==t?.uuid?r().createElement(s.InlineNotification,{hideCloseButton:!0,kind:"warning",lowContrast:!0,title:n("admittedTo","Admitted to {{locationName}}",{locationName:o.currentInpatientLocation.display})}):null:r().createElement(s.InlineNotification,{hideCloseButton:!0,kind:"warning",lowContrast:!0,title:n("noAdmission","No admission found")}):r().createElement(s.InlineNotification,{hideCloseButton:!0,kind:"warning",lowContrast:!0,title:n("noActiveVisit","No active visit")})}},5001(e,t,n){n.d(t,{A:()=>g});var a=n(7125),r=n.n(a),i=n(3760),s=n(9900),d=n(529),o=n(3356),l=n(5921),u=n(2895),c=n(8909),m=n.n(c);let p=({wardPatient:e,orderUuid:t,label:n,onOrderCount:i})=>{let{t:s}=(0,l.useTranslation)(),{count:c,isLoading:p}=function(e,t,n){let a=e&&t&&n?`${u.restBaseUrl}/order?includeNullFulfillerStatus=true&patient=${e}&orderTypes=${t}&activatedOnOrAfterDate=${n}&excludeCanceledAndExpired=true&excludeDiscontinueOrders=true`:null,{data:r,...i}=m()(a,u.openmrsFetch);return{orders:r?.data.results,count:r?.data.results.length,...i}}(e?.patient?.uuid,t,e?.visit?.startDatetime.split("T")[0]);if((0,a.useEffect)(()=>{p||i(c)},[c,p,i]),p||!c||0===c)return null;let _=n?s(n):s("Orders","Orders");return r().createElement("div",{className:o.A.wardPatientCardDispositionTypeContainer},r().createElement(d.u$,{className:o.A.chemistryReferenceIcon,size:"24"}),c," ",_)};var _=n(5910),f=n(8537);let w=({wardPatient:e})=>{let{t}=(0,l.useTranslation)(),{dispositionType:n,dispositionLocation:i}=e?.inpatientRequest,s=(0,a.useMemo)(()=>"TRANSFER"===n?i?t("transferToDispositionLocation","Transfer to {{location}}",{location:i.name}):t("pendingTransfer","Pending Transfer"):"DISCHARGE"===n?t("pendingDischarge","Pending Discharge"):"",[n,i,t]);return"TRANSFER"!==n&&"DISCHARGE"!==n?null:r().createElement("div",{className:o.A.wardPatientCardDispositionTypeContainer},r().createElement(f.yG,{className:o.A.movementIcon,size:24}),s,r().createElement(_.IconButton,{label:t("cancel","Cancel"),kind:"secondary",className:o.A.cancelTransferRequestButton,size:"sm",onClick:()=>{(0,u.launchWorkspace2)("ward-patient-cancel-admission-request-workspace",{},{},{wardPatient:e})}},r().createElement(u.CloseOutlineIcon,null)))},g=({id:e,wardPatient:t})=>{let{orders:n,showPendingItems:d}=(0,s.UG)("pendingItems",e)||{},[l,u]=(0,a.useState)(!1),c=!!t?.inpatientRequest||l,m=(0,a.useCallback)(e=>{e>0&&u(!0)},[]);return(0,a.useEffect)(()=>{n?.orderTypes?.length||u(!1)},[n]),r().createElement("div",{className:o.A.wardPatientCardPendingItemsRow},d&&c?r().createElement(r().Fragment,null,r().createElement(i.Dx,{className:o.A.hourGlassIcon,size:"16"}),":"):null,n?.orderTypes.map(({uuid:e,label:n})=>r().createElement(p,{key:`pending-order-type-${e}`,wardPatient:t,orderUuid:e,label:n,onOrderCount:m})),t?.inpatientRequest?r().createElement(w,{wardPatient:t}):null)}},2332(e,t,n){n.d(t,{A:()=>s});var a=n(2895),r=n(7125),i=n.n(r);let s=({patient:e})=>e.person?.birthdate?i().createElement("div",null,(0,a.age)(e.person.birthdate)):null},5174(e,t,n){n.d(t,{A:()=>s});var a=n(7125),r=n.n(a),i=n(3356);let s=({bed:e})=>e?r().createElement("div",{className:i.A.bedNumberBox},r().createElement("span",{className:i.A.wardPatientBedNumber},e.bedNumber)):r().createElement(r().Fragment,null)},5e3(e,t,n){n.d(t,{A:()=>s});var a=n(7125),r=n.n(a),i=n(5921);let s=({patient:e})=>{let{t}=(0,i.useTranslation)();return r().createElement("div",null,((e,t)=>{switch(t){case"M":return e("male","Male");case"F":return e("female","Female");case"O":return e("other","Other");case"unknown":return e("unknown","Unknown");default:return t}})(t,e?.person?.gender))}},8768(e,t,n){n.d(t,{A:()=>d});var a=n(7125),r=n.n(a),i=n(2895),s=n(9900);let d=({id:e,patient:t})=>{let n=(0,s.UG)("patientIdentifier",e),a=t.identifiers.map(e=>({value:e.identifier,type:{text:e.identifierType.name,coding:[{code:e.identifierType.uuid}]}}));return r().createElement("div",{className:"-esm-ward__ward-patient-identifier__wardPatientIdentifierWrapper___Cjt9t"},r().createElement(i.PatientBannerPatientIdentifiers,{identifiers:a,showIdentifierLabel:n?.showIdentifierLabel}))}},9474(e,t,n){n.d(t,{A:()=>s});var a=n(7125),r=n.n(a),i=n(3356);let s=({patient:e})=>r().createElement("div",{className:i.A.wardPatientName},e?.person?.preferredName?.display)},3743(e,t,n){n.d(t,{A:()=>m});var a=n(7125),r=n.n(a),i=n(3672),s=n(5910),d=n(5921),o=n(3102),l=n(9900),u=n(4267),c=n(3356);let m=({id:e,configOverride:t,patient:n,visit:a})=>{let m=(0,l.UG)("obs",e),{conceptUuid:p,onlyWithinCurrentVisit:_,orderBy:f,limit:w,label:g}=t??m??{},{data:E,isLoading:A}=(0,o.e)({patient:n.uuid,concept:p},null!=p,i.Fx),{t:T}=(0,d.useTranslation)();if(A)return r().createElement(s.SkeletonText,null);{let e=E?.filter(e=>!_||e.encounter.visit?.uuid===a?.uuid)?.sort((e,t)=>("descending"===f?-1:1)*e.obsDatetime.localeCompare(t.obsDatetime))?.slice(0,0===w?Number.MAX_VALUE:w),t=null!=g?T(g):e?.[0]?.concept?.display,n=e?.map(e=>{let{value:t}=e,n=t?.display??String(t),a=(0,i.Fe)(e,T);return r().createElement(u.A,{key:e.uuid,tooltipContent:a},r().createElement("span",{title:a},n," "))});return n?.length>0?r().createElement("div",null,r().createElement("span",{className:c.A.wardPatientObsLabel},t?T("labelColon","{{label}}:",{label:t}):""),r().createElement("div",{className:c.A.dotSeparatedChildren},n)):null}}},3672(e,t,n){n.d(t,{Fe:()=>s,Fx:()=>r,uk:()=>i});var a=n(2895);let r="custom:(uuid,display,obsDatetime,value,concept:(uuid,display),encounter:(uuid,display,encounterType,encounterDatetime,visit:(uuid,display)))";function i(e=[]){let t=new Map;for(let n of e){let{color:e,appliedToConceptSets:a}=n;for(let n of a??[])t.has(n)||t.set(n,e)}let n=e.flatMap(e=>e.appliedToConceptSets),r=`${a.restBaseUrl}/concept?references=${n.join()}&v=custom:(uuid,setMembers:(uuid))`,{data:s}=(0,a.useOpenmrsFetchAll)(r),d=new Map;if(s)for(let e of s)for(let n of e.setMembers)d.has(n.uuid)||d.set(n.uuid,t.get(e.uuid));return d}function s(e,t){return t("encounterDisplay","{{encounterType}} {{encounterDate}}",{encounterType:e.encounter.encounterType.display,encounterDate:new Date(e.encounter.encounterDatetime).toLocaleDateString(),interpolation:{escapeValue:!1}})}},4267(e,t,n){n.d(t,{A:()=>o});var a=n(5910),r=n(2895),i=n(7125),s=n.n(i),d=n(3356);let o=({children:e,tooltipContent:t})=>{let n=(0,r.useLayoutType)();return(0,r.isDesktop)(n)?s().createElement(a.Tooltip,{description:t,className:d.A.responsiveTooltip},s().createElement("span",null,e)):s().createElement(a.Toggletip,{className:d.A.responsiveTooltip},s().createElement(a.ToggletipButton,null,e),s().createElement(a.ToggletipContent,null,t))}},9390(e,t,n){n.d(t,{A:()=>d});var a=n(5910),r=n(7125),i=n.n(r),s=n(3356);let d=()=>i().createElement(a.SkeletonIcon,{className:s.A.skeletonText})},5965(e,t,n){n.d(t,{A:()=>u});var a=n(7125),r=n.n(a),i=n(3464),s=n.n(i),d=n(279),o=n.n(d),l=n(5921);s().extend(o());let u=({encounterAssigningToCurrentInpatientLocation:e})=>{let{t}=(0,l.useTranslation)();if(!e?.encounterDatetime)return null;let n=s().duration(s()().diff(e.encounterDatetime)),a=Math.floor(n.asDays()),i=n.hours(),d=n.minutes(),o=n.seconds(),u=[];return(a>0&&u.push(t("days",{count:a,defaultValue_one:"{{count}} day",defaultValue_other:"{{count}} days"})),i>0&&u.push(t("hours",{count:i,defaultValue_one:"{{count}} hour",defaultValue_other:"{{count}} hours"})),d>0&&u.push(t("minutes",{count:d,defaultValue_one:"{{count}} minute",defaultValue_other:"{{count}} minutes"})),o>0&&0===u.length&&u.push(t("seconds",{count:o,defaultValue_one:"{{count}} second",defaultValue_other:"{{count}} seconds"})),0===u.length)?null:r().createElement("div",null,t("timeOnWard","Time on this ward: {{timeOnWard}}",{timeOnWard:u.join(" ")}))}},7781(e,t,n){n.d(t,{A:()=>m});var a=n(7125),r=n.n(a),i=n(3464),s=n.n(i),d=n(279),o=n.n(d),l=n(5562),u=n.n(l),c=n(5921);s().extend(o()),s().extend(u());let m=({firstAdmissionOrTransferEncounter:e})=>{let{t}=(0,c.useTranslation)();if(!e)return null;let n=s()(e.encounterDatetime).fromNow();return r().createElement("div",null,t("timeSinceAdmission","Admitted: {{timeSinceAdmission}}",{timeSinceAdmission:n}))}},8080(e,t,n){n.d(t,{A:()=>d});var a=n(7125),r=n.n(a),i=n(2895),s=n(3356);let d=({children:e,wardPatient:t,relatedTransferPatients:n})=>{let{patient:a}=t;return r().createElement("div",{className:s.A.wardPatientCard},e,r().createElement("button",{className:s.A.wardPatientCardButton,onClick:()=>{(0,i.launchWorkspace2)("ward-patient-workspace",{},{},{wardPatient:t,relatedTransferPatients:n})}},(0,i.getPatientName)(a.person)))}},875(e,t,n){n.d(t,{A:()=>c});var a=n(2895),r=n(7125),i=n.n(r),s=n(5921),d=n(5084),o=n(9900),l=n(5910);let u=({metricName:e,metricValue:t,isLoading:n})=>i().createElement("div",{className:"-esm-ward__ward-metric__metric___b1Tcz"},i().createElement("span",{className:"-esm-ward__ward-metric__metricName___YEKn3"},e),n?i().createElement(l.SkeletonPlaceholder,{className:"-esm-ward__ward-metric__skeleton___qjeUd"}):i().createElement("span",{className:"-esm-ward__ward-metric__metricValue___c3LvS"},t)),c=({metrics:e=[d.d.PATIENTS,d.d.FREE_BEDS,d.d.TOTAL_BEDS,d.d.PENDING_OUT]})=>{let{t}=(0,s.useTranslation)(),n=(0,a.useFeatureFlag)("bedmanagement-module"),{wardPatientGroupDetails:l}=(0,a.useAppContext)("ward-view-context")??{},{admissionLocationResponse:c,inpatientAdmissionResponse:m,inpatientRequestResponse:p}=l||{},{isLoading:_,error:f}=c??{},w=c?.isLoading||m?.isLoading||p?.isLoading,g=(0,r.useMemo)(()=>l?(0,o.eD)(l):{},[l]);return l?(f&&(0,a.showNotification)({kind:"error",title:t("errorLoadingBedDetails","Error loading bed details"),description:f.message}),i().createElement("div",{className:"-esm-ward__ward-metrics__metricsContainer___65Spn"},e.includes(d.d.PATIENTS)&&i().createElement(u,{metricName:(0,o.Jk)("patients",t),metricValue:g.patients??"--",isLoading:!1,key:"patients"}),e.includes(d.d.FEMALES_OF_REPRODUCTIVE_AGE)&&g.femalesOfReproductiveAge&&"0"!==g.femalesOfReproductiveAge&&i().createElement(u,{metricName:(0,o.Jk)("femalesOfReproductiveAge",t),metricValue:g.femalesOfReproductiveAge??"--",isLoading:!!_||!!w,key:"femalesOfReproductiveAge"}),e.includes(d.d.NEWBORNS)&&g.newborns&&"0"!==g.newborns&&i().createElement(u,{metricName:(0,o.Jk)("newborns",t),metricValue:g.newborns??"--",isLoading:!!_||!!w,key:"newborns"}),n&&i().createElement(i().Fragment,null,e.includes(d.d.FREE_BEDS)&&i().createElement(u,{metricName:(0,o.Jk)("freeBeds",t),metricValue:g.freeBeds??"--",isLoading:!!_||!!w,key:"freeBeds"}),e.includes(d.d.TOTAL_BEDS)&&i().createElement(u,{metricName:(0,o.Jk)("totalBeds",t),metricValue:g.totalBeds??"--",isLoading:!!_||!!w,key:"totalBeds"}),e.includes(d.d.PENDING_OUT)&&i().createElement(u,{metricName:(0,o.Jk)("pendingOut",t),metricValue:f?"--":l?.wardPatientPendingCount?.toString()??"--",isLoading:!!w,key:"pendingOut"})))):i().createElement(i().Fragment,null)}},929(e,t,n){n.d(t,{A:()=>p});var a=n(7125),r=n.n(a),i=n(3373),s=n.n(i),d=n(5921),o=n(5910),l=n(8537),u=n(2895);let c=({wardPendingPatients:e})=>{let{wardPatientGroupDetails:t}=(0,u.useAppContext)("ward-view-context")??{},{inpatientRequests:n,isLoading:a,error:i}=t?.inpatientRequestResponse??{},{t:c}=(0,d.useTranslation)(),m=(0,u.useLayoutType)();return a||!n?null:i?(console.error(i),r().createElement(o.InlineNotification,{kind:"error",title:c("errorLoadingPatientAdmissionRequests","Error loading patient admission requests")})):r().createElement("div",{className:s()("-esm-ward__admission-requests__admissionRequestsContainer___bXgB6",{"-esm-ward__admission-requests__blackBackground___xRDWm":n?.length,"-esm-ward__admission-requests__lightBlueBackground___z3E8l":!n?.length})},r().createElement(l.yG,{className:"-esm-ward__admission-requests__movementIcon___UkccD",size:"24"}),r().createElement("span",{className:"-esm-ward__admission-requests__content___E-1qx"},c("admissionRequestsCount","{{count}} admission request",{count:n.length})),r().createElement(o.Button,{className:"-esm-ward__admission-requests__manageButton___PVRF+",onClick:()=>{(0,u.launchWorkspace2)("admission-requests-workspace",{wardPendingPatients:e},{startVisitWorkspaceName:"ward-app-start-visit-workspace"})},renderIcon:u.ArrowRightIcon,kind:"ghost",size:(0,u.isDesktop)(m)?"sm":"lg"},c("manage","Manage")))};var m=n(9656);let p=({wardPendingPatients:e,wardMetrics:t})=>{let{location:n}=(0,m.A)();return r().createElement("div",{className:"-esm-ward__ward-view-header__wardViewHeader___u4v+A"},r().createElement("h2",null,n?.display),t,r().createElement(c,{wardPendingPatients:e}))}},9900(e,t,n){n.d(t,{U1:()=>o,eD:()=>d,Jk:()=>l,yZ:()=>s,UG:()=>u,k9:()=>c});var a=n(2895),r=n(7125),i=n(5921);function s(e){return{id:e.bedId,uuid:e.bedUuid,bedNumber:e.bedNumber,bedType:e.bedType,row:e.rowNumber,column:e.columnNumber,status:e.status}}function d(e){let t=[...e.wardUnadmittedPatientsWithBed?.values(),...[...e.wardAdmittedPatientsWithBed?.values()].map(e=>e.patient),...e.wardUnassignedPatientsList?.map(e=>e.patient)],n=t?.length??0,a=t.filter(e=>null!=e.person.age&&e.person.age<1)?.length??0,r=t.filter(e=>"F"===e.person.gender).filter(e=>null!=e.person.age&&e.person.age>=10)?.length??0,i=e.bedLayouts?.length??0,s=e.bedLayouts?.filter(e=>e.patients?.length>0).length??0;return{patients:n.toString(),freeBeds:(i-s).toString(),totalBeds:i.toString(),newborns:a.toString(),femalesOfReproductiveAge:r.toString()}}function o(e,t,n,a,r){let i,s=function(e){let t=new Map;for(let n of e??[])n&&t.set(n.patient.uuid,n);return t}([...e??[],...a??[]]),d=new Map,o=new Map,l=t&&(i=new Intl.Collator([],{numeric:!0}),t.bedLayouts.filter(e=>e.bedId).sort((e,t)=>i.compare(e.bedNumber,t.bedNumber))),u=new Set,c=0;l?.map(e=>{let{patients:t}=e;t.map(e=>{let t=s.get(e.uuid);if(u.add(e.uuid),t?.currentInpatientLocation?.uuid===r.uuid){d.set(e.uuid,t);let n=t.currentInpatientRequest?.dispositionType;("TRANSFER"===n||"DISCHARGE"===n)&&c++}else o.set(e.uuid,e)})});let m=e?.filter(e=>(u.add(e.patient.uuid),!d.has(e.patient.uuid)&&!o.has(e.patient.uuid)))??[];for(let e of n??[])e&&u.add(e.patient.uuid);return{wardAdmittedPatientsWithBed:d,wardUnadmittedPatientsWithBed:o,wardPatientPendingCount:c,bedLayouts:l,wardUnassignedPatientsList:m,allWardPatientUuids:u,inpatientAdmissionsByPatientUuid:s}}function l(e,t){switch(e){case"patients":return t("patients","Patients");case"freeBeds":return t("freeBeds","Free beds");case"totalBeds":return t("totalBeds","Total beds");case"pendingOut":return t("pendingOut","Pending out");case"femalesOfReproductiveAge":return t("mothers","Mothers");case"newborns":return t("infants","Infants")}}function u(e,t){let n=(0,a.useConfig)(),{t:r}=(0,i.useTranslation)();try{return n?.patientCardElements?.[e]?.find(e=>e?.id===t)}catch(n){return(0,a.showNotification)({title:r("errorConfiguringPatientCard","Error configuring patient card"),kind:"error",critical:!0,description:r("errorConfiguringPatientCardMessage","Unable to find configuration for {{elementType}}, id: {{id}}",{elementType:e,id:t})}),null}}function c(e){let{wards:t}=(0,a.useConfig)(),n=(0,r.useMemo)(()=>t?.find(t=>null==t.appliedTo||t.appliedTo?.length===0||t.appliedTo.some(t=>t.location===e)),[t,e]);return n||(console.warn("No ward card configuration has `appliedTo` criteria that matches the current location. Using the default configuration."),{id:"default-ward"})}},6545(e,t,n){n.d(t,{A:()=>w});var a=n(7125),r=n.n(a),i=n(3373),s=n.n(i),d=n(5910),o=n(5921),l=n(2895),u=n(9656),c=n(9390),m=n(866);let p=()=>r().createElement("div",{className:`${m.A.emptyBed} ${m.A.skeleton}`},r().createElement(d.SkeletonIcon,null),r().createElement(c.A,null));var _=n(7104);let f=()=>r().createElement(r().Fragment,null,Array(20).fill(0).map((e,t)=>r().createElement(p,{key:t}))),w=({wardBeds:e,wardUnassignedPatients:t})=>{let{location:n}=(0,u.A)(),{t:i}=(0,o.useTranslation)(),{wardPatientGroupDetails:c}=(0,l.useAppContext)("ward-view-context")??{},{bedLayouts:m,isLoading:p}=c??{},{error:w}=c?.admissionLocationResponse??{},{error:g,hasMore:E,loadMore:A}=c?.inpatientAdmissionResponse??{},T=(0,l.useFeatureFlag)("bedmanagement-module"),y=(0,a.useRef)(null);return((0,a.useEffect)(function(){let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&E&&!g&&!p&&A()})},{threshold:1});return y.current&&e.observe(y.current),()=>{y.current&&e.unobserve(y.current)}},[g,E,A,y,p]),c)?r().createElement("div",{className:s()(_.A.wardViewMain,_.A.verticalTiling)},p?r().createElement(f,null):r().createElement(r().Fragment,null,e,t),m?.length===0&&T&&r().createElement(d.InlineNotification,{kind:"warning",lowContrast:!0,title:i("noBedsConfigured","No beds configured for this location")}),w&&r().createElement(d.InlineNotification,{kind:"error",lowContrast:!0,title:i("errorLoadingWardLocation","Error loading ward location"),subtitle:w?.message??i("invalidWardLocation","Invalid ward location: {{location}}",{location:n.display})}),g&&r().createElement(d.InlineNotification,{kind:"error",lowContrast:!0,title:i("errorLoadingPatients","Error loading admitted patients"),subtitle:g?.message}),r().createElement("div",{ref:y})):r().createElement(r().Fragment,null)}},201(e,t,n){n.d(t,{A:()=>u});var a=n(7125),r=n.n(a),i=n(5910),s=n(5921),d=n(2895),o=n(3836),l=n(6377);let u=({wardPatient:e,relatedTransferPatients:t})=>{let{t:n}=(0,s.useTranslation)(),a="tablet"===(0,d.useLayoutType)()?"lg":"md",{closeWorkspace:u,launchChildWorkspace:c}=(0,d.useWorkspace2Context)(),m="TRANSFER"===e.inpatientRequest.dispositionType;return r().createElement("div",{className:l.A.admissionRequestActionBar},r().createElement(i.Button,{kind:"ghost",size:a,onClick:()=>{c("transfer-elsewhere-workspace",{wardPatient:e,relatedTransferPatients:t})}},m?n("transferElsewhere","Transfer elsewhere"):n("admitElsewhere","Admit elsewhere")),r().createElement(i.Button,{kind:"ghost",size:a,onClick:()=>{c("cancel-admission-request-workspace",{wardPatient:e,relatedTransferPatients:t})}},n("cancel","Cancel")),r().createElement(o.A,{wardPatient:e,relatedTransferPatients:t,dispositionType:e.inpatientRequest.dispositionType,onAdmitPatientSuccess:async()=>{await u({discardUnsavedChanges:!0}),(0,d.closeWorkspaceGroup2)()}}))}},3863(e,t,n){n.d(t,{A:()=>p});var a=n(7125),r=n.n(a),i=n(2895),s=n(3373),d=n.n(s),o=n(2332),l=n(5e3),u=n(8768),c=n(9474),m=n(6377);let p=({wardPatient:e})=>{let{inpatientRequest:t}=e,{dispositionEncounter:n}=t,{patient:a}=e;return r().createElement("div",{className:m.A.admissionRequestCardHeaderContainer},r().createElement("div",{className:m.A.admissionRequestCardHeader},r().createElement(c.A,{patient:a}),r().createElement(u.A,{id:"patient-identifier",patient:a}),r().createElement(l.A,{patient:a}),r().createElement(o.A,{patient:a})),r().createElement("div",{className:d()(m.A.admissionRequestCardHeader,m.A.admissionEncounterDetails)},r().createElement("div",null,(0,i.formatDatetime)(new Date(n?.encounterDatetime),{locale:(0,i.getLocale)(),mode:"standard"})),r().createElement("div",null,n?.encounterProviders?.map(e=>e?.provider?.display).join(",")),r().createElement("div",null,n?.location?.display)))}},3836(e,t,n){n.d(t,{A:()=>u});var a=n(7125),r=n.n(a),i=n(5921),s=n(5910),d=n(2895),o=n(9656),l=n(6794);let u=({wardPatient:e,relatedTransferPatients:t,onAdmitPatientSuccess:n,disabled:u,dispositionType:c,kind:m="ghost",size:p})=>{let{patient:_,visit:f,bed:w}=e??{},{t:g}=(0,i.useTranslation)(),{location:E}=(0,o.A)(),A="tablet"===(0,d.useLayoutType)()?"lg":"md",{wardPatientGroupDetails:T}=(0,d.useAppContext)("ward-view-context")??{},{admitPatient:y,isLoadingEmrConfiguration:v,errorFetchingEmrConfiguration:h}=(0,l.E)(),[b,N]=(0,a.useState)(!1),{launchChildWorkspace:C}=(0,d.useWorkspace2Context)(),P=(0,d.useFeatureFlag)("bedmanagement-module"),R=async()=>{if(P&&!w)C("admit-patient-form-workspace",{wardPatient:e,relatedTransferPatients:t});else{N(!0);let a=[e,...t??[]],r=await Promise.allSettled(a.map(e=>y(e.patient,e.inpatientRequest?.dispositionType??c,e.visit.uuid)));await T?.mutate?.(),r.forEach((e,t)=>{let n=a[t],r=n.patient.person.preferredName.display,i=n.inpatientRequest?.dispositionType??c;if("fulfilled"===e.status)(0,d.showSnackbar)({kind:"success",title:"ADMIT"===i?g("patientAdmittedSuccessfully","Patient admitted successfully"):g("patientTransferredSuccessfully","Patient transferred successfully"),subtitle:"ADMIT"===i?g("patientAdmittedToLocation","{{patientName}} admitted successfully to {{location}}",{patientName:r,location:E?.display}):g("patientTransferredToLocation","{{patientName}} transferred successfully to {{location}}",{patientName:r,location:E?.display})});else{let t=e.reason,n=t?.responseBody?.error?.globalErrors?.[0]?.message??t?.message??g("unknownError","An unknown error occurred");(0,d.showSnackbar)({kind:"error",title:"ADMIT"===i?g("errorAdmittingPatient","Failed to admit {{patientName}}",{patientName:r}):g("errorTransferringPatient","Failed to transfer {{patientName}}",{patientName:r}),subtitle:n})}}),r.some(e=>"fulfilled"===e.status)&&n(),N(!1)}},k=v||h||u||b;return r().createElement(s.Button,{kind:m,renderIcon:d.ArrowRightIcon,size:p??A,disabled:k,onClick:R},"ADMIT"===c||k?g("admitPatient","Admit patient"):g("transferPatient","Transfer patient"))}},6794(e,t,n){n.d(t,{E:()=>o,R_:()=>s,S6:()=>c,Tb:()=>u,ZJ:()=>d,tf:()=>l});var a=n(2895),r=n(3724),i=n(9656);function s(){let{location:e}=(0,i.A)(),{currentProvider:t}=(0,a.useSession)(),{emrConfiguration:n,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:d}=(0,r.A)();return{createEncounter:(r,i,s,d=[])=>{let o={patient:r.uuid,encounterType:i,location:e?.uuid,encounterProviders:[{provider:t?.uuid,encounterRole:n?.clinicianEncounterRole?.uuid}],obs:d,visit:s};return(0,a.openmrsFetch)(`${a.restBaseUrl}/encounter`,{method:"POST",headers:{"content-type":"application/json"},body:o})},emrConfiguration:n,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:d}}function d(e){return(0,a.openmrsFetch)(`${a.restBaseUrl}/encounter/${e}`,{method:"DELETE"})}function o(){let{createEncounter:e,emrConfiguration:t,isLoadingEmrConfiguration:n,errorFetchingEmrConfiguration:a}=s();return{admitPatient:(n,a,r)=>e(n,"ADMIT"===a?t.admissionEncounterType:"TRANSFER"===a?t.transferWithinHospitalEncounterType:null,r),isLoadingEmrConfiguration:n,errorFetchingEmrConfiguration:a}}function l(e,t,n){return(0,a.openmrsFetch)(`${a.restBaseUrl}/beds/${e}`,{method:"POST",headers:{"content-type":"application/json"},body:{patientUuid:t,encounterUuid:n}})}function u(e,t){return(0,a.openmrsFetch)(`${a.restBaseUrl}/beds/${e}?patientUuid=${t}`,{method:"DELETE"})}function c(e){return(0,a.openmrsFetch)(`${a.restBaseUrl}/beds?patientUuid=${e}`)}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["1780"],{866(e,t,n){n.d(t,{A:()=>a});let a={occupiedBed:"-esm-ward__ward-bed__occupiedBed___B0eph",emptyBed:"-esm-ward__ward-bed__emptyBed___NNt7-",skeleton:"-esm-ward__ward-bed__skeleton___UvR9H",emptyBedText:"-esm-ward__ward-bed__emptyBedText___7Ipj7"}},3356(e,t,n){n.d(t,{A:()=>a});let a={wardPatientCard:"-esm-ward__ward-patient-card__wardPatientCard___NjMVe",wardPatientCardButton:"-esm-ward__ward-patient-card__wardPatientCardButton___Xw-ov",activeWardPatientCardButton:"-esm-ward__ward-patient-card__activeWardPatientCardButton___jp465",wardPatientCardRow:"-esm-ward__ward-patient-card__wardPatientCardRow___O-Jht",wardPatientCardPendingItemsRow:"-esm-ward__ward-patient-card__wardPatientCardPendingItemsRow___MzSq2",wardPatientPendingOrdersRow:"-esm-ward__ward-patient-card__wardPatientPendingOrdersRow___rRApd",wardPatientCardExtensionSlot:"-esm-ward__ward-patient-card__wardPatientCardExtensionSlot___WvNzG",wardPatientCardHeader:"-esm-ward__ward-patient-card__wardPatientCardHeader___5a47N",wardPatientCardHeaderBadge:"-esm-ward__ward-patient-card__wardPatientCardHeaderBadge___xnMNB",wardPatientCardDispositionTypeContainer:"-esm-ward__ward-patient-card__wardPatientCardDispositionTypeContainer___yNAdL",wardPatientName:"-esm-ward__ward-patient-card__wardPatientName___w0ALg",wardPatientBedNumber:"-esm-ward__ward-patient-card__wardPatientBedNumber___dxTfe",empty:"-esm-ward__ward-patient-card__empty___fjKgf",bedNumberBox:"-esm-ward__ward-patient-card__bedNumberBox___IUQwS",movementIcon:"-esm-ward__ward-patient-card__movementIcon___D2yrt",cancelTransferRequestButton:"-esm-ward__ward-patient-card__cancelTransferRequestButton___K2Amt",chemistryReferenceIcon:"-esm-ward__ward-patient-card__chemistryReferenceIcon___+cAiI",wardPatientAddress:"-esm-ward__ward-patient-card__wardPatientAddress___4G9m6",wardPatientObsLabel:"-esm-ward__ward-patient-card__wardPatientObsLabel___XO4yd",responsiveTooltip:"-esm-ward__ward-patient-card__responsiveTooltip___p-jmt",dotSeparatedChildren:"-esm-ward__ward-patient-card__dotSeparatedChildren___OdHvX",skeletonText:"-esm-ward__ward-patient-card__skeletonText___E6V6B",unassignedPatient:"-esm-ward__ward-patient-card__unassignedPatient___XyiyN"}},7104(e,t,n){n.d(t,{A:()=>a});let a={wardView:"-esm-ward__ward-view__wardView___rT-JC",verticalTiling:"-esm-ward__ward-view__verticalTiling___L+wuj",wardViewMain:"-esm-ward__ward-view__wardViewMain___8CJRz"}},6377(e,t,n){n.d(t,{A:()=>a});let a={admissionRequestCard:"-esm-ward__admission-request-card__admissionRequestCard___iwYkp",admissionRequestCardHeaderContainer:"-esm-ward__admission-request-card__admissionRequestCardHeaderContainer___Nyxcv",admissionRequestCardHeaderBadge:"-esm-ward__admission-request-card__admissionRequestCardHeaderBadge___NzLS2",admissionRequestCardHeader:"-esm-ward__admission-request-card__admissionRequestCardHeader___feIpm",admissionRequestCardExtensionSlot:"-esm-ward__admission-request-card__admissionRequestCardExtensionSlot___TIVve",admissionEncounterDetails:"-esm-ward__admission-request-card__admissionEncounterDetails___MnhYg",admissionRequestActionBar:"-esm-ward__admission-request-card__admissionRequestActionBar___Yt4EL"}},4808(e,t,n){n.d(t,{A:()=>p});var a=n(7125),r=n.n(a),i=n(866),s=n(3356),d=n(5921);let o=({bed:e})=>{let{t}=(0,d.useTranslation)();return r().createElement("div",{id:`bed-${e.bedNumber}`,className:i.A.emptyBed},r().createElement("span",{className:`${s.A.wardPatientBedNumber} ${s.A.empty}`},e.bedNumber),r().createElement("p",{className:i.A.emptyBedText},t("emptyBed","Empty bed")))};var l=n(5910);let u="-esm-ward__bed-share-divider__bedDividerLine___BSKFi",c=({isLoading:e})=>{let{t}=(0,d.useTranslation)();return r().createElement("div",{className:"-esm-ward__bed-share-divider__bedDivider___UR6jR"},r().createElement("div",{className:u}),e?r().createElement(l.SkeletonText,null):r().createElement(l.Tag,null,t("bedShare","Bed share")),r().createElement("div",{className:u}))},m=({patientCards:e,isLoadingDivider:t,bed:n})=>{let a=e.flatMap((e,n)=>0===n?[e]:[r().createElement(c,{key:`divider-${n}`,isLoading:t}),e]);return r().createElement("div",{id:`bed-${n.bedNumber}`,className:i.A.occupiedBed},a)},p=e=>{let{bed:t,patientCards:n}=e;return n?.length>0?r().createElement(m,e):r().createElement(o,{bed:t})}},3724(e,t,n){n.d(t,{A:()=>o});var a=n(3422),r=n(7125),i=n(4498),s=n.n(i);let d=`custom:${[["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(e=>e.join(":")).join(",")}`;function o(){let e=s()(`${a.restBaseUrl}/emrapi/configuration?v=${d}`,a.openmrsFetch);return(0,r.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}},160(e,t,n){n.d(t,{k:()=>r});var a=n(3422);function r(e){let t=e?.length>0,n=new URLSearchParams;for(let t of(n.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,)"),e??[]))n.append("patients",t);return(0,a.useOpenmrsFetchAll)(t?`${a.restBaseUrl}/emrapi/inpatient/admission?${n.toString()}`:null)}},3102(e,t,n){n.d(t,{e:()=>r});var a=n(3422);function r(e,t=!0,n="default"){let i=new URLSearchParams({...e,v:n}),s=`${a.restBaseUrl}/obs?${i}`;return(0,a.useOpenmrsFetchAll)(t?s:null)}},9656(e,t,n){n.d(t,{A:()=>d});var a=n(3422),r=n(2745),i=n(4498),s=n.n(i);function d(){let{locationUuid:e}=(0,r.useParams)(),{sessionLocation:t}=(0,a.useSession)(),{data:n,isLoading:i,error:d}=function(e,t="custom:(display,uuid)"){return s()(e?`${a.restBaseUrl}/location/${e}?v=${t}`:null,a.openmrsFetch)}(e||null),o=e&&d;return{location:e?n?.data:t,isLoadingLocation:i,errorFetchingLocation:d,invalidLocation:o}}},2488(e,t,n){n.d(t,{u:()=>u});var a=n(7125),r=n(9900),i=n(3422),s=n(8909),d=n.n(s),o=n(9656),l=n(160);function u(){let e=function(e="custom:(ward,totalBeds,occupiedBeds,bedLayouts:(rowNumber,columnNumber,bedNumber,bedId,bedUuid,status,location,patients:(person:full,identifiers,uuid)))"){let{location:t}=(0,o.A)(),n=(0,i.useFeatureFlag)("bedmanagement-module"),a=t?.uuid?`${i.restBaseUrl}/admissionLocation/${t?.uuid}?v=${e}`:null,{data:r,...s}=d()(n?a:null,i.openmrsFetch);return{admissionLocation:r?.data,...s}}(),t=function(){let{location:e}=(0,o.A)();return(0,i.useOpenmrsFetchAll)(e?`${i.restBaseUrl}/emrapi/inpatient/admission?currentInpatientLocation=${e.uuid}&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,)`:null)}(),n=function(e=["ADMIT","TRANSFER"],t="custom:(dispositionLocation,dispositionType,disposition,dispositionEncounter:full,patient:(uuid,identifiers,voided,person:(uuid,display,gender,age,birthdate,birthtime,preferredName,preferredAddress,dead,deathDate)),dispositionObsGroup,visit)"){let{location:n}=(0,o.A)(),a=new URLSearchParams;a.set("dispositionType",e.join(",")),a.set("dispositionLocation",n?.uuid),a.set("v",t);let{data:r,...s}=(0,i.useOpenmrsFetchAll)(n?.uuid?`${i.restBaseUrl}/emrapi/inpatient/request?${a.toString()}`:null);return{inpatientRequests:r,...s}}(),{location:s}=(0,o.A)(),{data:u}=t,{admissionLocation:c}=e,{inpatientRequests:m}=n,p=(0,a.useMemo)(()=>{if(!c||!u||!m)return null;{let e=new Set;for(let t of c.bedLayouts)for(let n of t.patients)e.add(n.uuid);for(let t of m)e.add(t.patient.uuid);for(let t of u)e.delete(t.patient.uuid);return e}},[c,u,m]),_=(0,l.k)(p?Array.from(p):null),{data:f}=_;return{...(0,a.useMemo)(()=>({...(0,r.U1)(u,c,m,f,s)}),[c,u,m,f,s]),admissionLocationResponse:e,inpatientAdmissionResponse:t,inpatientRequestResponse:n,isLoading:e.isLoading||t.isLoading||n.isLoading||_.isLoading,async mutate(){await Promise.all([e?.mutate?.(),t?.mutate?.(),n?.mutate?.(),_?.mutate?.()])}}}},5084(e,t,n){n.d(t,{d:()=>r});var a,r=((a={}).PATIENTS="patients",a.FREE_BEDS="freeBeds",a.TOTAL_BEDS="totalBeds",a.PENDING_OUT="pendingOut",a.FEMALES_OF_REPRODUCTIVE_AGE="femalesOfReproductiveAge",a.NEWBORNS="newborns",a)},103(e,t,n){n.d(t,{A:()=>o});var a=n(7125),r=n.n(a),i=n(9900),s=n(3743),d=n(3356);let o=({id:e,wardPatient:t})=>{let{patient:n,visit:a,inpatientAdmission:o}=t,{conceptUuid:l}=(0,i.UG)("admissionRequestNote",e)??{};return null!=o?null:r().createElement("div",{className:d.A.wardPatientCardRow},r().createElement(s.A,{id:e,configOverride:{conceptUuid:l,limit:0,id:"admission-note",onlyWithinCurrentVisit:!0,orderBy:"ascending",label:"Admission Note"},patient:n,visit:a}))}},6213(e,t,n){n.d(t,{A:()=>o});var a=n(7125),r=n.n(a),i=n(9656),s=n(5910),d=n(5921);let o=({wardPatient:e})=>{let{location:t}=(0,i.A)(),{t:n}=(0,d.useTranslation)(),{visit:a,inpatientAdmission:o}=e;return a?o?o.currentInpatientLocation.uuid!==t?.uuid?r().createElement(s.InlineNotification,{hideCloseButton:!0,kind:"warning",lowContrast:!0,title:n("admittedTo","Admitted to {{locationName}}",{locationName:o.currentInpatientLocation.display})}):null:r().createElement(s.InlineNotification,{hideCloseButton:!0,kind:"warning",lowContrast:!0,title:n("noAdmission","No admission found")}):r().createElement(s.InlineNotification,{hideCloseButton:!0,kind:"warning",lowContrast:!0,title:n("noActiveVisit","No active visit")})}},5001(e,t,n){n.d(t,{A:()=>g});var a=n(7125),r=n.n(a),i=n(3760),s=n(9900),d=n(529),o=n(3356),l=n(5921),u=n(3422),c=n(8909),m=n.n(c);let p=({wardPatient:e,orderUuid:t,label:n,onOrderCount:i})=>{let{t:s}=(0,l.useTranslation)(),{count:c,isLoading:p}=function(e,t,n){let a=e&&t&&n?`${u.restBaseUrl}/order?includeNullFulfillerStatus=true&patient=${e}&orderTypes=${t}&activatedOnOrAfterDate=${n}&excludeCanceledAndExpired=true&excludeDiscontinueOrders=true`:null,{data:r,...i}=m()(a,u.openmrsFetch);return{orders:r?.data.results,count:r?.data.results.length,...i}}(e?.patient?.uuid,t,e?.visit?.startDatetime.split("T")[0]);if((0,a.useEffect)(()=>{p||i(c)},[c,p,i]),p||!c||0===c)return null;let _=n?s(n):s("Orders","Orders");return r().createElement("div",{className:o.A.wardPatientCardDispositionTypeContainer},r().createElement(d.u$,{className:o.A.chemistryReferenceIcon,size:"24"}),c," ",_)};var _=n(5910),f=n(8537);let w=({wardPatient:e})=>{let{t}=(0,l.useTranslation)(),{dispositionType:n,dispositionLocation:i}=e?.inpatientRequest,s=(0,a.useMemo)(()=>"TRANSFER"===n?i?t("transferToDispositionLocation","Transfer to {{location}}",{location:i.name}):t("pendingTransfer","Pending Transfer"):"DISCHARGE"===n?t("pendingDischarge","Pending Discharge"):"",[n,i,t]);return"TRANSFER"!==n&&"DISCHARGE"!==n?null:r().createElement("div",{className:o.A.wardPatientCardDispositionTypeContainer},r().createElement(f.yG,{className:o.A.movementIcon,size:24}),s,r().createElement(_.IconButton,{label:t("cancel","Cancel"),kind:"secondary",className:o.A.cancelTransferRequestButton,size:"sm",onClick:()=>{(0,u.launchWorkspace2)("ward-patient-cancel-admission-request-workspace",{},{},{wardPatient:e})}},r().createElement(u.CloseOutlineIcon,null)))},g=({id:e,wardPatient:t})=>{let{orders:n,showPendingItems:d}=(0,s.UG)("pendingItems",e)||{},[l,u]=(0,a.useState)(!1),c=!!t?.inpatientRequest||l,m=(0,a.useCallback)(e=>{e>0&&u(!0)},[]);return(0,a.useEffect)(()=>{n?.orderTypes?.length||u(!1)},[n]),r().createElement("div",{className:o.A.wardPatientCardPendingItemsRow},d&&c?r().createElement(r().Fragment,null,r().createElement(i.Dx,{className:o.A.hourGlassIcon,size:"16"}),":"):null,n?.orderTypes.map(({uuid:e,label:n})=>r().createElement(p,{key:`pending-order-type-${e}`,wardPatient:t,orderUuid:e,label:n,onOrderCount:m})),t?.inpatientRequest?r().createElement(w,{wardPatient:t}):null)}},2332(e,t,n){n.d(t,{A:()=>s});var a=n(3422),r=n(7125),i=n.n(r);let s=({patient:e})=>e.person?.birthdate?i().createElement("div",null,(0,a.age)(e.person.birthdate)):null},5174(e,t,n){n.d(t,{A:()=>s});var a=n(7125),r=n.n(a),i=n(3356);let s=({bed:e})=>e?r().createElement("div",{className:i.A.bedNumberBox},r().createElement("span",{className:i.A.wardPatientBedNumber},e.bedNumber)):r().createElement(r().Fragment,null)},5e3(e,t,n){n.d(t,{A:()=>s});var a=n(7125),r=n.n(a),i=n(5921);let s=({patient:e})=>{let{t}=(0,i.useTranslation)();return r().createElement("div",null,((e,t)=>{switch(t){case"M":return e("male","Male");case"F":return e("female","Female");case"O":return e("other","Other");case"unknown":return e("unknown","Unknown");default:return t}})(t,e?.person?.gender))}},8768(e,t,n){n.d(t,{A:()=>d});var a=n(7125),r=n.n(a),i=n(3422),s=n(9900);let d=({id:e,patient:t})=>{let n=(0,s.UG)("patientIdentifier",e),a=t.identifiers.map(e=>({value:e.identifier,type:{text:e.identifierType.name,coding:[{code:e.identifierType.uuid}]}}));return r().createElement("div",{className:"-esm-ward__ward-patient-identifier__wardPatientIdentifierWrapper___Cjt9t"},r().createElement(i.PatientBannerPatientIdentifiers,{identifiers:a,showIdentifierLabel:n?.showIdentifierLabel}))}},9474(e,t,n){n.d(t,{A:()=>s});var a=n(7125),r=n.n(a),i=n(3356);let s=({patient:e})=>r().createElement("div",{className:i.A.wardPatientName},e?.person?.preferredName?.display)},3743(e,t,n){n.d(t,{A:()=>m});var a=n(7125),r=n.n(a),i=n(3672),s=n(5910),d=n(5921),o=n(3102),l=n(9900),u=n(4267),c=n(3356);let m=({id:e,configOverride:t,patient:n,visit:a})=>{let m=(0,l.UG)("obs",e),{conceptUuid:p,onlyWithinCurrentVisit:_,orderBy:f,limit:w,label:g}=t??m??{},{data:E,isLoading:A}=(0,o.e)({patient:n.uuid,concept:p},null!=p,i.Fx),{t:T}=(0,d.useTranslation)();if(A)return r().createElement(s.SkeletonText,null);{let e=E?.filter(e=>!_||e.encounter.visit?.uuid===a?.uuid)?.sort((e,t)=>("descending"===f?-1:1)*e.obsDatetime.localeCompare(t.obsDatetime))?.slice(0,0===w?Number.MAX_VALUE:w),t=null!=g?T(g):e?.[0]?.concept?.display,n=e?.map(e=>{let{value:t}=e,n=t?.display??String(t),a=(0,i.Fe)(e,T);return r().createElement(u.A,{key:e.uuid,tooltipContent:a},r().createElement("span",{title:a},n," "))});return n?.length>0?r().createElement("div",null,r().createElement("span",{className:c.A.wardPatientObsLabel},t?T("labelColon","{{label}}:",{label:t}):""),r().createElement("div",{className:c.A.dotSeparatedChildren},n)):null}}},3672(e,t,n){n.d(t,{Fe:()=>s,Fx:()=>r,uk:()=>i});var a=n(3422);let r="custom:(uuid,display,obsDatetime,value,concept:(uuid,display),encounter:(uuid,display,encounterType,encounterDatetime,visit:(uuid,display)))";function i(e=[]){let t=new Map;for(let n of e){let{color:e,appliedToConceptSets:a}=n;for(let n of a??[])t.has(n)||t.set(n,e)}let n=e.flatMap(e=>e.appliedToConceptSets),r=`${a.restBaseUrl}/concept?references=${n.join()}&v=custom:(uuid,setMembers:(uuid))`,{data:s}=(0,a.useOpenmrsFetchAll)(r),d=new Map;if(s)for(let e of s)for(let n of e.setMembers)d.has(n.uuid)||d.set(n.uuid,t.get(e.uuid));return d}function s(e,t){return t("encounterDisplay","{{encounterType}} {{encounterDate}}",{encounterType:e.encounter.encounterType.display,encounterDate:new Date(e.encounter.encounterDatetime).toLocaleDateString(),interpolation:{escapeValue:!1}})}},4267(e,t,n){n.d(t,{A:()=>o});var a=n(5910),r=n(3422),i=n(7125),s=n.n(i),d=n(3356);let o=({children:e,tooltipContent:t})=>{let n=(0,r.useLayoutType)();return(0,r.isDesktop)(n)?s().createElement(a.Tooltip,{description:t,className:d.A.responsiveTooltip},s().createElement("span",null,e)):s().createElement(a.Toggletip,{className:d.A.responsiveTooltip},s().createElement(a.ToggletipButton,null,e),s().createElement(a.ToggletipContent,null,t))}},9390(e,t,n){n.d(t,{A:()=>d});var a=n(5910),r=n(7125),i=n.n(r),s=n(3356);let d=()=>i().createElement(a.SkeletonIcon,{className:s.A.skeletonText})},5965(e,t,n){n.d(t,{A:()=>u});var a=n(7125),r=n.n(a),i=n(3464),s=n.n(i),d=n(279),o=n.n(d),l=n(5921);s().extend(o());let u=({encounterAssigningToCurrentInpatientLocation:e})=>{let{t}=(0,l.useTranslation)();if(!e?.encounterDatetime)return null;let n=s().duration(s()().diff(e.encounterDatetime)),a=Math.floor(n.asDays()),i=n.hours(),d=n.minutes(),o=n.seconds(),u=[];return(a>0&&u.push(t("days",{count:a,defaultValue_one:"{{count}} day",defaultValue_other:"{{count}} days"})),i>0&&u.push(t("hours",{count:i,defaultValue_one:"{{count}} hour",defaultValue_other:"{{count}} hours"})),d>0&&u.push(t("minutes",{count:d,defaultValue_one:"{{count}} minute",defaultValue_other:"{{count}} minutes"})),o>0&&0===u.length&&u.push(t("seconds",{count:o,defaultValue_one:"{{count}} second",defaultValue_other:"{{count}} seconds"})),0===u.length)?null:r().createElement("div",null,t("timeOnWard","Time on this ward: {{timeOnWard}}",{timeOnWard:u.join(" ")}))}},7781(e,t,n){n.d(t,{A:()=>m});var a=n(7125),r=n.n(a),i=n(3464),s=n.n(i),d=n(279),o=n.n(d),l=n(5562),u=n.n(l),c=n(5921);s().extend(o()),s().extend(u());let m=({firstAdmissionOrTransferEncounter:e})=>{let{t}=(0,c.useTranslation)();if(!e)return null;let n=s()(e.encounterDatetime).fromNow();return r().createElement("div",null,t("timeSinceAdmission","Admitted: {{timeSinceAdmission}}",{timeSinceAdmission:n}))}},8080(e,t,n){n.d(t,{A:()=>d});var a=n(7125),r=n.n(a),i=n(3422),s=n(3356);let d=({children:e,wardPatient:t,relatedTransferPatients:n})=>{let{patient:a}=t;return r().createElement("div",{className:s.A.wardPatientCard},e,r().createElement("button",{className:s.A.wardPatientCardButton,onClick:()=>{(0,i.launchWorkspace2)("ward-patient-workspace",{},{},{wardPatient:t,relatedTransferPatients:n})}},(0,i.getPatientName)(a.person)))}},875(e,t,n){n.d(t,{A:()=>c});var a=n(3422),r=n(7125),i=n.n(r),s=n(5921),d=n(5084),o=n(9900),l=n(5910);let u=({metricName:e,metricValue:t,isLoading:n})=>i().createElement("div",{className:"-esm-ward__ward-metric__metric___b1Tcz"},i().createElement("span",{className:"-esm-ward__ward-metric__metricName___YEKn3"},e),n?i().createElement(l.SkeletonPlaceholder,{className:"-esm-ward__ward-metric__skeleton___qjeUd"}):i().createElement("span",{className:"-esm-ward__ward-metric__metricValue___c3LvS"},t)),c=({metrics:e=[d.d.PATIENTS,d.d.FREE_BEDS,d.d.TOTAL_BEDS,d.d.PENDING_OUT]})=>{let{t}=(0,s.useTranslation)(),n=(0,a.useFeatureFlag)("bedmanagement-module"),{wardPatientGroupDetails:l}=(0,a.useAppContext)("ward-view-context")??{},{admissionLocationResponse:c,inpatientAdmissionResponse:m,inpatientRequestResponse:p}=l||{},{isLoading:_,error:f}=c??{},w=c?.isLoading||m?.isLoading||p?.isLoading,g=(0,r.useMemo)(()=>l?(0,o.eD)(l):{},[l]);return l?(f&&(0,a.showNotification)({kind:"error",title:t("errorLoadingBedDetails","Error loading bed details"),description:f.message}),i().createElement("div",{className:"-esm-ward__ward-metrics__metricsContainer___65Spn"},e.includes(d.d.PATIENTS)&&i().createElement(u,{metricName:(0,o.Jk)("patients",t),metricValue:g.patients??"--",isLoading:!1,key:"patients"}),e.includes(d.d.FEMALES_OF_REPRODUCTIVE_AGE)&&g.femalesOfReproductiveAge&&"0"!==g.femalesOfReproductiveAge&&i().createElement(u,{metricName:(0,o.Jk)("femalesOfReproductiveAge",t),metricValue:g.femalesOfReproductiveAge??"--",isLoading:!!_||!!w,key:"femalesOfReproductiveAge"}),e.includes(d.d.NEWBORNS)&&g.newborns&&"0"!==g.newborns&&i().createElement(u,{metricName:(0,o.Jk)("newborns",t),metricValue:g.newborns??"--",isLoading:!!_||!!w,key:"newborns"}),n&&i().createElement(i().Fragment,null,e.includes(d.d.FREE_BEDS)&&i().createElement(u,{metricName:(0,o.Jk)("freeBeds",t),metricValue:g.freeBeds??"--",isLoading:!!_||!!w,key:"freeBeds"}),e.includes(d.d.TOTAL_BEDS)&&i().createElement(u,{metricName:(0,o.Jk)("totalBeds",t),metricValue:g.totalBeds??"--",isLoading:!!_||!!w,key:"totalBeds"}),e.includes(d.d.PENDING_OUT)&&i().createElement(u,{metricName:(0,o.Jk)("pendingOut",t),metricValue:f?"--":l?.wardPatientPendingCount?.toString()??"--",isLoading:!!w,key:"pendingOut"})))):i().createElement(i().Fragment,null)}},929(e,t,n){n.d(t,{A:()=>p});var a=n(7125),r=n.n(a),i=n(3373),s=n.n(i),d=n(5921),o=n(5910),l=n(8537),u=n(3422);let c=({wardPendingPatients:e})=>{let{wardPatientGroupDetails:t}=(0,u.useAppContext)("ward-view-context")??{},{inpatientRequests:n,isLoading:a,error:i}=t?.inpatientRequestResponse??{},{t:c}=(0,d.useTranslation)(),m=(0,u.useLayoutType)();return a||!n?null:i?(console.error(i),r().createElement(o.InlineNotification,{kind:"error",title:c("errorLoadingPatientAdmissionRequests","Error loading patient admission requests")})):r().createElement("div",{className:s()("-esm-ward__admission-requests__admissionRequestsContainer___bXgB6",{"-esm-ward__admission-requests__blackBackground___xRDWm":n?.length,"-esm-ward__admission-requests__lightBlueBackground___z3E8l":!n?.length})},r().createElement(l.yG,{className:"-esm-ward__admission-requests__movementIcon___UkccD",size:"24"}),r().createElement("span",{className:"-esm-ward__admission-requests__content___E-1qx"},c("admissionRequestsCount","{{count}} admission request",{count:n.length})),r().createElement(o.Button,{className:"-esm-ward__admission-requests__manageButton___PVRF+",onClick:()=>{(0,u.launchWorkspace2)("admission-requests-workspace",{wardPendingPatients:e},{startVisitWorkspaceName:"ward-app-start-visit-workspace"})},renderIcon:u.ArrowRightIcon,kind:"ghost",size:(0,u.isDesktop)(m)?"sm":"lg"},c("manage","Manage")))};var m=n(9656);let p=({wardPendingPatients:e,wardMetrics:t})=>{let{location:n}=(0,m.A)();return r().createElement("div",{className:"-esm-ward__ward-view-header__wardViewHeader___u4v+A"},r().createElement("h2",null,n?.display),t,r().createElement(c,{wardPendingPatients:e}))}},9900(e,t,n){n.d(t,{U1:()=>o,eD:()=>d,Jk:()=>l,yZ:()=>s,UG:()=>u,k9:()=>c});var a=n(3422),r=n(7125),i=n(5921);function s(e){return{id:e.bedId,uuid:e.bedUuid,bedNumber:e.bedNumber,bedType:e.bedType,row:e.rowNumber,column:e.columnNumber,status:e.status}}function d(e){let t=[...e.wardUnadmittedPatientsWithBed?.values(),...[...e.wardAdmittedPatientsWithBed?.values()].map(e=>e.patient),...e.wardUnassignedPatientsList?.map(e=>e.patient)],n=t?.length??0,a=t.filter(e=>null!=e.person.age&&e.person.age<1)?.length??0,r=t.filter(e=>"F"===e.person.gender).filter(e=>null!=e.person.age&&e.person.age>=10)?.length??0,i=e.bedLayouts?.length??0,s=e.bedLayouts?.filter(e=>e.patients?.length>0).length??0;return{patients:n.toString(),freeBeds:(i-s).toString(),totalBeds:i.toString(),newborns:a.toString(),femalesOfReproductiveAge:r.toString()}}function o(e,t,n,a,r){let i,s=function(e){let t=new Map;for(let n of e??[])n&&t.set(n.patient.uuid,n);return t}([...e??[],...a??[]]),d=new Map,o=new Map,l=t&&(i=new Intl.Collator([],{numeric:!0}),t.bedLayouts.filter(e=>e.bedId).sort((e,t)=>i.compare(e.bedNumber,t.bedNumber))),u=new Set,c=0;l?.map(e=>{let{patients:t}=e;t.map(e=>{let t=s.get(e.uuid);if(u.add(e.uuid),t?.currentInpatientLocation?.uuid===r.uuid){d.set(e.uuid,t);let n=t.currentInpatientRequest?.dispositionType;("TRANSFER"===n||"DISCHARGE"===n)&&c++}else o.set(e.uuid,e)})});let m=e?.filter(e=>(u.add(e.patient.uuid),!d.has(e.patient.uuid)&&!o.has(e.patient.uuid)))??[];for(let e of n??[])e&&u.add(e.patient.uuid);return{wardAdmittedPatientsWithBed:d,wardUnadmittedPatientsWithBed:o,wardPatientPendingCount:c,bedLayouts:l,wardUnassignedPatientsList:m,allWardPatientUuids:u,inpatientAdmissionsByPatientUuid:s}}function l(e,t){switch(e){case"patients":return t("patients","Patients");case"freeBeds":return t("freeBeds","Free beds");case"totalBeds":return t("totalBeds","Total beds");case"pendingOut":return t("pendingOut","Pending out");case"femalesOfReproductiveAge":return t("mothers","Mothers");case"newborns":return t("infants","Infants")}}function u(e,t){let n=(0,a.useConfig)(),{t:r}=(0,i.useTranslation)();try{return n?.patientCardElements?.[e]?.find(e=>e?.id===t)}catch(n){return(0,a.showNotification)({title:r("errorConfiguringPatientCard","Error configuring patient card"),kind:"error",critical:!0,description:r("errorConfiguringPatientCardMessage","Unable to find configuration for {{elementType}}, id: {{id}}",{elementType:e,id:t})}),null}}function c(e){let{wards:t}=(0,a.useConfig)(),n=(0,r.useMemo)(()=>t?.find(t=>null==t.appliedTo||t.appliedTo?.length===0||t.appliedTo.some(t=>t.location===e)),[t,e]);return n||(console.warn("No ward card configuration has `appliedTo` criteria that matches the current location. Using the default configuration."),{id:"default-ward"})}},6545(e,t,n){n.d(t,{A:()=>w});var a=n(7125),r=n.n(a),i=n(3373),s=n.n(i),d=n(5910),o=n(5921),l=n(3422),u=n(9656),c=n(9390),m=n(866);let p=()=>r().createElement("div",{className:`${m.A.emptyBed} ${m.A.skeleton}`},r().createElement(d.SkeletonIcon,null),r().createElement(c.A,null));var _=n(7104);let f=()=>r().createElement(r().Fragment,null,Array(20).fill(0).map((e,t)=>r().createElement(p,{key:t}))),w=({wardBeds:e,wardUnassignedPatients:t})=>{let{location:n}=(0,u.A)(),{t:i}=(0,o.useTranslation)(),{wardPatientGroupDetails:c}=(0,l.useAppContext)("ward-view-context")??{},{bedLayouts:m,isLoading:p}=c??{},{error:w}=c?.admissionLocationResponse??{},{error:g,hasMore:E,loadMore:A}=c?.inpatientAdmissionResponse??{},T=(0,l.useFeatureFlag)("bedmanagement-module"),y=(0,a.useRef)(null);return((0,a.useEffect)(function(){let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&E&&!g&&!p&&A()})},{threshold:1});return y.current&&e.observe(y.current),()=>{y.current&&e.unobserve(y.current)}},[g,E,A,y,p]),c)?r().createElement("div",{className:s()(_.A.wardViewMain,_.A.verticalTiling)},p?r().createElement(f,null):r().createElement(r().Fragment,null,e,t),m?.length===0&&T&&r().createElement(d.InlineNotification,{kind:"warning",lowContrast:!0,title:i("noBedsConfigured","No beds configured for this location")}),w&&r().createElement(d.InlineNotification,{kind:"error",lowContrast:!0,title:i("errorLoadingWardLocation","Error loading ward location"),subtitle:w?.message??i("invalidWardLocation","Invalid ward location: {{location}}",{location:n.display})}),g&&r().createElement(d.InlineNotification,{kind:"error",lowContrast:!0,title:i("errorLoadingPatients","Error loading admitted patients"),subtitle:g?.message}),r().createElement("div",{ref:y})):r().createElement(r().Fragment,null)}},201(e,t,n){n.d(t,{A:()=>u});var a=n(7125),r=n.n(a),i=n(5910),s=n(5921),d=n(3422),o=n(3836),l=n(6377);let u=({wardPatient:e,relatedTransferPatients:t})=>{let{t:n}=(0,s.useTranslation)(),a="tablet"===(0,d.useLayoutType)()?"lg":"md",{closeWorkspace:u,launchChildWorkspace:c}=(0,d.useWorkspace2Context)(),m="TRANSFER"===e.inpatientRequest.dispositionType;return r().createElement("div",{className:l.A.admissionRequestActionBar},r().createElement(i.Button,{kind:"ghost",size:a,onClick:()=>{c("transfer-elsewhere-workspace",{wardPatient:e,relatedTransferPatients:t})}},m?n("transferElsewhere","Transfer elsewhere"):n("admitElsewhere","Admit elsewhere")),r().createElement(i.Button,{kind:"ghost",size:a,onClick:()=>{c("cancel-admission-request-workspace",{wardPatient:e,relatedTransferPatients:t})}},n("cancel","Cancel")),r().createElement(o.A,{wardPatient:e,relatedTransferPatients:t,dispositionType:e.inpatientRequest.dispositionType,onAdmitPatientSuccess:async()=>{await u({discardUnsavedChanges:!0}),(0,d.closeWorkspaceGroup2)()}}))}},3863(e,t,n){n.d(t,{A:()=>p});var a=n(7125),r=n.n(a),i=n(3422),s=n(3373),d=n.n(s),o=n(2332),l=n(5e3),u=n(8768),c=n(9474),m=n(6377);let p=({wardPatient:e})=>{let{inpatientRequest:t}=e,{dispositionEncounter:n}=t,{patient:a}=e;return r().createElement("div",{className:m.A.admissionRequestCardHeaderContainer},r().createElement("div",{className:m.A.admissionRequestCardHeader},r().createElement(c.A,{patient:a}),r().createElement(u.A,{id:"patient-identifier",patient:a}),r().createElement(l.A,{patient:a}),r().createElement(o.A,{patient:a})),r().createElement("div",{className:d()(m.A.admissionRequestCardHeader,m.A.admissionEncounterDetails)},r().createElement("div",null,(0,i.formatDatetime)(new Date(n?.encounterDatetime),{locale:(0,i.getLocale)(),mode:"standard"})),r().createElement("div",null,n?.encounterProviders?.map(e=>e?.provider?.display).join(",")),r().createElement("div",null,n?.location?.display)))}},3836(e,t,n){n.d(t,{A:()=>u});var a=n(7125),r=n.n(a),i=n(5921),s=n(5910),d=n(3422),o=n(9656),l=n(6794);let u=({wardPatient:e,relatedTransferPatients:t,onAdmitPatientSuccess:n,disabled:u,dispositionType:c,kind:m="ghost",size:p})=>{let{patient:_,visit:f,bed:w}=e??{},{t:g}=(0,i.useTranslation)(),{location:E}=(0,o.A)(),A="tablet"===(0,d.useLayoutType)()?"lg":"md",{wardPatientGroupDetails:T}=(0,d.useAppContext)("ward-view-context")??{},{admitPatient:y,isLoadingEmrConfiguration:v,errorFetchingEmrConfiguration:h}=(0,l.E)(),[b,N]=(0,a.useState)(!1),{launchChildWorkspace:C}=(0,d.useWorkspace2Context)(),P=(0,d.useFeatureFlag)("bedmanagement-module"),R=async()=>{if(P&&!w)C("admit-patient-form-workspace",{wardPatient:e,relatedTransferPatients:t});else{N(!0);let a=[e,...t??[]],r=await Promise.allSettled(a.map(e=>y(e.patient,e.inpatientRequest?.dispositionType??c,e.visit.uuid)));await T?.mutate?.(),r.forEach((e,t)=>{let n=a[t],r=n.patient.person.preferredName.display,i=n.inpatientRequest?.dispositionType??c;if("fulfilled"===e.status)(0,d.showSnackbar)({kind:"success",title:"ADMIT"===i?g("patientAdmittedSuccessfully","Patient admitted successfully"):g("patientTransferredSuccessfully","Patient transferred successfully"),subtitle:"ADMIT"===i?g("patientAdmittedToLocation","{{patientName}} admitted successfully to {{location}}",{patientName:r,location:E?.display}):g("patientTransferredToLocation","{{patientName}} transferred successfully to {{location}}",{patientName:r,location:E?.display})});else{let t=e.reason,n=t?.responseBody?.error?.globalErrors?.[0]?.message??t?.message??g("unknownError","An unknown error occurred");(0,d.showSnackbar)({kind:"error",title:"ADMIT"===i?g("errorAdmittingPatient","Failed to admit {{patientName}}",{patientName:r}):g("errorTransferringPatient","Failed to transfer {{patientName}}",{patientName:r}),subtitle:n})}}),r.some(e=>"fulfilled"===e.status)&&n(),N(!1)}},k=v||h||u||b;return r().createElement(s.Button,{kind:m,renderIcon:d.ArrowRightIcon,size:p??A,disabled:k,onClick:R},"ADMIT"===c||k?g("admitPatient","Admit patient"):g("transferPatient","Transfer patient"))}},6794(e,t,n){n.d(t,{E:()=>o,R_:()=>s,S6:()=>c,Tb:()=>u,ZJ:()=>d,tf:()=>l});var a=n(3422),r=n(3724),i=n(9656);function s(){let{location:e}=(0,i.A)(),{currentProvider:t}=(0,a.useSession)(),{emrConfiguration:n,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:d}=(0,r.A)();return{createEncounter:(r,i,s,d=[])=>{let o={patient:r.uuid,encounterType:i,location:e?.uuid,encounterProviders:[{provider:t?.uuid,encounterRole:n?.clinicianEncounterRole?.uuid}],obs:d,visit:s};return(0,a.openmrsFetch)(`${a.restBaseUrl}/encounter`,{method:"POST",headers:{"content-type":"application/json"},body:o})},emrConfiguration:n,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:d}}function d(e){return(0,a.openmrsFetch)(`${a.restBaseUrl}/encounter/${e}`,{method:"DELETE"})}function o(){let{createEncounter:e,emrConfiguration:t,isLoadingEmrConfiguration:n,errorFetchingEmrConfiguration:a}=s();return{admitPatient:(n,a,r)=>e(n,"ADMIT"===a?t.admissionEncounterType:"TRANSFER"===a?t.transferWithinHospitalEncounterType:null,r),isLoadingEmrConfiguration:n,errorFetchingEmrConfiguration:a}}function l(e,t,n){return(0,a.openmrsFetch)(`${a.restBaseUrl}/beds/${e}`,{method:"POST",headers:{"content-type":"application/json"},body:{patientUuid:t,encounterUuid:n}})}function u(e,t){return(0,a.openmrsFetch)(`${a.restBaseUrl}/beds/${e}?patientUuid=${t}`,{method:"DELETE"})}function c(e){return(0,a.openmrsFetch)(`${a.restBaseUrl}/beds?patientUuid=${e}`)}}}]);
|
package/dist/2008.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2008"],{637(e,t,n){n.r(t),n.d(t,{default:()=>O});var a=n(7125),i=n.n(a),r=n(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2008"],{637(e,t,n){n.r(t),n.d(t,{default:()=>O});var a=n(7125),i=n.n(a),r=n(3422),l=n(2488),s=n(4808),u=n(9900),m=n(103),d=n(5001),c=n(8080),p=n(3356),o=n(3373),E=n.n(o),A=n(2332),w=n(5174),v=n(8768),g=n(9474),q=n(5965),C=n(7781),P=n(5e3);let b=({wardPatient:e})=>{let{patient:t,bed:n,inpatientAdmission:a}=e,{encounterAssigningToCurrentInpatientLocation:r,firstAdmissionOrTransferEncounter:l}=a??{};return i().createElement("div",{className:E()(p.A.wardPatientCardRow,p.A.wardPatientCardHeader)},n?i().createElement(w.A,{bed:n}):null,i().createElement(g.A,{patient:t}),i().createElement(v.A,{id:"patient-identifier",patient:t}),i().createElement(P.A,{patient:t}),i().createElement(A.A,{patient:t}),i().createElement(C.A,{firstAdmissionOrTransferEncounter:l}),i().createElement(q.A,{encounterAssigningToCurrentInpatientLocation:r}))};var f=n(6213);let k=({wardPatient:e})=>{let{bed:t}=e,n=i().createElement(c.A,{wardPatient:e},i().createElement(b,{wardPatient:e}),i().createElement(f.A,{wardPatient:e}),i().createElement(d.A,{id:"pending-items",wardPatient:e}),i().createElement(m.A,{id:"admission-request-note",wardPatient:e}));return t?n:i().createElement("div",{className:p.A.unassignedPatient},i().createElement("div",{key:"unassigned-bed-pt-"+e.patient.uuid},n))},R=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{bedLayouts:t,wardAdmittedPatientsWithBed:n,inpatientAdmissionsByPatientUuid:a}=e??{},l=t?.map(e=>{let{patients:t}=e,r=(0,u.yZ)(e),l=t.map(e=>{let t=n?.get(e.uuid);if(t){let{patient:e,visit:n,currentInpatientRequest:a}=t;return{patient:e,visit:n,bed:r,inpatientAdmission:t,inpatientRequest:a||null}}{let t=a.get(e.uuid);return{patient:e,visit:t?.visit,bed:r,inpatientAdmission:t,inpatientRequest:null}}}).map(e=>i().createElement(k,{key:e.patient.uuid,wardPatient:e}));return i().createElement(s.A,{key:r.uuid,bed:r,patientCards:l})});return i().createElement(i().Fragment,null,l)};var x=n(5921),_=n(201),h=n(3863),y=n(6377);let T=({wardPatient:e,children:t})=>i().createElement("div",{className:y.A.admissionRequestCard},i().createElement(h.A,{wardPatient:e}),t,i().createElement(_.A,{wardPatient:e}));var F=n(9390);let N=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{t}=(0,x.useTranslation)(),{inpatientRequestResponse:n}=e??{},{inpatientRequests:a,isLoading:l,error:s}=n??{};return l?i().createElement(F.A,null):s?i().createElement(r.ErrorState,{headerTitle:t("admissionRequests","Admission requests"),error:s}):i().createElement(i().Fragment,null,a?.map((e,t)=>{let n={patient:e.patient,visit:e.visit,bed:null,inpatientRequest:e,inpatientAdmission:null};return i().createElement(T,{key:`admission-request-card-${t}`,wardPatient:{patient:e.patient,visit:e.visit,bed:null,inpatientRequest:e,inpatientAdmission:null}},i().createElement(m.A,{id:"admission-request-note",wardPatient:n}))}))},H=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{wardUnassignedPatientsList:t}=e??{},n=t?.map(e=>i().createElement(k,{wardPatient:{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:e,inpatientRequest:e.currentInpatientRequest},key:e.patient.uuid}));return i().createElement(i().Fragment,null,n)};var I=n(6545),L=n(929),D=n(875);let O=()=>{let e=(0,l.u)();(0,r.useDefineAppContext)("ward-view-context",{wardPatientGroupDetails:e,WardPatientHeader:b});let t=i().createElement(R,null),n=i().createElement(D.A,null),a=i().createElement(H,null),s=i().createElement(N,null);return i().createElement(i().Fragment,null,i().createElement(L.A,{wardPendingPatients:s,wardMetrics:n}),i().createElement(I.A,{wardBeds:t,wardUnassignedPatients:a}))}}}]);
|
package/dist/2101.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2101"],{7104(e,t,n){"use strict";n.d(t,{A:()=>r});let r={wardView:"-esm-ward__ward-view__wardView___rT-JC",verticalTiling:"-esm-ward__ward-view__verticalTiling___L+wuj",wardViewMain:"-esm-ward__ward-view__wardViewMain___8CJRz"}},9656(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2101"],{7104(e,t,n){"use strict";n.d(t,{A:()=>r});let r={wardView:"-esm-ward__ward-view__wardView___rT-JC",verticalTiling:"-esm-ward__ward-view__verticalTiling___L+wuj",wardViewMain:"-esm-ward__ward-view__wardViewMain___8CJRz"}},9656(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(3422),i=n(2745),a=n(4498),o=n.n(a);function u(){let{locationUuid:e}=(0,i.useParams)(),{sessionLocation:t}=(0,r.useSession)(),{data:n,isLoading:a,error:u}=function(e,t="custom:(display,uuid)"){return o()(e?`${r.restBaseUrl}/location/${e}?v=${t}`:null,r.openmrsFetch)}(e||null),d=e&&u;return{location:e?n?.data:t,isLoadingLocation:a,errorFetchingLocation:u,invalidLocation:d}}},8804(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>p});var r=n(5910),i=n(3422),a=n(3373),o=n.n(a),u=n(7125),d=n.n(u),s=n(5921),l=n(9656),c=n(9900),f=n(7104);let p=()=>{let{isLoadingLocation:e,invalidLocation:t,location:n}=(0,l.A)(),{t:a}=(0,s.useTranslation)(),u=n?.uuid,p=(0,c.k9)(u);if(e)return d().createElement(d().Fragment,null);if(t)return d().createElement(r.InlineNotification,{kind:"error",title:a("invalidLocationSpecified","Invalid location specified")});let g=p.id;return d().createElement("div",{className:o()(f.A.wardView,f.A.verticalTiling)},d().createElement(i.ExtensionSlot,{name:g}))}},9900(e,t,n){"use strict";n.d(t,{U1:()=>d,eD:()=>u,Jk:()=>s,yZ:()=>o,UG:()=>l,k9:()=>c});var r=n(3422),i=n(7125),a=n(5921);function o(e){return{id:e.bedId,uuid:e.bedUuid,bedNumber:e.bedNumber,bedType:e.bedType,row:e.rowNumber,column:e.columnNumber,status:e.status}}function u(e){let t=[...e.wardUnadmittedPatientsWithBed?.values(),...[...e.wardAdmittedPatientsWithBed?.values()].map(e=>e.patient),...e.wardUnassignedPatientsList?.map(e=>e.patient)],n=t?.length??0,r=t.filter(e=>null!=e.person.age&&e.person.age<1)?.length??0,i=t.filter(e=>"F"===e.person.gender).filter(e=>null!=e.person.age&&e.person.age>=10)?.length??0,a=e.bedLayouts?.length??0,o=e.bedLayouts?.filter(e=>e.patients?.length>0).length??0;return{patients:n.toString(),freeBeds:(a-o).toString(),totalBeds:a.toString(),newborns:r.toString(),femalesOfReproductiveAge:i.toString()}}function d(e,t,n,r,i){let a,o=function(e){let t=new Map;for(let n of e??[])n&&t.set(n.patient.uuid,n);return t}([...e??[],...r??[]]),u=new Map,d=new Map,s=t&&(a=new Intl.Collator([],{numeric:!0}),t.bedLayouts.filter(e=>e.bedId).sort((e,t)=>a.compare(e.bedNumber,t.bedNumber))),l=new Set,c=0;s?.map(e=>{let{patients:t}=e;t.map(e=>{let t=o.get(e.uuid);if(l.add(e.uuid),t?.currentInpatientLocation?.uuid===i.uuid){u.set(e.uuid,t);let n=t.currentInpatientRequest?.dispositionType;("TRANSFER"===n||"DISCHARGE"===n)&&c++}else d.set(e.uuid,e)})});let f=e?.filter(e=>(l.add(e.patient.uuid),!u.has(e.patient.uuid)&&!d.has(e.patient.uuid)))??[];for(let e of n??[])e&&l.add(e.patient.uuid);return{wardAdmittedPatientsWithBed:u,wardUnadmittedPatientsWithBed:d,wardPatientPendingCount:c,bedLayouts:s,wardUnassignedPatientsList:f,allWardPatientUuids:l,inpatientAdmissionsByPatientUuid:o}}function s(e,t){switch(e){case"patients":return t("patients","Patients");case"freeBeds":return t("freeBeds","Free beds");case"totalBeds":return t("totalBeds","Total beds");case"pendingOut":return t("pendingOut","Pending out");case"femalesOfReproductiveAge":return t("mothers","Mothers");case"newborns":return t("infants","Infants")}}function l(e,t){let n=(0,r.useConfig)(),{t:i}=(0,a.useTranslation)();try{return n?.patientCardElements?.[e]?.find(e=>e?.id===t)}catch(n){return(0,r.showNotification)({title:i("errorConfiguringPatientCard","Error configuring patient card"),kind:"error",critical:!0,description:i("errorConfiguringPatientCardMessage","Unable to find configuration for {{elementType}}, id: {{id}}",{elementType:e,id:t})}),null}}function c(e){let{wards:t}=(0,r.useConfig)(),n=(0,i.useMemo)(()=>t?.find(t=>null==t.appliedTo||t.appliedTo?.length===0||t.appliedTo.some(t=>t.location===e)),[t,e]);return n||(console.warn("No ward card configuration has `appliedTo` criteria that matches the current location. Using the default configuration."),{id:"default-ward"})}},3373(e){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(e=r(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var i="";for(var a in e)t.call(e,a)&&e[a]&&(i=r(i,a));return i}(a)))}return e}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()}}]);
|
package/dist/2495.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2495"],{3724(e,n,t){t.d(n,{A:()=>u});var r=t(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2495"],{3724(e,n,t){t.d(n,{A:()=>u});var r=t(3422),o=t(7125),i=t(4498),s=t.n(i);let a=`custom:${[["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(e=>e.join(":")).join(",")}`;function u(){let e=s()(`${r.restBaseUrl}/emrapi/configuration?v=${a}`,r.openmrsFetch);return(0,o.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}},9656(e,n,t){t.d(n,{A:()=>a});var r=t(3422),o=t(2745),i=t(4498),s=t.n(i);function a(){let{locationUuid:e}=(0,o.useParams)(),{sessionLocation:n}=(0,r.useSession)(),{data:t,isLoading:i,error:a}=function(e,n="custom:(display,uuid)"){return s()(e?`${r.restBaseUrl}/location/${e}?v=${n}`:null,r.openmrsFetch)}(e||null),u=e&&a;return{location:e?t?.data:n,isLoadingLocation:i,errorFetchingLocation:a,invalidLocation:u}}},8866(e,n,t){t.r(n),t.d(n,{default:()=>c});var r=t(7125),o=t.n(r),i=t(5921),s=t(5910),a=t(6794),u=t(3422);let c=({close:e,encounterUuid:n,onDelete:t})=>{let{t:c}=(0,i.useTranslation)(),[l,d]=(0,r.useState)(!1),p=async()=>{try{d(!0),await (0,a.ZJ)(n),(0,u.showSnackbar)({kind:"success",title:c("noteDeletedSuccessfully","Note deleted successfully")}),e(),t?.()}catch(e){(0,u.showSnackbar)({kind:"error",title:c("errorDeletingNote","Error deleting note"),subtitle:e?.responseBody?.error?.translatedMessage??e?.responseBody?.error?.message})}finally{d(!1)}};return o().createElement(o().Fragment,null,o().createElement(s.ModalHeader,{closeModal:e},c("deleteNote","Delete note"),"?"),o().createElement(s.ModalBody,null,o().createElement("p",null,c("deleteNoteConfirmationText","Are you sure you want to delete this note? This action can't be undone."))),o().createElement(s.ModalFooter,null,o().createElement(s.Button,{size:"lg",kind:"secondary",onClick:()=>e()},(0,u.getCoreTranslation)("cancel")),o().createElement(s.Button,{autoFocus:!0,kind:"danger",disabled:l,onClick:p,size:"lg"},(0,u.getCoreTranslation)("delete"))))}},6794(e,n,t){t.d(n,{E:()=>u,R_:()=>s,S6:()=>d,Tb:()=>l,ZJ:()=>a,tf:()=>c});var r=t(3422),o=t(3724),i=t(9656);function s(){let{location:e}=(0,i.A)(),{currentProvider:n}=(0,r.useSession)(),{emrConfiguration:t,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:a}=(0,o.A)();return{createEncounter:(o,i,s,a=[])=>{let u={patient:o.uuid,encounterType:i,location:e?.uuid,encounterProviders:[{provider:n?.uuid,encounterRole:t?.clinicianEncounterRole?.uuid}],obs:a,visit:s};return(0,r.openmrsFetch)(`${r.restBaseUrl}/encounter`,{method:"POST",headers:{"content-type":"application/json"},body:u})},emrConfiguration:t,isLoadingEmrConfiguration:s,errorFetchingEmrConfiguration:a}}function a(e){return(0,r.openmrsFetch)(`${r.restBaseUrl}/encounter/${e}`,{method:"DELETE"})}function u(){let{createEncounter:e,emrConfiguration:n,isLoadingEmrConfiguration:t,errorFetchingEmrConfiguration:r}=s();return{admitPatient:(t,r,o)=>e(t,"ADMIT"===r?n.admissionEncounterType:"TRANSFER"===r?n.transferWithinHospitalEncounterType:null,o),isLoadingEmrConfiguration:t,errorFetchingEmrConfiguration:r}}function c(e,n,t){return(0,r.openmrsFetch)(`${r.restBaseUrl}/beds/${e}`,{method:"POST",headers:{"content-type":"application/json"},body:{patientUuid:n,encounterUuid:t}})}function l(e,n){return(0,r.openmrsFetch)(`${r.restBaseUrl}/beds/${e}?patientUuid=${n}`,{method:"DELETE"})}function d(e){return(0,r.openmrsFetch)(`${r.restBaseUrl}/beds?patientUuid=${e}`)}}}]);
|
package/dist/2973.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2973"],{8742(e,r,t){"use strict";function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?n(Object(t),!0).forEach(function(r){var n,i;n=r,i=t[r],(n=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function o(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],-1===r.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}t.d(r,{A:()=>b});var a=["width","height","viewBox"],s=["tabindex"],c={focusable:"false",preserveAspectRatio:"xMidYMid meet"},p=t(9067),l=t.n(p),u=t(7125),f=t.n(u);let b=f().forwardRef(function({className:e,children:r,tabIndex:t,xmlns:n="http://www.w3.org/2000/svg",preserveAspectRatio:p="xMidYMid meet",...l},u){let{tabindex:b,...y}=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.width,t=e.height,n=e.viewBox,p=void 0===n?"0 0 ".concat(r," ").concat(t):n,l=o(e,a),u=l.tabindex,f=o(l,s),b=i(i(i({},c),f),{},{width:r,height:t,viewBox:p});return b["aria-label"]||b["aria-labelledby"]||b.title?(b.role="img",null!=u&&(b.focusable="true",b.tabindex=u)):b["aria-hidden"]=!0,b}({...l,tabindex:t});return e&&(y.className=e),null!=b&&("number"==typeof b?y.tabIndex=b:y.tabIndex=Number(t)),u&&(y.ref=u),n&&(y.xmlns=n),p&&(y.preserveAspectRatio=p),f().createElement("svg",y,r)});b.displayName="Icon",b.propTypes={"aria-hidden":l().oneOfType([l().bool,l().oneOf(["true","false"])]),"aria-label":l().string,"aria-labelledby":l().string,children:l().node,className:l().string,height:l().oneOfType([l().number,l().string]),preserveAspectRatio:l().string,tabIndex:l().oneOfType([l().number,l().string]),viewBox:l().string,width:l().oneOfType([l().number,l().string]),xmlns:l().string}},6999(e,r,t){"use strict";var n=t(6848);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,r,t,i,o,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:o,resetWarningCache:i};return t.PropTypes=t,t}},9067(e,r,t){e.exports=t(6999)()},6848(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4109(e,r,t){"use strict";t.r(r),t.d(r,{default:()=>c});var n=t(7125),i=t.n(n),o=t(1899),a=t(5921),s=t(
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["2973"],{8742(e,r,t){"use strict";function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?n(Object(t),!0).forEach(function(r){var n,i;n=r,i=t[r],(n=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function o(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],-1===r.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}t.d(r,{A:()=>b});var a=["width","height","viewBox"],s=["tabindex"],c={focusable:"false",preserveAspectRatio:"xMidYMid meet"},p=t(9067),l=t.n(p),u=t(7125),f=t.n(u);let b=f().forwardRef(function({className:e,children:r,tabIndex:t,xmlns:n="http://www.w3.org/2000/svg",preserveAspectRatio:p="xMidYMid meet",...l},u){let{tabindex:b,...y}=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.width,t=e.height,n=e.viewBox,p=void 0===n?"0 0 ".concat(r," ").concat(t):n,l=o(e,a),u=l.tabindex,f=o(l,s),b=i(i(i({},c),f),{},{width:r,height:t,viewBox:p});return b["aria-label"]||b["aria-labelledby"]||b.title?(b.role="img",null!=u&&(b.focusable="true",b.tabindex=u)):b["aria-hidden"]=!0,b}({...l,tabindex:t});return e&&(y.className=e),null!=b&&("number"==typeof b?y.tabIndex=b:y.tabIndex=Number(t)),u&&(y.ref=u),n&&(y.xmlns=n),p&&(y.preserveAspectRatio=p),f().createElement("svg",y,r)});b.displayName="Icon",b.propTypes={"aria-hidden":l().oneOfType([l().bool,l().oneOf(["true","false"])]),"aria-label":l().string,"aria-labelledby":l().string,children:l().node,className:l().string,height:l().oneOfType([l().number,l().string]),preserveAspectRatio:l().string,tabIndex:l().oneOfType([l().number,l().string]),viewBox:l().string,width:l().oneOfType([l().number,l().string]),xmlns:l().string}},6999(e,r,t){"use strict";var n=t(6848);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,r,t,i,o,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:o,resetWarningCache:i};return t.PropTypes=t,t}},9067(e,r,t){e.exports=t(6999)()},6848(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4109(e,r,t){"use strict";t.r(r),t.d(r,{default:()=>c});var n=t(7125),i=t.n(n),o=t(1899),a=t(5921),s=t(3422);let c=({groupProps:{wardPatient:e}})=>{let{t:r}=(0,a.useTranslation)();return i().createElement(s.ActionMenuButton2,{icon:e=>i().createElement(o.yo,e),label:r("clinicalForms","Clinical forms"),workspaceToLaunch:{workspaceName:"ward-patient-clinical-forms-workspace",windowProps:{formEntryWorkspaceName:"ward-patient-form-entry-workspace",patient:e.patient,patientUuid:e.patient.uuid,visitContext:e.visit}}})}}}]);
|
package/dist/3560.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["3560"],{4767(e,t,i){var n={"./uk.json":["723","9072"],"./ar.json":["4132","7045"],"./ru_RU.json":["986","8359"],"./uz_UZ.json":["890","7175"],"./fr.json":["4055","6508"],"./sw_KE.json":["8618","903"],"./uz.json":["3584","6377"],"./en.json":["4300","5117"],"./ky.json":["8163","2416"],"./pl.json":["1119","6724"],"./sq.json":["8371","4928"],"./ka.json":["795","1480"],"./si.json":["6859","6904"],"./zh_TW.json":["439","556"],"./de.json":["4944","5145"],"./lg.json":["4618","8695"],"./vi.json":["9214","6371"],"./tr.json":["5241","434"],"./es_MX.json":["8349","1646"],"./tr_TR.json":["7519","1869"],"./zh_CN.json":["9879","5644"],"./en_US.json":["9569","4106"],"./he.json":["4652","2317"],"./id.json":["2690","6047"],"./ku.json":["9895","4348"],"./es.json":["3099","7912"],"./ne.json":["2146","5503"],"./ar_SY.json":["7617","282"],"./uz@Latn.json":["7097","4658"],"./bn.json":["7159","6444"],"./cs.json":["6589","7182"],"./zh.json":["5661","7742"],"./hi_IN.json":["5442","4383"],"./pt_BR.json":["4087","1877"],"./qu.json":["5173","8358"],"./ro_RO.json":["6022","3963"],"./sw.json":["9913","3378"],"./am.json":["1197","9806"],"./pt.json":["6679","5132"],"./it.json":["9538","4111"],"./km.json":["4335","5940"],"./hi.json":["6840","2881"]};function s(e){if(!i.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],s=t[0];return i.e(t[1]).then(function(){return i(s)})}s.keys=()=>Object.keys(n),s.id=4767,e.exports=s},5132(e,t,i){"use strict";i.d(t,{A:()=>n});let n="@openmrs/esm-ward-app"},7227(e,t,i){"use strict";i.r(t),i.d(t,{patientTransferAndSwapWorkspaceSiderailIcon:()=>I,root:()=>f,wardDashboardLink:()=>u,wardPatientCancelAdmissionRequestWorkspace:()=>w,wardPatientNotesActionButton:()=>T,maternalWardView:()=>q,clinicalFormWorkspaceSideRailIcon:()=>S,patientDischargeWorkspace:()=>j,wardPatientWorkspaceBanner:()=>O,admitPatientFormWorkspace:()=>_,startupApp:()=>N,wardPatientNotesWorkspace:()=>A,patientTransferAndSwapWorkspace:()=>v,wardPatientWorkspace:()=>g,defaultWardView:()=>W,createAdmissionEncounterWorkspace:()=>U,orderBasketWorkspaceSideRailIcon:()=>C,importTranslation:()=>c,noteHistoryModal:()=>D,patientDischargeWorkspaceSideRailIcon:()=>P,patientTransferRequestWorkspace:()=>k,wardPatientActionButton:()=>b,wardView:()=>h,admissionRequestWorkspace:()=>m,deleteNoteModal:()=>R,cancelAdmissionRequestWorkspace:()=>L});var n=i(2895);let s={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:n.Type.Array,_default:[],_description:"Configures obs values to display.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:n.Type.UUID,_description:"Identifies the concept to use to identify the desired observations."},label:{_type:n.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:n.Type.String,_default:"descending",_description:"One of 'ascending' or 'descending', specifying whether to display the obs by obsDatetime ascendingly or descendingly.",_validators:[n.validators.oneOf(["ascending","descending"])]},limit:{_type:n.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:n.Type.Boolean,_default:!1,_description:"Optional. If true, limits display to only observations within current visit. Defaults to false"}}},pendingItems:{_type:n.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:n.Type.String,_description:"The unique identifier for this patient card element"},orders:{orderTypes:{_type:n.Type.Array,_description:"Configures pending orders and transfers to display.",_elements:{uuid:{_type:n.Type.UUID,_description:"Identifies the order type."},label:{_type:n.Type.String,_default:"",_description:"The label or i18n key to the translated label to display. If not provided, defaults to 'Orders'"}}}},showPendingItems:{_type:n.Type.Boolean,_description:"Optional. If true, pending items (e.g., number of pending orders) will be displayed on the patient card."}}},patientIdentifier:{_type:n.Type.Array,_default:[{id:"patient-identifier",showIdentifierLabel:!1}],_description:"Configures patient identifier to display. An unconfigured element displays the preferred identifier.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},showIdentifierLabel:{_type:n.Type.Boolean,_description:'If true, the identifier type (eg: "OpenMRS ID") is shown along with the identifier itself. Defaults to false'}}},patientAddress:{_type:n.Type.Array,_default:[{id:"patient-address",fields:["cityVillage","country"]}],_description:"Configures patient address elements.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},fields:{_type:n.Type.Array,_description:"The fields of the address to display",_elements:{_type:n.Type.String,_validators:[n.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:n.Type.Array,_default:[{id:"admission-request-note",conceptUuid:"161011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}],_description:"Configures admission request notes to display.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:n.Type.UUID,_description:"Required. Identifies the concept for the admission request note."}}},coloredObsTags:{_type:n.Type.Array,_default:[],_description:"Configures observation values to display as Carbon tags.",_elements:{conceptUuid:{_type:n.Type.UUID,_default:"1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",_description:"Required. Identifies the concept to use to identify the desired observations."},summaryLabel:{_type:n.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:n.Type.String,_default:"",_description:"Optional. The custom module to use for translation of the summary label"},summaryLabelColor:{_type:n.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:n.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:n.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:n.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:n.Type.UUID}}}}}}},wards:{_type:n.Type.Array,_default:[{id:"default-ward"}],_description:"Configuration of what type of ward to use at different ward locations.",_elements:{id:{_type:n.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:n.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:n.Type.UUID,_default:"",_description:"The UUID of the location. If not provided, applies to all wards."}}}}},hideWorkspaceVitalsLinks:{_type:n.Type.Boolean,_default:!1,_description:"Configure whether to hide vital history and record vital links in the ward patient workspace."},additionalInpatientNotesConceptUuids:{_type:n.Type.Array,_default:[],_description:"List of uuids of concepts that represent notes to display in the notes view in addition to the consultFreeTextCommentsConcept defined by EMR-API"}};var o=i(5132),a=i(7125),r=i.n(a),d=i(2745);let l={path:"ward",slot:"ward-dashboard-slot",title:"wards",basePath:`${window.spaBase}/home`},p={allowedSessionLocationUuids:{_type:n.Type.Array,_default:[],_description:"If not empty, the discharge button will only show for users whose session location is included in this list. If empty, the discharge button will show for all locations.",_elements:{_type:n.Type.String}}},c=i(4767),y={featureName:"ward",moduleName:o.A},f=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("8340")]).then(i.bind(i,1759)),y),u=(0,n.getSyncLifecycle)(()=>r().createElement(d.BrowserRouter,null,r().createElement(n.DashboardExtension,{path:l.path,title:l.title,basePath:l.basePath,icon:l.icon})),y),h=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("2101")]).then(i.bind(i,8804)),y),m=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5361"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("9471")]).then(i.bind(i,1465)),y),_=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("8424")]).then(i.bind(i,7195)),y),g=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("9080")]).then(i.bind(i,6811)),y),A=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("388")]).then(i.bind(i,2863)),y),b=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("1664")]).then(i.bind(i,9235)),y),w=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("8493")]).then(i.bind(i,7260)),y),T=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("7249")]).then(i.bind(i,2504)),y),v=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("833"),i.e("5296")]).then(i.bind(i,5901)),y),j=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("9983")]).then(i.bind(i,1858)),y),I=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("502")]).then(i.bind(i,7653)),y),k=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("833"),i.e("1364")]).then(i.bind(i,3313)),y),P=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("9011"),i.e("7226"),i.e("9427")]).then(i.bind(i,4078)),y),L=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("6802")]).then(i.bind(i,3801)),y),S=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5576"),i.e("7226"),i.e("2973")]).then(i.bind(i,4109)),y),C=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("582")]).then(i.bind(i,4789)),y),U=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("2126"),i.e("992")]).then(i.bind(i,787)),y),W=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("682"),i.e("9789"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("2126"),i.e("1780"),i.e("2008")]).then(i.bind(i,637)),{featureName:"default-ward-view",moduleName:o.A,swrConfig:{refreshInterval:6e4}}),q=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("682"),i.e("9789"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("2126"),i.e("1780"),i.e("412")]).then(i.bind(i,9801)),{featureName:"maternal-ward-view",moduleName:o.A,swrConfig:{refreshInterval:6e4}}),O=(0,n.getAsyncLifecycle)(()=>i.e("6703").then(i.bind(i,1378)),y),R=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("2495")]).then(i.bind(i,8866)),y),D=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("2162")]).then(i.bind(i,1193)),y);function N(){(0,n.registerBreadcrumbs)([]),(0,n.defineConfigSchema)(o.A,s),(0,n.defineExtensionConfigSchema)("ward-patient-discharge",p),(0,n.registerFeatureFlag)("bedmanagement-module","Bed management module","Enables features related to bed management / assignment. Requires the backend bed management module to be installed.")}}}]);
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["3560"],{4767(e,t,i){var n={"./uk.json":["723","9072"],"./ar.json":["4132","7045"],"./ru_RU.json":["986","8359"],"./uz_UZ.json":["890","7175"],"./fr.json":["4055","6508"],"./sw_KE.json":["8618","903"],"./uz.json":["3584","6377"],"./en.json":["4300","5117"],"./ky.json":["8163","2416"],"./pl.json":["1119","6724"],"./sq.json":["8371","4928"],"./ka.json":["795","1480"],"./si.json":["6859","6904"],"./zh_TW.json":["439","556"],"./de.json":["4944","5145"],"./lg.json":["4618","8695"],"./vi.json":["9214","6371"],"./tr.json":["5241","434"],"./es_MX.json":["8349","1646"],"./tr_TR.json":["7519","1869"],"./zh_CN.json":["9879","5644"],"./en_US.json":["9569","4106"],"./he.json":["4652","2317"],"./id.json":["2690","6047"],"./ku.json":["9895","4348"],"./es.json":["3099","7912"],"./ne.json":["2146","5503"],"./ar_SY.json":["7617","282"],"./uz@Latn.json":["7097","4658"],"./bn.json":["7159","6444"],"./cs.json":["6589","7182"],"./zh.json":["5661","7742"],"./hi_IN.json":["5442","4383"],"./pt_BR.json":["4087","1877"],"./qu.json":["5173","8358"],"./ro_RO.json":["6022","3963"],"./sw.json":["9913","3378"],"./am.json":["1197","9806"],"./pt.json":["6679","5132"],"./it.json":["9538","4111"],"./km.json":["4335","5940"],"./hi.json":["6840","2881"]};function s(e){if(!i.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],s=t[0];return i.e(t[1]).then(function(){return i(s)})}s.keys=()=>Object.keys(n),s.id=4767,e.exports=s},5132(e,t,i){"use strict";i.d(t,{A:()=>n});let n="@openmrs/esm-ward-app"},7227(e,t,i){"use strict";i.r(t),i.d(t,{patientTransferAndSwapWorkspaceSiderailIcon:()=>I,root:()=>f,wardDashboardLink:()=>u,wardPatientCancelAdmissionRequestWorkspace:()=>w,wardPatientNotesActionButton:()=>T,maternalWardView:()=>q,clinicalFormWorkspaceSideRailIcon:()=>S,patientDischargeWorkspace:()=>j,wardPatientWorkspaceBanner:()=>O,admitPatientFormWorkspace:()=>_,startupApp:()=>N,wardPatientNotesWorkspace:()=>A,patientTransferAndSwapWorkspace:()=>v,wardPatientWorkspace:()=>g,defaultWardView:()=>W,createAdmissionEncounterWorkspace:()=>U,orderBasketWorkspaceSideRailIcon:()=>C,importTranslation:()=>c,noteHistoryModal:()=>D,patientDischargeWorkspaceSideRailIcon:()=>P,patientTransferRequestWorkspace:()=>k,wardPatientActionButton:()=>b,wardView:()=>h,admissionRequestWorkspace:()=>m,deleteNoteModal:()=>R,cancelAdmissionRequestWorkspace:()=>L});var n=i(3422);let s={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:n.Type.Array,_default:[],_description:"Configures obs values to display.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:n.Type.UUID,_description:"Identifies the concept to use to identify the desired observations."},label:{_type:n.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:n.Type.String,_default:"descending",_description:"One of 'ascending' or 'descending', specifying whether to display the obs by obsDatetime ascendingly or descendingly.",_validators:[n.validators.oneOf(["ascending","descending"])]},limit:{_type:n.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:n.Type.Boolean,_default:!1,_description:"Optional. If true, limits display to only observations within current visit. Defaults to false"}}},pendingItems:{_type:n.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:n.Type.String,_description:"The unique identifier for this patient card element"},orders:{orderTypes:{_type:n.Type.Array,_description:"Configures pending orders and transfers to display.",_elements:{uuid:{_type:n.Type.UUID,_description:"Identifies the order type."},label:{_type:n.Type.String,_default:"",_description:"The label or i18n key to the translated label to display. If not provided, defaults to 'Orders'"}}}},showPendingItems:{_type:n.Type.Boolean,_description:"Optional. If true, pending items (e.g., number of pending orders) will be displayed on the patient card."}}},patientIdentifier:{_type:n.Type.Array,_default:[{id:"patient-identifier",showIdentifierLabel:!1}],_description:"Configures patient identifier to display. An unconfigured element displays the preferred identifier.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},showIdentifierLabel:{_type:n.Type.Boolean,_description:'If true, the identifier type (eg: "OpenMRS ID") is shown along with the identifier itself. Defaults to false'}}},patientAddress:{_type:n.Type.Array,_default:[{id:"patient-address",fields:["cityVillage","country"]}],_description:"Configures patient address elements.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},fields:{_type:n.Type.Array,_description:"The fields of the address to display",_elements:{_type:n.Type.String,_validators:[n.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:n.Type.Array,_default:[{id:"admission-request-note",conceptUuid:"161011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}],_description:"Configures admission request notes to display.",_elements:{id:{_type:n.Type.String,_description:"The unique identifier for this patient card element"},conceptUuid:{_type:n.Type.UUID,_description:"Required. Identifies the concept for the admission request note."}}},coloredObsTags:{_type:n.Type.Array,_default:[],_description:"Configures observation values to display as Carbon tags.",_elements:{conceptUuid:{_type:n.Type.UUID,_default:"1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",_description:"Required. Identifies the concept to use to identify the desired observations."},summaryLabel:{_type:n.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:n.Type.String,_default:"",_description:"Optional. The custom module to use for translation of the summary label"},summaryLabelColor:{_type:n.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:n.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:n.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:n.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:n.Type.UUID}}}}}}},wards:{_type:n.Type.Array,_default:[{id:"default-ward"}],_description:"Configuration of what type of ward to use at different ward locations.",_elements:{id:{_type:n.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:n.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:n.Type.UUID,_default:"",_description:"The UUID of the location. If not provided, applies to all wards."}}}}},hideWorkspaceVitalsLinks:{_type:n.Type.Boolean,_default:!1,_description:"Configure whether to hide vital history and record vital links in the ward patient workspace."},additionalInpatientNotesConceptUuids:{_type:n.Type.Array,_default:[],_description:"List of uuids of concepts that represent notes to display in the notes view in addition to the consultFreeTextCommentsConcept defined by EMR-API"}};var o=i(5132),a=i(7125),r=i.n(a),d=i(2745);let l={path:"ward",slot:"ward-dashboard-slot",title:"wards",basePath:`${window.spaBase}/home`},p={allowedSessionLocationUuids:{_type:n.Type.Array,_default:[],_description:"If not empty, the discharge button will only show for users whose session location is included in this list. If empty, the discharge button will show for all locations.",_elements:{_type:n.Type.String}}},c=i(4767),y={featureName:"ward",moduleName:o.A},f=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("8340")]).then(i.bind(i,1759)),y),u=(0,n.getSyncLifecycle)(()=>r().createElement(d.BrowserRouter,null,r().createElement(n.DashboardExtension,{path:l.path,title:l.title,basePath:l.basePath,icon:l.icon})),y),h=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("2101")]).then(i.bind(i,8804)),y),m=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5361"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("9471")]).then(i.bind(i,1465)),y),_=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("8424")]).then(i.bind(i,7195)),y),g=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("9080")]).then(i.bind(i,6811)),y),A=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("388")]).then(i.bind(i,2863)),y),b=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("1664")]).then(i.bind(i,9235)),y),w=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("8493")]).then(i.bind(i,7260)),y),T=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("7249")]).then(i.bind(i,2504)),y),v=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("833"),i.e("5296")]).then(i.bind(i,5901)),y),j=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("9983")]).then(i.bind(i,1858)),y),I=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("502")]).then(i.bind(i,7653)),y),k=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("833"),i.e("1364")]).then(i.bind(i,3313)),y),P=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("9011"),i.e("7226"),i.e("9427")]).then(i.bind(i,4078)),y),L=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5066"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("6802")]).then(i.bind(i,3801)),y),S=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("5576"),i.e("7226"),i.e("2973")]).then(i.bind(i,4109)),y),C=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("582")]).then(i.bind(i,4789)),y),U=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("2126"),i.e("992")]).then(i.bind(i,787)),y),W=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("682"),i.e("9789"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("2126"),i.e("1780"),i.e("2008")]).then(i.bind(i,637)),{featureName:"default-ward-view",moduleName:o.A,swrConfig:{refreshInterval:6e4}}),q=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("682"),i.e("9789"),i.e("7226"),i.e("3291"),i.e("7884"),i.e("2126"),i.e("1780"),i.e("412")]).then(i.bind(i,9801)),{featureName:"maternal-ward-view",moduleName:o.A,swrConfig:{refreshInterval:6e4}}),O=(0,n.getAsyncLifecycle)(()=>i.e("6703").then(i.bind(i,1378)),y),R=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("7884"),i.e("2495")]).then(i.bind(i,8866)),y),D=(0,n.getAsyncLifecycle)(()=>Promise.all([i.e("7226"),i.e("3291"),i.e("2162")]).then(i.bind(i,1193)),y);function N(){(0,n.registerBreadcrumbs)([]),(0,n.defineConfigSchema)(o.A,s),(0,n.defineExtensionConfigSchema)("ward-patient-discharge",p),(0,n.registerFeatureFlag)("bedmanagement-module","Bed management module","Enables features related to bed management / assignment. Requires the backend bed management module to be installed.")}}}]);
|
package/dist/388.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["388"],{3356(e,t,n){"use strict";n.d(t,{A:()=>r});let r={wardPatientCard:"-esm-ward__ward-patient-card__wardPatientCard___NjMVe",wardPatientCardButton:"-esm-ward__ward-patient-card__wardPatientCardButton___Xw-ov",activeWardPatientCardButton:"-esm-ward__ward-patient-card__activeWardPatientCardButton___jp465",wardPatientCardRow:"-esm-ward__ward-patient-card__wardPatientCardRow___O-Jht",wardPatientCardPendingItemsRow:"-esm-ward__ward-patient-card__wardPatientCardPendingItemsRow___MzSq2",wardPatientPendingOrdersRow:"-esm-ward__ward-patient-card__wardPatientPendingOrdersRow___rRApd",wardPatientCardExtensionSlot:"-esm-ward__ward-patient-card__wardPatientCardExtensionSlot___WvNzG",wardPatientCardHeader:"-esm-ward__ward-patient-card__wardPatientCardHeader___5a47N",wardPatientCardHeaderBadge:"-esm-ward__ward-patient-card__wardPatientCardHeaderBadge___xnMNB",wardPatientCardDispositionTypeContainer:"-esm-ward__ward-patient-card__wardPatientCardDispositionTypeContainer___yNAdL",wardPatientName:"-esm-ward__ward-patient-card__wardPatientName___w0ALg",wardPatientBedNumber:"-esm-ward__ward-patient-card__wardPatientBedNumber___dxTfe",empty:"-esm-ward__ward-patient-card__empty___fjKgf",bedNumberBox:"-esm-ward__ward-patient-card__bedNumberBox___IUQwS",movementIcon:"-esm-ward__ward-patient-card__movementIcon___D2yrt",cancelTransferRequestButton:"-esm-ward__ward-patient-card__cancelTransferRequestButton___K2Amt",chemistryReferenceIcon:"-esm-ward__ward-patient-card__chemistryReferenceIcon___+cAiI",wardPatientAddress:"-esm-ward__ward-patient-card__wardPatientAddress___4G9m6",wardPatientObsLabel:"-esm-ward__ward-patient-card__wardPatientObsLabel___XO4yd",responsiveTooltip:"-esm-ward__ward-patient-card__responsiveTooltip___p-jmt",dotSeparatedChildren:"-esm-ward__ward-patient-card__dotSeparatedChildren___OdHvX",skeletonText:"-esm-ward__ward-patient-card__skeletonText___E6V6B",unassignedPatient:"-esm-ward__ward-patient-card__unassignedPatient___XyiyN"}},5560(e,t,n){"use strict";n.d(t,{A:()=>r});let r={notesContainer:"-esm-ward__styles__notesContainer___Dtwub",notesContainerHeader:"-esm-ward__styles__notesContainerHeader___Efkqy",notesContainerTitle:"-esm-ward__styles__notesContainerTitle___EZvae",noteTile:"-esm-ward__styles__noteTile___sfWsD",noteHeader:"-esm-ward__styles__noteHeader___3jBnN",noteProviderRole:"-esm-ward__styles__noteProviderRole___KA4yN",noteBody:"-esm-ward__styles__noteBody___7a38e",noteDateAndTime:"-esm-ward__styles__noteDateAndTime___ILzC+",noteProviderName:"-esm-ward__styles__noteProviderName___lIIge",noteSkeletonContainer:"-esm-ward__styles__noteSkeletonContainer___d1rX6",editFields:"-esm-ward__styles__editFields___HkU3c",editButtons:"-esm-ward__styles__editButtons___vAgRh",noteEditedBy:"-esm-ward__styles__noteEditedBy___OgTK+",menuItem:"-esm-ward__styles__menuItem___8kixY"}},3464(e){e.exports=function(){"use strict";var e="millisecond",t="second",n="minute",r="hour",a="week",i="month",s="quarter",o="year",d="date",u="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},m="en",p={};p[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var f="$isDayjsObject",h=function(e){return e instanceof g||!(!e||!e[f])},w=function e(t,n,r){var a;if(!t)return m;if("string"==typeof t){var i=t.toLowerCase();p[i]&&(a=i),n&&(p[i]=n,a=i);var s=t.split("-");if(!a&&s.length>1)return e(s[0])}else{var o=t.name;p[o]=t,a=o}return!r&&a&&(m=a),a||!r&&m},y=function(e,t){if(h(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new g(n)},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t);return(t<=0?"+":"-")+_(Math.floor(n/60),2,"0")+":"+_(n%60,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),a=t.clone().add(r,i),s=n-a<0,o=t.clone().add(r+(s?-1:1),i);return+(-(r+(n-a)/(s?a-o:o-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return({M:i,y:o,w:a,d:"day",D:d,h:r,m:n,s:t,ms:e,Q:s})[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};v.l=w,v.i=h,v.w=function(e,t){return y(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var g=function(){function _(e){this.$L=w(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[f]=!0}var m=_.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(c);if(r){var a=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return v},m.isValid=function(){return this.$d.toString()!==u},m.isSame=function(e,t){var n=y(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return y(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<y(e)},m.$g=function(e,t,n){return v.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,s){var u=this,c=!!v.u(s)||s,l=v.p(e),_=function(e,t){var n=v.w(u.$u?Date.UTC(u.$y,t,e):new Date(u.$y,t,e),u);return c?n:n.endOf("day")},m=function(e,t){return v.w(u.toDate()[e].apply(u.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),u)},p=this.$W,f=this.$M,h=this.$D,w="set"+(this.$u?"UTC":"");switch(l){case o:return c?_(1,0):_(31,11);case i:return c?_(1,f):_(0,f+1);case a:var y=this.$locale().weekStart||0,g=(p<y?p+7:p)-y;return _(c?h-g:h+(6-g),f);case"day":case d:return m(w+"Hours",0);case r:return m(w+"Minutes",1);case n:return m(w+"Seconds",2);case t:return m(w+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(a,s){var u,c=v.p(a),l="set"+(this.$u?"UTC":""),_=((u={}).day=l+"Date",u[d]=l+"Date",u[i]=l+"Month",u[o]=l+"FullYear",u[r]=l+"Hours",u[n]=l+"Minutes",u[t]=l+"Seconds",u[e]=l+"Milliseconds",u)[c],m="day"===c?this.$D+(s-this.$W):s;if(c===i||c===o){var p=this.clone().set(d,1);p.$d[_](m),p.init(),this.$d=p.set(d,Math.min(this.$D,p.daysInMonth())).$d}else _&&this.$d[_](m);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[v.p(e)]()},m.add=function(e,s){var d,u=this;e=Number(e);var c=v.p(s),l=function(t){var n=y(u);return v.w(n.date(n.date()+Math.round(t*e)),u)};if(c===i)return this.set(i,this.$M+e);if(c===o)return this.set(o,this.$y+e);if("day"===c)return l(1);if(c===a)return l(7);var _=((d={})[n]=6e4,d[r]=36e5,d[t]=1e3,d)[c]||1,m=this.$d.getTime()+e*_;return v.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||u;var r=e||"YYYY-MM-DDTHH:mm:ssZ",a=v.z(this),i=this.$H,s=this.$m,o=this.$M,d=n.weekdays,c=n.months,_=n.meridiem,m=function(e,n,a,i){return e&&(e[n]||e(t,r))||a[n].slice(0,i)},p=function(e){return v.s(i%12||12,e,"0")},f=_||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(l,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return v.s(t.$y,4,"0");case"M":return o+1;case"MM":return v.s(o+1,2,"0");case"MMM":return m(n.monthsShort,o,c,3);case"MMMM":return m(c,o);case"D":return t.$D;case"DD":return v.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return m(n.weekdaysMin,t.$W,d,2);case"ddd":return m(n.weekdaysShort,t.$W,d,3);case"dddd":return d[t.$W];case"H":return String(i);case"HH":return v.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(i,s,!0);case"A":return f(i,s,!1);case"m":return String(s);case"mm":return v.s(s,2,"0");case"s":return String(t.$s);case"ss":return v.s(t.$s,2,"0");case"SSS":return v.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(e,d,u){var c,l=this,_=v.p(d),m=y(e),p=(m.utcOffset()-this.utcOffset())*6e4,f=this-m,h=function(){return v.m(l,m)};switch(_){case o:c=h()/12;break;case i:c=h();break;case s:c=h()/3;break;case a:c=(f-p)/6048e5;break;case"day":c=(f-p)/864e5;break;case r:c=f/36e5;break;case n:c=f/6e4;break;case t:c=f/1e3;break;default:c=f}return u?c:v.a(c)},m.daysInMonth=function(){return this.endOf(i).$D},m.$locale=function(){return p[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=w(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return v.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},_}(),C=g.prototype;return y.prototype=C,[["$ms",e],["$s",t],["$m",n],["$H",r],["$W","day"],["$M",i],["$y",o],["$D",d]].forEach(function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),y.extend=function(e,t){return e.$i||(e(t,g,y),e.$i=!0),y},y.locale=w,y.isDayjs=h,y.unix=function(e){return y(1e3*e)},y.en=p[m],y.Ls=p,y.p={},y}()},3724(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(2895),a=n(7125),i=n(4498),s=n.n(i);let o=`custom:${[["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(e=>e.join(":")).join(",")}`;function d(){let e=s()(`${r.restBaseUrl}/emrapi/configuration?v=${o}`,r.openmrsFetch);return(0,a.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}},1378(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(7125),a=n.n(r),i=n(3373),s=n.n(i),o=n(2895),d=n(3356);let u=({wardPatient:e})=>{let{patient:t}=e??{},{WardPatientHeader:n}=(0,o.useAppContext)("ward-view-context")??{};return t?n?a().createElement("div",{className:s()("-esm-ward__style__wardWorkspacePatientBanner___t0OA5",d.A.wardPatientCard)},a().createElement(n,{wardPatient:e})):a().createElement(a().Fragment,null):(console.warn("Patient details were not received by the ward workspace"),null)}},2863(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>T});var r=n(7125),a=n.n(r),i=n(5921),s=n(1533),o=n(4049),d=n(824),u=n(5910),c=n(2895),l=n(5132),_=n(3724);let m={formContainer:"-esm-ward__notes__formContainer___dGL0G",form:"-esm-ward__notes__form___FhC07",row:"-esm-ward__notes__row___qY+Yr",columnLabel:"-esm-ward__notes__columnLabel___XjTfg",saveButtonContainer:"-esm-ward__notes__saveButtonContainer___5q3Jk",saveButton:"-esm-ward__notes__saveButton___FK4Bu"};var p=n(1378),f=n(3464),h=n.n(f),w=n(5560);let y=()=>a().createElement(u.Tile,{className:w.A.noteTile,"data-testid":"in-patient-note-skeleton"},a().createElement("div",{className:w.A.noteHeader},a().createElement(u.SkeletonText,{heading:!0,width:"30%"}),a().createElement(u.SkeletonText,{width:"20%"})),a().createElement(u.SkeletonText,{width:"15%"}),a().createElement(u.SkeletonText,{width:"100%"}),a().createElement(u.SkeletonText,{width:"80%"})),v=({note:e,mutatePatientNotes:t,promptBeforeClosing:n})=>{let{t:s}=(0,i.useTranslation)(),[o,d]=(0,r.useState)(!1),[l,_]=(0,r.useState)(e.encounterNote),m=!(0,c.isDesktop)((0,c.useLayoutType)()),[p,f]=(0,r.useState)(!1),{emrConfiguration:y}=(0,c.useEmrConfiguration)(),v=e.encounterTypeUuid===y?.inpatientNoteEncounterType?.uuid;(0,r.useEffect)(()=>{n(o)},[o,n]);let g=async()=>{try{var n;f(!0),await (n=e.obsUuid,(0,c.openmrsFetch)(`${c.restBaseUrl}/obs/${n}`,{headers:{"Content-Type":"application/json"},method:"POST",body:{value:l}})),d(!1),(0,c.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:s("patientNoteNowVisible","It should be now visible in the notes history"),title:s("visitNoteSaved","Patient note saved")}),t()}catch(e){(0,c.showSnackbar)({isLowContrast:!0,kind:"error",subtitle:e?.responseBody?.error?.translatedMessage??e?.responseBody?.error?.message,title:s("errorSavingPatientNote","Error saving patient note")})}finally{f(!1)}};return a().createElement("div",{className:w.A.noteTile},a().createElement(u.Stack,{gap:4},a().createElement("div",{className:w.A.noteHeader},v&&a().createElement(u.OverflowMenu,{className:w.A.overflowMenu,flipped:!0},!o&&e.obsUuid&&a().createElement(u.OverflowMenuItem,{"aria-label":(0,c.getCoreTranslation)("edit"),id:"edit note-"+e.encounterUuid,className:w.A.menuItem,hasDivider:!0,itemText:(0,c.getCoreTranslation)("edit"),onClick:()=>{d(!0)}}),e.isEdited&&a().createElement(u.OverflowMenuItem,{"aria-label":s("viewEditHistory","View edit history"),id:"view-history-"+e.encounterUuid,className:w.A.menuItem,itemText:s("viewEditHistory","View edit history"),onClick:()=>{let t=(0,c.showModal)("note-history-modal",{close:()=>t(),note:e})}}),a().createElement(u.OverflowMenuItem,{"aria-label":(0,c.getCoreTranslation)("delete"),id:"delete-note-"+e.encounterUuid,isDelete:!0,className:w.A.menuItem,itemText:(0,c.getCoreTranslation)("delete"),onClick:()=>{let n=(0,c.showModal)("delete-note-modal",{close:()=>n(),encounterUuid:e.encounterUuid,onDelete:()=>t()})}}))),o?a().createElement(u.Layer,null,a().createElement(u.Stack,{gap:3},a().createElement(u.TextArea,{className:w.A.textArea,id:"editNote",rows:6,value:l,onChange:e=>_(e.target.value),labelText:s("editNote","Edit note")}),a().createElement("div",{className:w.A.editButtons},a().createElement(u.Button,{onClick:()=>{d(!1),_(e.encounterNote)},kind:"secondary",size:m?"lg":"sm"},s("cancel","Cancel")),a().createElement(u.Button,{onClick:g,kind:"primary",size:m?"lg":"sm"},p?a().createElement(u.InlineLoading,{description:s("saving","Saving...")}):s("saveEdit","Save edit"))))):a().createElement(a().Fragment,null,a().createElement("div",{className:w.A.noteBody},e.encounterNote),a().createElement("div",{className:w.A.noteProviderName},s("writtenBy","Written by: {{name}}, {{date}}",{name:e.encounterProvider,date:h()(e.encounterNoteRecordedAt).format("D MMM YYYY, HH:mm")})),e.isEdited&&e.lastEditedBy&&a().createElement("div",{className:w.A.noteEditedBy},s("lastEditedBy","Last edited by: {{name}}, {{date}}",{name:e.lastEditedBy,date:h()(e.lastEditedAt).format("D MMM YYYY, HH:mm")})))))},g=({patientNotes:e,mutatePatientNotes:t,isLoading:n,errorFetchingPatientNotes:r,promptBeforeClosing:s})=>{let{t:o}=(0,i.useTranslation)();return n||0!==e.length||r?a().createElement("div",{className:w.A.notesContainer},a().createElement("div",{className:w.A.notesContainerHeader},a().createElement("div",{className:w.A.notesContainerTitle},"History")),n?[1,2,3,4].map((e,t)=>a().createElement(y,{key:t})):null,e.map(e=>a().createElement(v,{key:e.encounterUuid,note:e,mutatePatientNotes:t,promptBeforeClosing:s})),r&&a().createElement(u.InlineNotification,{kind:"error",title:o("patientNotesDidntLoad","Patient notes didn't load"),subtitle:o("fetchingPatientNotesFailed","Fetching patient notes failed. Try refreshing the page or contact your system administrator."),lowContrast:!0,hideCloseButton:!0})):null},C=s.Ik({wardClinicalNote:s.Yj().refine(e=>e.trim().length>0,{message:(0,c.translateFrom)(l.A,"clinicalNoteErrorMessage","Clinical note is required")})}),T=({groupProps:{wardPatient:e},closeWorkspace:t})=>{let n=e.patient.uuid,s=e?.visit?.uuid,{emrConfiguration:l,isLoadingEmrConfiguration:f,errorFetchingEmrConfiguration:h}=(0,_.A)(),w=(0,c.useConfig)(),{t:y}=(0,i.useTranslation)(),v=(0,c.useSession)(),{patientNotes:T,mutatePatientNotes:E,isLoadingPatientNotes:N,errorFetchingPatientNotes:$}=function(e,t,n){let a=`${c.restBaseUrl}/encounter?patient=${e}&visit=${t}&v=custom:(uuid,encounterDatetime,patient:(uuid),obs:(uuid,concept:(uuid),dateCreated,value:(uuid),previousVersions:(value,dateCreated,creator),creator),encounterType,encounterProviders:(uuid,provider:(uuid,person:(uuid,display)))`,{data:i,error:s,isLoading:o,isValidating:d,mutate:u}=(0,c.useOpenmrsFetchAll)(e?a:null),l=(0,r.useMemo)(()=>i?i.flatMap(e=>e.obs?.reduce((t,r)=>(n.includes(r.concept.uuid)&&t.push({encounterUuid:e.uuid,obsUuid:r.uuid,encounterNote:r.value,encounterNoteRecordedAt:e.encounterDatetime,encounterProvider:e.encounterProviders.map(e=>e.provider.person.display).join(", "),conceptUuid:r.concept.uuid,encounterTypeUuid:e.encounterType.uuid,isEdited:(r.previousVersions?.length??0)>0,lastEditedBy:r.creator?.person?.display??r.creator?.display??"",lastEditedAt:r.dateCreated,editHistory:(r.previousVersions??[]).map(e=>({note:e.value,recordedAt:e.dateCreated,recordedBy:e.creator?.person?.display??e.creator?.display??""}))}),t),[])).sort((e,t)=>new Date(t.encounterNoteRecordedAt).getTime()-new Date(e.encounterNoteRecordedAt).getTime()):[],[i,n]);return(0,r.useMemo)(()=>({patientNotes:l,errorFetchingPatientNotes:s,isLoadingPatientNotes:o,isValidatingPatientNotes:d,mutatePatientNotes:u}),[l,o,d,u,s])}(n,s,[l?.consultFreeTextCommentsConcept?.uuid,...w.additionalInpatientNotesConceptUuids]),[b,S]=(0,r.useState)(!1),[P,k]=(0,r.useState)(!1),{control:M,handleSubmit:D,formState:{errors:A,isDirty:B}}=(0,d.mN)({mode:"onSubmit",resolver:(0,o.u)(C),defaultValues:{wardClinicalNote:""}}),L=v?.sessionLocation?.uuid,x=v?.currentProvider?.uuid,I=(0,r.useCallback)(e=>{let{wardClinicalNote:r}=e;S(!0),(function(e,t=new AbortController){return(0,c.openmrsFetch)(`${c.restBaseUrl}/encounter`,{headers:{"Content-Type":"application/json"},method:"POST",body:e,signal:t.signal})})({patient:n,location:L,visit:s,encounterType:l?.inpatientNoteEncounterType?.uuid,encounterProviders:[{encounterRole:l?.clinicianEncounterRole?.uuid,provider:x}],obs:r?[{concept:{uuid:l?.consultFreeTextCommentsConcept.uuid,display:""},value:r}]:[]},new AbortController).then(async()=>{(0,c.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:y("patientNoteNowVisible","It should be now visible in the notes history"),title:y("visitNoteSaved","Patient note saved")}),E(),await t({discardUnsavedChanges:!0}),(0,c.closeWorkspaceGroup2)()}).catch(e=>{(0,c.showSnackbar)({isLowContrast:!1,kind:"error",subtitle:e?.message,title:y("patientNoteSaveError","Error saving patient note")})}).finally(()=>S(!1))},[l?.clinicianEncounterRole?.uuid,l?.consultFreeTextCommentsConcept?.uuid,l?.inpatientNoteEncounterType?.uuid,L,E,n,x,y,t,s]);return a().createElement(c.Workspace2,{hasUnsavedChanges:B||P,title:y("inpatientNotesWorkspaceTitle","In-patient notes")},a().createElement(p.default,{wardPatient:e}),a().createElement(u.Form,{className:m.form,onSubmit:D(I,e=>console.error(e))},h&&a().createElement("div",{className:m.formError},a().createElement(u.InlineNotification,{kind:"error",title:y("somePartsOfTheFormDidntLoad","Some parts of the form didn't load"),subtitle:y("fetchingEmrConfigurationFailed","Fetching EMR configuration failed. Try refreshing the page or contact your system administrator."),lowContrast:!0,hideCloseButton:!0})),a().createElement(u.Stack,{className:m.formContainer,gap:4},a().createElement(u.Row,{className:m.row},a().createElement(u.Column,{sm:1},a().createElement("span",{className:m.columnLabel},y("note","Note"))),a().createElement(u.Column,{sm:3},a().createElement(d.xI,{name:"wardClinicalNote",control:M,render:({field:{onChange:e,onBlur:t,value:n}})=>a().createElement(c.ResponsiveWrapper,null,a().createElement(u.TextArea,{id:"additionalNote",invalid:!!A.wardClinicalNote,invalidText:A.wardClinicalNote?.message,labelText:y("clinicalNoteLabel","Write your notes"),onBlur:t,onChange:t=>{e(t)},placeholder:y("wardClinicalNotePlaceholder","Write any notes here"),rows:6,value:n}))}))),a().createElement(u.Button,{className:m.saveButton,disabled:b||f||h,kind:"primary",type:"submit"},b?a().createElement(u.InlineLoading,{description:y("saving","Saving...")}):a().createElement("span",null,(0,c.getCoreTranslation)("save"))))),a().createElement(g,{patientNotes:T,mutatePatientNotes:E,isLoading:N||f,errorFetchingPatientNotes:$,promptBeforeClosing:k}))}}}]);
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["388"],{3356(e,t,n){"use strict";n.d(t,{A:()=>r});let r={wardPatientCard:"-esm-ward__ward-patient-card__wardPatientCard___NjMVe",wardPatientCardButton:"-esm-ward__ward-patient-card__wardPatientCardButton___Xw-ov",activeWardPatientCardButton:"-esm-ward__ward-patient-card__activeWardPatientCardButton___jp465",wardPatientCardRow:"-esm-ward__ward-patient-card__wardPatientCardRow___O-Jht",wardPatientCardPendingItemsRow:"-esm-ward__ward-patient-card__wardPatientCardPendingItemsRow___MzSq2",wardPatientPendingOrdersRow:"-esm-ward__ward-patient-card__wardPatientPendingOrdersRow___rRApd",wardPatientCardExtensionSlot:"-esm-ward__ward-patient-card__wardPatientCardExtensionSlot___WvNzG",wardPatientCardHeader:"-esm-ward__ward-patient-card__wardPatientCardHeader___5a47N",wardPatientCardHeaderBadge:"-esm-ward__ward-patient-card__wardPatientCardHeaderBadge___xnMNB",wardPatientCardDispositionTypeContainer:"-esm-ward__ward-patient-card__wardPatientCardDispositionTypeContainer___yNAdL",wardPatientName:"-esm-ward__ward-patient-card__wardPatientName___w0ALg",wardPatientBedNumber:"-esm-ward__ward-patient-card__wardPatientBedNumber___dxTfe",empty:"-esm-ward__ward-patient-card__empty___fjKgf",bedNumberBox:"-esm-ward__ward-patient-card__bedNumberBox___IUQwS",movementIcon:"-esm-ward__ward-patient-card__movementIcon___D2yrt",cancelTransferRequestButton:"-esm-ward__ward-patient-card__cancelTransferRequestButton___K2Amt",chemistryReferenceIcon:"-esm-ward__ward-patient-card__chemistryReferenceIcon___+cAiI",wardPatientAddress:"-esm-ward__ward-patient-card__wardPatientAddress___4G9m6",wardPatientObsLabel:"-esm-ward__ward-patient-card__wardPatientObsLabel___XO4yd",responsiveTooltip:"-esm-ward__ward-patient-card__responsiveTooltip___p-jmt",dotSeparatedChildren:"-esm-ward__ward-patient-card__dotSeparatedChildren___OdHvX",skeletonText:"-esm-ward__ward-patient-card__skeletonText___E6V6B",unassignedPatient:"-esm-ward__ward-patient-card__unassignedPatient___XyiyN"}},5560(e,t,n){"use strict";n.d(t,{A:()=>r});let r={notesContainer:"-esm-ward__styles__notesContainer___Dtwub",notesContainerHeader:"-esm-ward__styles__notesContainerHeader___Efkqy",notesContainerTitle:"-esm-ward__styles__notesContainerTitle___EZvae",noteTile:"-esm-ward__styles__noteTile___sfWsD",noteHeader:"-esm-ward__styles__noteHeader___3jBnN",noteProviderRole:"-esm-ward__styles__noteProviderRole___KA4yN",noteBody:"-esm-ward__styles__noteBody___7a38e",noteDateAndTime:"-esm-ward__styles__noteDateAndTime___ILzC+",noteProviderName:"-esm-ward__styles__noteProviderName___lIIge",noteSkeletonContainer:"-esm-ward__styles__noteSkeletonContainer___d1rX6",editFields:"-esm-ward__styles__editFields___HkU3c",editButtons:"-esm-ward__styles__editButtons___vAgRh",noteEditedBy:"-esm-ward__styles__noteEditedBy___OgTK+",menuItem:"-esm-ward__styles__menuItem___8kixY"}},3464(e){e.exports=function(){"use strict";var e="millisecond",t="second",n="minute",r="hour",a="week",i="month",s="quarter",o="year",d="date",u="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},m="en",p={};p[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var f="$isDayjsObject",h=function(e){return e instanceof g||!(!e||!e[f])},w=function e(t,n,r){var a;if(!t)return m;if("string"==typeof t){var i=t.toLowerCase();p[i]&&(a=i),n&&(p[i]=n,a=i);var s=t.split("-");if(!a&&s.length>1)return e(s[0])}else{var o=t.name;p[o]=t,a=o}return!r&&a&&(m=a),a||!r&&m},y=function(e,t){if(h(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new g(n)},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t);return(t<=0?"+":"-")+_(Math.floor(n/60),2,"0")+":"+_(n%60,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),a=t.clone().add(r,i),s=n-a<0,o=t.clone().add(r+(s?-1:1),i);return+(-(r+(n-a)/(s?a-o:o-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return({M:i,y:o,w:a,d:"day",D:d,h:r,m:n,s:t,ms:e,Q:s})[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};v.l=w,v.i=h,v.w=function(e,t){return y(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var g=function(){function _(e){this.$L=w(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[f]=!0}var m=_.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(c);if(r){var a=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return v},m.isValid=function(){return this.$d.toString()!==u},m.isSame=function(e,t){var n=y(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return y(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<y(e)},m.$g=function(e,t,n){return v.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,s){var u=this,c=!!v.u(s)||s,l=v.p(e),_=function(e,t){var n=v.w(u.$u?Date.UTC(u.$y,t,e):new Date(u.$y,t,e),u);return c?n:n.endOf("day")},m=function(e,t){return v.w(u.toDate()[e].apply(u.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),u)},p=this.$W,f=this.$M,h=this.$D,w="set"+(this.$u?"UTC":"");switch(l){case o:return c?_(1,0):_(31,11);case i:return c?_(1,f):_(0,f+1);case a:var y=this.$locale().weekStart||0,g=(p<y?p+7:p)-y;return _(c?h-g:h+(6-g),f);case"day":case d:return m(w+"Hours",0);case r:return m(w+"Minutes",1);case n:return m(w+"Seconds",2);case t:return m(w+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(a,s){var u,c=v.p(a),l="set"+(this.$u?"UTC":""),_=((u={}).day=l+"Date",u[d]=l+"Date",u[i]=l+"Month",u[o]=l+"FullYear",u[r]=l+"Hours",u[n]=l+"Minutes",u[t]=l+"Seconds",u[e]=l+"Milliseconds",u)[c],m="day"===c?this.$D+(s-this.$W):s;if(c===i||c===o){var p=this.clone().set(d,1);p.$d[_](m),p.init(),this.$d=p.set(d,Math.min(this.$D,p.daysInMonth())).$d}else _&&this.$d[_](m);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[v.p(e)]()},m.add=function(e,s){var d,u=this;e=Number(e);var c=v.p(s),l=function(t){var n=y(u);return v.w(n.date(n.date()+Math.round(t*e)),u)};if(c===i)return this.set(i,this.$M+e);if(c===o)return this.set(o,this.$y+e);if("day"===c)return l(1);if(c===a)return l(7);var _=((d={})[n]=6e4,d[r]=36e5,d[t]=1e3,d)[c]||1,m=this.$d.getTime()+e*_;return v.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||u;var r=e||"YYYY-MM-DDTHH:mm:ssZ",a=v.z(this),i=this.$H,s=this.$m,o=this.$M,d=n.weekdays,c=n.months,_=n.meridiem,m=function(e,n,a,i){return e&&(e[n]||e(t,r))||a[n].slice(0,i)},p=function(e){return v.s(i%12||12,e,"0")},f=_||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(l,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return v.s(t.$y,4,"0");case"M":return o+1;case"MM":return v.s(o+1,2,"0");case"MMM":return m(n.monthsShort,o,c,3);case"MMMM":return m(c,o);case"D":return t.$D;case"DD":return v.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return m(n.weekdaysMin,t.$W,d,2);case"ddd":return m(n.weekdaysShort,t.$W,d,3);case"dddd":return d[t.$W];case"H":return String(i);case"HH":return v.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(i,s,!0);case"A":return f(i,s,!1);case"m":return String(s);case"mm":return v.s(s,2,"0");case"s":return String(t.$s);case"ss":return v.s(t.$s,2,"0");case"SSS":return v.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(e,d,u){var c,l=this,_=v.p(d),m=y(e),p=(m.utcOffset()-this.utcOffset())*6e4,f=this-m,h=function(){return v.m(l,m)};switch(_){case o:c=h()/12;break;case i:c=h();break;case s:c=h()/3;break;case a:c=(f-p)/6048e5;break;case"day":c=(f-p)/864e5;break;case r:c=f/36e5;break;case n:c=f/6e4;break;case t:c=f/1e3;break;default:c=f}return u?c:v.a(c)},m.daysInMonth=function(){return this.endOf(i).$D},m.$locale=function(){return p[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=w(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return v.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},_}(),C=g.prototype;return y.prototype=C,[["$ms",e],["$s",t],["$m",n],["$H",r],["$W","day"],["$M",i],["$y",o],["$D",d]].forEach(function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),y.extend=function(e,t){return e.$i||(e(t,g,y),e.$i=!0),y},y.locale=w,y.isDayjs=h,y.unix=function(e){return y(1e3*e)},y.en=p[m],y.Ls=p,y.p={},y}()},3724(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(3422),a=n(7125),i=n(4498),s=n.n(i);let o=`custom:${[["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(e=>e.join(":")).join(",")}`;function d(){let e=s()(`${r.restBaseUrl}/emrapi/configuration?v=${o}`,r.openmrsFetch);return(0,a.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}},1378(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(7125),a=n.n(r),i=n(3373),s=n.n(i),o=n(3422),d=n(3356);let u=({wardPatient:e})=>{let{patient:t}=e??{},{WardPatientHeader:n}=(0,o.useAppContext)("ward-view-context")??{};return t?n?a().createElement("div",{className:s()("-esm-ward__style__wardWorkspacePatientBanner___t0OA5",d.A.wardPatientCard)},a().createElement(n,{wardPatient:e})):a().createElement(a().Fragment,null):(console.warn("Patient details were not received by the ward workspace"),null)}},2863(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>T});var r=n(7125),a=n.n(r),i=n(5921),s=n(1533),o=n(4049),d=n(824),u=n(5910),c=n(3422),l=n(5132),_=n(3724);let m={formContainer:"-esm-ward__notes__formContainer___dGL0G",form:"-esm-ward__notes__form___FhC07",row:"-esm-ward__notes__row___qY+Yr",columnLabel:"-esm-ward__notes__columnLabel___XjTfg",saveButtonContainer:"-esm-ward__notes__saveButtonContainer___5q3Jk",saveButton:"-esm-ward__notes__saveButton___FK4Bu"};var p=n(1378),f=n(3464),h=n.n(f),w=n(5560);let y=()=>a().createElement(u.Tile,{className:w.A.noteTile,"data-testid":"in-patient-note-skeleton"},a().createElement("div",{className:w.A.noteHeader},a().createElement(u.SkeletonText,{heading:!0,width:"30%"}),a().createElement(u.SkeletonText,{width:"20%"})),a().createElement(u.SkeletonText,{width:"15%"}),a().createElement(u.SkeletonText,{width:"100%"}),a().createElement(u.SkeletonText,{width:"80%"})),v=({note:e,mutatePatientNotes:t,promptBeforeClosing:n})=>{let{t:s}=(0,i.useTranslation)(),[o,d]=(0,r.useState)(!1),[l,_]=(0,r.useState)(e.encounterNote),m=!(0,c.isDesktop)((0,c.useLayoutType)()),[p,f]=(0,r.useState)(!1),{emrConfiguration:y}=(0,c.useEmrConfiguration)(),v=e.encounterTypeUuid===y?.inpatientNoteEncounterType?.uuid;(0,r.useEffect)(()=>{n(o)},[o,n]);let g=async()=>{try{var n;f(!0),await (n=e.obsUuid,(0,c.openmrsFetch)(`${c.restBaseUrl}/obs/${n}`,{headers:{"Content-Type":"application/json"},method:"POST",body:{value:l}})),d(!1),(0,c.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:s("patientNoteNowVisible","It should be now visible in the notes history"),title:s("visitNoteSaved","Patient note saved")}),t()}catch(e){(0,c.showSnackbar)({isLowContrast:!0,kind:"error",subtitle:e?.responseBody?.error?.translatedMessage??e?.responseBody?.error?.message,title:s("errorSavingPatientNote","Error saving patient note")})}finally{f(!1)}};return a().createElement("div",{className:w.A.noteTile},a().createElement(u.Stack,{gap:4},a().createElement("div",{className:w.A.noteHeader},v&&a().createElement(u.OverflowMenu,{className:w.A.overflowMenu,flipped:!0},!o&&e.obsUuid&&a().createElement(u.OverflowMenuItem,{"aria-label":(0,c.getCoreTranslation)("edit"),id:"edit note-"+e.encounterUuid,className:w.A.menuItem,hasDivider:!0,itemText:(0,c.getCoreTranslation)("edit"),onClick:()=>{d(!0)}}),e.isEdited&&a().createElement(u.OverflowMenuItem,{"aria-label":s("viewEditHistory","View edit history"),id:"view-history-"+e.encounterUuid,className:w.A.menuItem,itemText:s("viewEditHistory","View edit history"),onClick:()=>{let t=(0,c.showModal)("note-history-modal",{close:()=>t(),note:e})}}),a().createElement(u.OverflowMenuItem,{"aria-label":(0,c.getCoreTranslation)("delete"),id:"delete-note-"+e.encounterUuid,isDelete:!0,className:w.A.menuItem,itemText:(0,c.getCoreTranslation)("delete"),onClick:()=>{let n=(0,c.showModal)("delete-note-modal",{close:()=>n(),encounterUuid:e.encounterUuid,onDelete:()=>t()})}}))),o?a().createElement(u.Layer,null,a().createElement(u.Stack,{gap:3},a().createElement(u.TextArea,{className:w.A.textArea,id:"editNote",rows:6,value:l,onChange:e=>_(e.target.value),labelText:s("editNote","Edit note")}),a().createElement("div",{className:w.A.editButtons},a().createElement(u.Button,{onClick:()=>{d(!1),_(e.encounterNote)},kind:"secondary",size:m?"lg":"sm"},s("cancel","Cancel")),a().createElement(u.Button,{onClick:g,kind:"primary",size:m?"lg":"sm"},p?a().createElement(u.InlineLoading,{description:s("saving","Saving...")}):s("saveEdit","Save edit"))))):a().createElement(a().Fragment,null,a().createElement("div",{className:w.A.noteBody},e.encounterNote),a().createElement("div",{className:w.A.noteProviderName},s("writtenBy","Written by: {{name}}, {{date}}",{name:e.encounterProvider,date:h()(e.encounterNoteRecordedAt).format("D MMM YYYY, HH:mm")})),e.isEdited&&e.lastEditedBy&&a().createElement("div",{className:w.A.noteEditedBy},s("lastEditedBy","Last edited by: {{name}}, {{date}}",{name:e.lastEditedBy,date:h()(e.lastEditedAt).format("D MMM YYYY, HH:mm")})))))},g=({patientNotes:e,mutatePatientNotes:t,isLoading:n,errorFetchingPatientNotes:r,promptBeforeClosing:s})=>{let{t:o}=(0,i.useTranslation)();return n||0!==e.length||r?a().createElement("div",{className:w.A.notesContainer},a().createElement("div",{className:w.A.notesContainerHeader},a().createElement("div",{className:w.A.notesContainerTitle},"History")),n?[1,2,3,4].map((e,t)=>a().createElement(y,{key:t})):null,e.map(e=>a().createElement(v,{key:e.encounterUuid,note:e,mutatePatientNotes:t,promptBeforeClosing:s})),r&&a().createElement(u.InlineNotification,{kind:"error",title:o("patientNotesDidntLoad","Patient notes didn't load"),subtitle:o("fetchingPatientNotesFailed","Fetching patient notes failed. Try refreshing the page or contact your system administrator."),lowContrast:!0,hideCloseButton:!0})):null},C=s.Ik({wardClinicalNote:s.Yj().refine(e=>e.trim().length>0,{message:(0,c.translateFrom)(l.A,"clinicalNoteErrorMessage","Clinical note is required")})}),T=({groupProps:{wardPatient:e},closeWorkspace:t})=>{let n=e.patient.uuid,s=e?.visit?.uuid,{emrConfiguration:l,isLoadingEmrConfiguration:f,errorFetchingEmrConfiguration:h}=(0,_.A)(),w=(0,c.useConfig)(),{t:y}=(0,i.useTranslation)(),v=(0,c.useSession)(),{patientNotes:T,mutatePatientNotes:E,isLoadingPatientNotes:N,errorFetchingPatientNotes:$}=function(e,t,n){let a=`${c.restBaseUrl}/encounter?patient=${e}&visit=${t}&v=custom:(uuid,encounterDatetime,patient:(uuid),obs:(uuid,concept:(uuid),dateCreated,value:(uuid),previousVersions:(value,dateCreated,creator),creator),encounterType,encounterProviders:(uuid,provider:(uuid,person:(uuid,display)))`,{data:i,error:s,isLoading:o,isValidating:d,mutate:u}=(0,c.useOpenmrsFetchAll)(e?a:null),l=(0,r.useMemo)(()=>i?i.flatMap(e=>e.obs?.reduce((t,r)=>(n.includes(r.concept.uuid)&&t.push({encounterUuid:e.uuid,obsUuid:r.uuid,encounterNote:r.value,encounterNoteRecordedAt:e.encounterDatetime,encounterProvider:e.encounterProviders.map(e=>e.provider.person.display).join(", "),conceptUuid:r.concept.uuid,encounterTypeUuid:e.encounterType.uuid,isEdited:(r.previousVersions?.length??0)>0,lastEditedBy:r.creator?.person?.display??r.creator?.display??"",lastEditedAt:r.dateCreated,editHistory:(r.previousVersions??[]).map(e=>({note:e.value,recordedAt:e.dateCreated,recordedBy:e.creator?.person?.display??e.creator?.display??""}))}),t),[])).sort((e,t)=>new Date(t.encounterNoteRecordedAt).getTime()-new Date(e.encounterNoteRecordedAt).getTime()):[],[i,n]);return(0,r.useMemo)(()=>({patientNotes:l,errorFetchingPatientNotes:s,isLoadingPatientNotes:o,isValidatingPatientNotes:d,mutatePatientNotes:u}),[l,o,d,u,s])}(n,s,[l?.consultFreeTextCommentsConcept?.uuid,...w.additionalInpatientNotesConceptUuids]),[b,S]=(0,r.useState)(!1),[P,k]=(0,r.useState)(!1),{control:M,handleSubmit:D,formState:{errors:A,isDirty:B}}=(0,d.mN)({mode:"onSubmit",resolver:(0,o.u)(C),defaultValues:{wardClinicalNote:""}}),L=v?.sessionLocation?.uuid,x=v?.currentProvider?.uuid,I=(0,r.useCallback)(e=>{let{wardClinicalNote:r}=e;S(!0),(function(e,t=new AbortController){return(0,c.openmrsFetch)(`${c.restBaseUrl}/encounter`,{headers:{"Content-Type":"application/json"},method:"POST",body:e,signal:t.signal})})({patient:n,location:L,visit:s,encounterType:l?.inpatientNoteEncounterType?.uuid,encounterProviders:[{encounterRole:l?.clinicianEncounterRole?.uuid,provider:x}],obs:r?[{concept:{uuid:l?.consultFreeTextCommentsConcept.uuid,display:""},value:r}]:[]},new AbortController).then(async()=>{(0,c.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:y("patientNoteNowVisible","It should be now visible in the notes history"),title:y("visitNoteSaved","Patient note saved")}),E(),await t({discardUnsavedChanges:!0}),(0,c.closeWorkspaceGroup2)()}).catch(e=>{(0,c.showSnackbar)({isLowContrast:!1,kind:"error",subtitle:e?.message,title:y("patientNoteSaveError","Error saving patient note")})}).finally(()=>S(!1))},[l?.clinicianEncounterRole?.uuid,l?.consultFreeTextCommentsConcept?.uuid,l?.inpatientNoteEncounterType?.uuid,L,E,n,x,y,t,s]);return a().createElement(c.Workspace2,{hasUnsavedChanges:B||P,title:y("inpatientNotesWorkspaceTitle","In-patient notes")},a().createElement(p.default,{wardPatient:e}),a().createElement(u.Form,{className:m.form,onSubmit:D(I,e=>console.error(e))},h&&a().createElement("div",{className:m.formError},a().createElement(u.InlineNotification,{kind:"error",title:y("somePartsOfTheFormDidntLoad","Some parts of the form didn't load"),subtitle:y("fetchingEmrConfigurationFailed","Fetching EMR configuration failed. Try refreshing the page or contact your system administrator."),lowContrast:!0,hideCloseButton:!0})),a().createElement(u.Stack,{className:m.formContainer,gap:4},a().createElement(u.Row,{className:m.row},a().createElement(u.Column,{sm:1},a().createElement("span",{className:m.columnLabel},y("note","Note"))),a().createElement(u.Column,{sm:3},a().createElement(d.xI,{name:"wardClinicalNote",control:M,render:({field:{onChange:e,onBlur:t,value:n}})=>a().createElement(c.ResponsiveWrapper,null,a().createElement(u.TextArea,{id:"additionalNote",invalid:!!A.wardClinicalNote,invalidText:A.wardClinicalNote?.message,labelText:y("clinicalNoteLabel","Write your notes"),onBlur:t,onChange:t=>{e(t)},placeholder:y("wardClinicalNotePlaceholder","Write any notes here"),rows:6,value:n}))}))),a().createElement(u.Button,{className:m.saveButton,disabled:b||f||h,kind:"primary",type:"submit"},b?a().createElement(u.InlineLoading,{description:y("saving","Saving...")}):a().createElement("span",null,(0,c.getCoreTranslation)("save"))))),a().createElement(g,{patientNotes:T,mutatePatientNotes:E,isLoading:N||f,errorFetchingPatientNotes:$,promptBeforeClosing:k}))}}}]);
|
package/dist/412.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["412"],{9801(e,t,a){a.r(t),a.d(t,{default:()=>X});var n=a(7125),i=a.n(n),r=a(2895),l=a(2488),s=a(5084),d=a(5921);function u(e,t=!0,a=null){var n;let i=(n=`${r.restBaseUrl}/emrapi/maternal/mothersAndChildren`,new URL((0,r.makeUrl)(n),window.location.toString())),{mothers:l,children:s,requireChildBornDuringMothersActiveVisit:d,requireChildHasActiveVisit:o,requireMotherHasActiveVisit:c}=e;for(let e of l??[])i.searchParams.append("mother",e);for(let e of s??[])i.searchParams.append("child",e);return i.searchParams.append("requireMotherHasActiveVisit",c?.toString()??"false"),i.searchParams.append("requireChildHasActiveVisit",o?.toString()??"false"),i.searchParams.append("requireChildBornDuringMothersActiveVisit",d?.toString()??"false"),a&&i.searchParams.append("v",a),(0,r.useOpenmrsFetchAll)(t?i:null)}let o="custom:(childAdmission,mother:(person,identifiers:full,uuid),child:(person,identifiers:full,uuid),motherAdmission)";var c=a(4808),m=a(9900),p=a(3373),h=a.n(p),E=a(5910),A=a(3102),g=a(3672),v=a(9390),w=a(4267),f=a(3356);let _=({id:e,patient:t,visit:a})=>{let n=(0,m.UG)("coloredObsTags",e),{conceptUuid:r,summaryLabel:l,summaryLabelColor:s}=n??{},{data:u,isLoading:o}=(0,A.e)({patient:t.uuid,concept:r},null!=r,g.Fx),{t:c}=(0,d.useTranslation)(),p=(0,g.uk)(n?.tags??[]);if(o)return i().createElement("div",{className:f.A.wardPatientCardRow},i().createElement(v.A,null));{let e=u?.filter(e=>e.encounter.visit?.uuid===a?.uuid),t=null!=l?c(l):e?.[0]?.concept?.display,n=[],r=e?.map(e=>{let{display:t,uuid:a}=e.value,r=p?.get(a);return r?i().createElement(w.A,{tooltipContent:(0,g.Fe)(e,c)},i().createElement(E.Tag,{type:r,key:`ward-coded-obs-tag-${e.uuid}`},t)):(n.push(i().createElement("div",{key:a},t," (",(0,g.Fe)(e,c),")")),null)}).filter(e=>null!=e);return r?.length>0||n.length>0?i().createElement("div",{className:f.A.wardPatientCardRow},i().createElement("span",{className:f.A.wardPatientObsLabel},r,n.length>0?i().createElement(w.A,{tooltipContent:n},i().createElement(E.Tag,{type:s},c("countItems","{{count}} {{item}}",{count:n.length,item:t}))):null)):null}};var P=a(2332),C=a(5174);let T=({patient:e,id:t})=>{let a=e?.person?.preferredAddress,n=(0,m.UG)("patientAddress",t);return i().createElement(i().Fragment,null,n?.fields?.map((e,t)=>a?.[e]?i().createElement("div",{key:t},a?.[e]):i().createElement("div",{key:t})))};var y=a(8768),k=a(9474),x=a(3743),N=a(7781);let b=({wardPatient:e})=>{let{patient:t,bed:a,visit:n,inpatientAdmission:r}=e,{firstAdmissionOrTransferEncounter:l}=r??{};return i().createElement("div",{className:h()(f.A.wardPatientCardRow,f.A.wardPatientCardHeader)},a?i().createElement(C.A,{bed:a}):null,i().createElement(k.A,{patient:t}),i().createElement(y.A,{id:"patient-identifier",patient:t}),i().createElement(P.A,{patient:t}),i().createElement(T,{id:"patient-address",patient:t}),i().createElement(x.A,{id:"admission-reason",patient:t,visit:n}),i().createElement(N.A,{firstAdmissionOrTransferEncounter:l}))},q="-esm-ward__maternal-ward-patient-card__motherChildBedDividerLine___gDinQ",M=({inpatientAdmission:e})=>{let t=e?.encounterAssigningToCurrentInpatientLocation.location?.display;return t?i().createElement("div",null,i().createElement("span",null,t)):i().createElement(i().Fragment,null)},O=({otherPatient:e,otherPatientAdmission:t,isOtherPatientTheMother:a,children:n})=>{let l=a?r.MotherIcon:r.BabyIcon;return i().createElement("div",{key:e.uuid,className:f.A.wardPatientCardRow},n,i().createElement("div",{className:"-esm-ward__ward-mother-or-child__motherOrBabyRow___hJ2Dd"},i().createElement("div",{className:"-esm-ward__ward-mother-or-child__motherOrBabyIconDiv___FPqiZ"},i().createElement(l,{className:"-esm-ward__ward-mother-or-child__motherOrBabyIcon___woSNt",size:24})),i().createElement("div",{className:h()("-esm-ward__ward-mother-or-child__motherOrBabyRowElementsDiv___APA02",f.A.dotSeparatedChildren)},i().createElement(k.A,{patient:e}),i().createElement(y.A,{id:"patient-identifier",patient:e}),i().createElement(P.A,{patient:e}),i().createElement(M,{inpatientAdmission:t}))))},R=({wardPatient:e,childrenOfWardPatientInSameBed:t})=>{let{patient:a}=e,{motherChildRelationships:n}=(0,r.useAppContext)("maternal-ward-view-context")??{},{childrenByMotherUuid:l,motherByChildUuid:s}=n??{},d=s?.get(a.uuid),u=l?.get(a.uuid),o=u?.filter(e=>!t?.some(t=>t.patient.uuid===e.patient.uuid));return i().createElement(i().Fragment,null,d&&i().createElement(O,{otherPatient:d.patient,otherPatientAdmission:d.currentAdmission,isOtherPatientTheMother:!0}),o?.map(e=>i().createElement(O,{key:e.patient.uuid,otherPatient:e.patient,otherPatientAdmission:e.currentAdmission,isOtherPatientTheMother:!1})))};var B=a(5001),S=a(8080),D=a(5965),F=a(6213);let I=()=>{let{t:e}=(0,d.useTranslation)();return i().createElement("div",{className:"-esm-ward__maternal-ward-patient-card__motherChildBedDivider___vdlai"},i().createElement("div",{className:q}),i().createElement(E.Tag,{type:"purple"},e("motherChildBedShare","Mother / Child")),i().createElement("div",{className:q}))},L=e=>{let{wardPatient:t,childrenOfWardPatientInSameBed:a}=e,{patient:n,visit:l,bed:s,inpatientAdmission:d}=t,{encounterAssigningToCurrentInpatientLocation:u}=d??{},o=i().createElement(i().Fragment,null,i().createElement(S.A,{wardPatient:t,relatedTransferPatients:a},i().createElement(b,{wardPatient:t}),i().createElement("div",{className:f.A.wardPatientCardHeaderBadge},i().createElement(r.ExtensionSlot,{name:"maternal-ward-patient-card-header-slot",state:{visit:l}})),i().createElement("div",{className:h()(f.A.wardPatientCardRow,f.A.dotSeparatedChildren)},i().createElement(D.A,{encounterAssigningToCurrentInpatientLocation:u}),i().createElement(x.A,{id:"gravida",patient:n,visit:l})),i().createElement(F.A,{wardPatient:t}),i().createElement(B.A,{id:"pending-items",wardPatient:t}),i().createElement(_,{id:"pregnancy-complications",...t}),i().createElement(R,e)),a?.map(e=>{let n=[t,...a.filter(t=>t.patient.uuid!==e.patient.uuid)];return i().createElement(i().Fragment,{key:e.patient.uuid},i().createElement(I,null),i().createElement(S.A,{wardPatient:e,relatedTransferPatients:n},i().createElement(b,{wardPatient:e}),i().createElement("div",{className:f.A.wardPatientCardHeaderBadge},i().createElement(r.ExtensionSlot,{name:"maternal-ward-patient-card-header-slot",state:{visit:e.visit}})),i().createElement(B.A,{id:"pending-items",wardPatient:e})))}));return s?o:i().createElement("div",{className:f.A.unassignedPatient},i().createElement("div",{key:"unassigned-bed-pt-"+t.patient.uuid},o))},H=e=>{let{motherByChildUuid:t,isLoading:a}=e??{},{wardPatientGroupDetails:n}=(0,r.useAppContext)("ward-view-context")??{},{bedLayouts:l,wardAdmittedPatientsWithBed:s,inpatientAdmissionsByPatientUuid:d}=n??{},u=l?.map(e=>{let{patients:n}=e,r=(0,m.yZ)(e),l=new Map,u=n.map(e=>{let t=s?.get(e.uuid);if(t){let{patient:e,visit:a,currentInpatientRequest:n}=t;return{patient:e,visit:a,bed:r,inpatientAdmission:t,inpatientRequest:n||null}}{let t=d.get(e.uuid);return{patient:e,visit:t?.visit,bed:r,inpatientAdmission:t,inpatientRequest:null}}}).filter(e=>{let a=e.patient.uuid,{patient:i}=t?.get(a)??{},r=n.some(e=>e.uuid===i?.uuid);return r&&(l.has(i.uuid)||l.set(i.uuid,[]),l.get(i.uuid).push(e)),!r}).map(e=>i().createElement(L,{key:e.patient.uuid,wardPatient:e,childrenOfWardPatientInSameBed:l.get(e.patient.uuid)}));return i().createElement(c.A,{key:r.uuid,bed:r,patientCards:u,isLoadingDivider:a})});return i().createElement(i().Fragment,null,u)};function V(e){return{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:null,inpatientRequest:e}}var U=a(201),G=a(3863),W=a(103),$=a(6377);let Z=({wardPatient:e,children:t,inpatientRequestsOfWardByPatientUuid:a})=>{let{motherChildRelationships:l}=(0,r.useAppContext)("maternal-ward-view-context")??{},[s,u]=(0,n.useState)([]),{t:o}=(0,d.useTranslation)(),{childrenByMotherUuid:c,motherByChildUuid:m}=l??{},p=(0,n.useMemo)(()=>m?.get(e.patient.uuid)??null,[m,e.patient.uuid]),h=(0,n.useMemo)(()=>c?.get(e.patient.uuid)??[],[c,e.patient.uuid]),A=(0,n.useMemo)(()=>{if(!p)return null;let e=a[p.patient.uuid];return e?V(e):null},[p,a]),g=(0,n.useMemo)(()=>{let e=[];for(let t of h??[]){let n=a[t.patient.uuid];n&&e.push(V(n))}return e},[h,a]),v=(0,n.useMemo)(()=>[...A?[A]:[],...g].filter(e=>s.includes(e.patient.uuid)),[A,g,s]);return i().createElement("div",{className:$.A.admissionRequestCard},i().createElement(G.A,{wardPatient:e}),i().createElement("div",{className:$.A.admissionRequestCardHeaderBadge},i().createElement(r.ExtensionSlot,{name:"maternal-ward-patient-card-header-slot",state:{visit:e.visit}})),i().createElement(_,{id:"pregnancy-complications",...e}),p&&i().createElement(O,{otherPatient:p.patient,otherPatientAdmission:p.currentAdmission,isOtherPatientTheMother:!0},A&&i().createElement("div",null,i().createElement(E.CheckboxGroup,{legendText:""},i().createElement(E.Checkbox,{checked:s.includes(p.patient.uuid),className:$.A.checkbox,id:p.patient.uuid,key:"also-transfer-"+p.patient.uuid,labelText:"ADMIT"===A.inpatientRequest.dispositionType?o("alsoAdmitOrCancel","Also admit / cancel:"):o("alsoTransferOrCancel","Also transfer / cancel:"),onChange:(e,{checked:t,id:a})=>{u(t?[...s,a]:s.filter(e=>e!==a))}})))),h?.map(e=>i().createElement(O,{key:e.patient.uuid,otherPatient:e.patient,otherPatientAdmission:e.currentAdmission,isOtherPatientTheMother:!1},g.some(t=>t.patient.uuid===e.patient.uuid)&&i().createElement("div",null,i().createElement(E.CheckboxGroup,{legendText:""},i().createElement(E.Checkbox,{checked:s.includes(e.patient.uuid),className:$.A.checkbox,id:e.patient.uuid,key:"also-transfer-"+e.patient.uuid,labelText:g.find(t=>t.patient.uuid===e.patient.uuid)?.inpatientRequest.dispositionType==="ADMIT"?o("alsoAdmitOrCancel","Also admit / cancel:"):o("alsoTransferOrCancel","Also transfer / cancel:"),onChange:(e,{checked:t,id:a})=>{u(t?[...s,a]:s.filter(e=>e!==a))}}))))),i().createElement(W.A,{id:"admission-request-note",wardPatient:e}),i().createElement(U.A,{wardPatient:e,relatedTransferPatients:v}))},z=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{t}=(0,d.useTranslation)(),{inpatientRequestResponse:a}=e??{},{inpatientRequests:n,isLoading:l,error:s}=a??{},u=n?.reduce((e,t)=>(e[t.patient.uuid]=t,e),{});return l?i().createElement(v.A,null):s?i().createElement(r.ErrorState,{headerTitle:t("admissionRequests","Admission requests"),error:s}):i().createElement(i().Fragment,null,n?.map((e,t)=>{let a={patient:e.patient,visit:e.visit,bed:null,inpatientRequest:e,inpatientAdmission:null};return i().createElement(Z,{key:`admission-request-card-${t}`,wardPatient:a,inpatientRequestsOfWardByPatientUuid:u})}))},J=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{wardUnassignedPatientsList:t}=e??{},a=t?.map(e=>i().createElement(L,{wardPatient:{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:e,inpatientRequest:e.currentInpatientRequest},childrenOfWardPatientInSameBed:[],key:e.patient.uuid}));return i().createElement(i().Fragment,null,a)};var Q=a(6545),j=a(929),K=a(875);let X=()=>{let e=(0,l.u)();(0,r.useDefineAppContext)("ward-view-context",{wardPatientGroupDetails:e,WardPatientHeader:b});let{allWardPatientUuids:t,isLoading:a}=e,c=function(e,t){let{t:a}=(0,d.useTranslation)(),{data:i,isLoading:l,error:s}=u({mothers:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!1},t&&e.length>0,o),{data:c,isLoading:m,error:p}=u({children:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!1},t&&e.length>0,o);return s&&(0,r.showNotification)({title:a("errorLoadingChildren","Error loading children info"),kind:"error",critical:!0,description:s?.message}),p&&(0,r.showNotification)({title:a("errorLoadingMother","Error loading mother info"),kind:"error",critical:!0,description:p?.message}),(0,n.useMemo)(()=>{let e=new Map,t=new Map,a=l||m;for(let{child:a,childAdmission:n,mother:i,motherAdmission:r}of c??[])e.set(a.uuid,{patient:i,currentAdmission:r}),t.has(i.uuid)||t.set(i.uuid,[]),t.get(i.uuid).push({patient:a,currentAdmission:n});for(let{child:a,childAdmission:n,mother:r,motherAdmission:l}of i??[]){e.set(a.uuid,{patient:r,currentAdmission:l}),t.has(r.uuid)||t.set(r.uuid,[]);let i=t.get(r.uuid);i.some(({patient:e})=>e.uuid===a.uuid)||i.push({patient:a,currentAdmission:n})}return{motherByChildUuid:e,childrenByMotherUuid:t,isLoading:a}},[i,c,l,m])}(Array.from(t),!a);(0,r.useDefineAppContext)("maternal-ward-view-context",{motherChildRelationships:c});let m=i().createElement(H,c),p=i().createElement(K.A,{metrics:[s.d.PATIENTS,s.d.FEMALES_OF_REPRODUCTIVE_AGE,s.d.NEWBORNS,s.d.FREE_BEDS,s.d.TOTAL_BEDS,s.d.PENDING_OUT]}),h=i().createElement(J,null),E=i().createElement(z,null);return i().createElement(i().Fragment,null,i().createElement(j.A,{wardPendingPatients:E,wardMetrics:p}),i().createElement(Q.A,{wardBeds:m,wardUnassignedPatients:h}))}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_ward_app=globalThis.webpackChunk_openmrs_esm_ward_app||[]).push([["412"],{9801(e,t,a){a.r(t),a.d(t,{default:()=>X});var n=a(7125),i=a.n(n),r=a(3422),l=a(2488),s=a(5084),d=a(5921);function u(e,t=!0,a=null){var n;let i=(n=`${r.restBaseUrl}/emrapi/maternal/mothersAndChildren`,new URL((0,r.makeUrl)(n),window.location.toString())),{mothers:l,children:s,requireChildBornDuringMothersActiveVisit:d,requireChildHasActiveVisit:o,requireMotherHasActiveVisit:c}=e;for(let e of l??[])i.searchParams.append("mother",e);for(let e of s??[])i.searchParams.append("child",e);return i.searchParams.append("requireMotherHasActiveVisit",c?.toString()??"false"),i.searchParams.append("requireChildHasActiveVisit",o?.toString()??"false"),i.searchParams.append("requireChildBornDuringMothersActiveVisit",d?.toString()??"false"),a&&i.searchParams.append("v",a),(0,r.useOpenmrsFetchAll)(t?i:null)}let o="custom:(childAdmission,mother:(person,identifiers:full,uuid),child:(person,identifiers:full,uuid),motherAdmission)";var c=a(4808),m=a(9900),p=a(3373),h=a.n(p),E=a(5910),A=a(3102),g=a(3672),v=a(9390),w=a(4267),f=a(3356);let _=({id:e,patient:t,visit:a})=>{let n=(0,m.UG)("coloredObsTags",e),{conceptUuid:r,summaryLabel:l,summaryLabelColor:s}=n??{},{data:u,isLoading:o}=(0,A.e)({patient:t.uuid,concept:r},null!=r,g.Fx),{t:c}=(0,d.useTranslation)(),p=(0,g.uk)(n?.tags??[]);if(o)return i().createElement("div",{className:f.A.wardPatientCardRow},i().createElement(v.A,null));{let e=u?.filter(e=>e.encounter.visit?.uuid===a?.uuid),t=null!=l?c(l):e?.[0]?.concept?.display,n=[],r=e?.map(e=>{let{display:t,uuid:a}=e.value,r=p?.get(a);return r?i().createElement(w.A,{tooltipContent:(0,g.Fe)(e,c)},i().createElement(E.Tag,{type:r,key:`ward-coded-obs-tag-${e.uuid}`},t)):(n.push(i().createElement("div",{key:a},t," (",(0,g.Fe)(e,c),")")),null)}).filter(e=>null!=e);return r?.length>0||n.length>0?i().createElement("div",{className:f.A.wardPatientCardRow},i().createElement("span",{className:f.A.wardPatientObsLabel},r,n.length>0?i().createElement(w.A,{tooltipContent:n},i().createElement(E.Tag,{type:s},c("countItems","{{count}} {{item}}",{count:n.length,item:t}))):null)):null}};var P=a(2332),C=a(5174);let T=({patient:e,id:t})=>{let a=e?.person?.preferredAddress,n=(0,m.UG)("patientAddress",t);return i().createElement(i().Fragment,null,n?.fields?.map((e,t)=>a?.[e]?i().createElement("div",{key:t},a?.[e]):i().createElement("div",{key:t})))};var y=a(8768),k=a(9474),x=a(3743),N=a(7781);let b=({wardPatient:e})=>{let{patient:t,bed:a,visit:n,inpatientAdmission:r}=e,{firstAdmissionOrTransferEncounter:l}=r??{};return i().createElement("div",{className:h()(f.A.wardPatientCardRow,f.A.wardPatientCardHeader)},a?i().createElement(C.A,{bed:a}):null,i().createElement(k.A,{patient:t}),i().createElement(y.A,{id:"patient-identifier",patient:t}),i().createElement(P.A,{patient:t}),i().createElement(T,{id:"patient-address",patient:t}),i().createElement(x.A,{id:"admission-reason",patient:t,visit:n}),i().createElement(N.A,{firstAdmissionOrTransferEncounter:l}))},q="-esm-ward__maternal-ward-patient-card__motherChildBedDividerLine___gDinQ",M=({inpatientAdmission:e})=>{let t=e?.encounterAssigningToCurrentInpatientLocation.location?.display;return t?i().createElement("div",null,i().createElement("span",null,t)):i().createElement(i().Fragment,null)},O=({otherPatient:e,otherPatientAdmission:t,isOtherPatientTheMother:a,children:n})=>{let l=a?r.MotherIcon:r.BabyIcon;return i().createElement("div",{key:e.uuid,className:f.A.wardPatientCardRow},n,i().createElement("div",{className:"-esm-ward__ward-mother-or-child__motherOrBabyRow___hJ2Dd"},i().createElement("div",{className:"-esm-ward__ward-mother-or-child__motherOrBabyIconDiv___FPqiZ"},i().createElement(l,{className:"-esm-ward__ward-mother-or-child__motherOrBabyIcon___woSNt",size:24})),i().createElement("div",{className:h()("-esm-ward__ward-mother-or-child__motherOrBabyRowElementsDiv___APA02",f.A.dotSeparatedChildren)},i().createElement(k.A,{patient:e}),i().createElement(y.A,{id:"patient-identifier",patient:e}),i().createElement(P.A,{patient:e}),i().createElement(M,{inpatientAdmission:t}))))},R=({wardPatient:e,childrenOfWardPatientInSameBed:t})=>{let{patient:a}=e,{motherChildRelationships:n}=(0,r.useAppContext)("maternal-ward-view-context")??{},{childrenByMotherUuid:l,motherByChildUuid:s}=n??{},d=s?.get(a.uuid),u=l?.get(a.uuid),o=u?.filter(e=>!t?.some(t=>t.patient.uuid===e.patient.uuid));return i().createElement(i().Fragment,null,d&&i().createElement(O,{otherPatient:d.patient,otherPatientAdmission:d.currentAdmission,isOtherPatientTheMother:!0}),o?.map(e=>i().createElement(O,{key:e.patient.uuid,otherPatient:e.patient,otherPatientAdmission:e.currentAdmission,isOtherPatientTheMother:!1})))};var B=a(5001),S=a(8080),D=a(5965),F=a(6213);let I=()=>{let{t:e}=(0,d.useTranslation)();return i().createElement("div",{className:"-esm-ward__maternal-ward-patient-card__motherChildBedDivider___vdlai"},i().createElement("div",{className:q}),i().createElement(E.Tag,{type:"purple"},e("motherChildBedShare","Mother / Child")),i().createElement("div",{className:q}))},L=e=>{let{wardPatient:t,childrenOfWardPatientInSameBed:a}=e,{patient:n,visit:l,bed:s,inpatientAdmission:d}=t,{encounterAssigningToCurrentInpatientLocation:u}=d??{},o=i().createElement(i().Fragment,null,i().createElement(S.A,{wardPatient:t,relatedTransferPatients:a},i().createElement(b,{wardPatient:t}),i().createElement("div",{className:f.A.wardPatientCardHeaderBadge},i().createElement(r.ExtensionSlot,{name:"maternal-ward-patient-card-header-slot",state:{visit:l}})),i().createElement("div",{className:h()(f.A.wardPatientCardRow,f.A.dotSeparatedChildren)},i().createElement(D.A,{encounterAssigningToCurrentInpatientLocation:u}),i().createElement(x.A,{id:"gravida",patient:n,visit:l})),i().createElement(F.A,{wardPatient:t}),i().createElement(B.A,{id:"pending-items",wardPatient:t}),i().createElement(_,{id:"pregnancy-complications",...t}),i().createElement(R,e)),a?.map(e=>{let n=[t,...a.filter(t=>t.patient.uuid!==e.patient.uuid)];return i().createElement(i().Fragment,{key:e.patient.uuid},i().createElement(I,null),i().createElement(S.A,{wardPatient:e,relatedTransferPatients:n},i().createElement(b,{wardPatient:e}),i().createElement("div",{className:f.A.wardPatientCardHeaderBadge},i().createElement(r.ExtensionSlot,{name:"maternal-ward-patient-card-header-slot",state:{visit:e.visit}})),i().createElement(B.A,{id:"pending-items",wardPatient:e})))}));return s?o:i().createElement("div",{className:f.A.unassignedPatient},i().createElement("div",{key:"unassigned-bed-pt-"+t.patient.uuid},o))},H=e=>{let{motherByChildUuid:t,isLoading:a}=e??{},{wardPatientGroupDetails:n}=(0,r.useAppContext)("ward-view-context")??{},{bedLayouts:l,wardAdmittedPatientsWithBed:s,inpatientAdmissionsByPatientUuid:d}=n??{},u=l?.map(e=>{let{patients:n}=e,r=(0,m.yZ)(e),l=new Map,u=n.map(e=>{let t=s?.get(e.uuid);if(t){let{patient:e,visit:a,currentInpatientRequest:n}=t;return{patient:e,visit:a,bed:r,inpatientAdmission:t,inpatientRequest:n||null}}{let t=d.get(e.uuid);return{patient:e,visit:t?.visit,bed:r,inpatientAdmission:t,inpatientRequest:null}}}).filter(e=>{let a=e.patient.uuid,{patient:i}=t?.get(a)??{},r=n.some(e=>e.uuid===i?.uuid);return r&&(l.has(i.uuid)||l.set(i.uuid,[]),l.get(i.uuid).push(e)),!r}).map(e=>i().createElement(L,{key:e.patient.uuid,wardPatient:e,childrenOfWardPatientInSameBed:l.get(e.patient.uuid)}));return i().createElement(c.A,{key:r.uuid,bed:r,patientCards:u,isLoadingDivider:a})});return i().createElement(i().Fragment,null,u)};function V(e){return{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:null,inpatientRequest:e}}var U=a(201),G=a(3863),W=a(103),$=a(6377);let Z=({wardPatient:e,children:t,inpatientRequestsOfWardByPatientUuid:a})=>{let{motherChildRelationships:l}=(0,r.useAppContext)("maternal-ward-view-context")??{},[s,u]=(0,n.useState)([]),{t:o}=(0,d.useTranslation)(),{childrenByMotherUuid:c,motherByChildUuid:m}=l??{},p=(0,n.useMemo)(()=>m?.get(e.patient.uuid)??null,[m,e.patient.uuid]),h=(0,n.useMemo)(()=>c?.get(e.patient.uuid)??[],[c,e.patient.uuid]),A=(0,n.useMemo)(()=>{if(!p)return null;let e=a[p.patient.uuid];return e?V(e):null},[p,a]),g=(0,n.useMemo)(()=>{let e=[];for(let t of h??[]){let n=a[t.patient.uuid];n&&e.push(V(n))}return e},[h,a]),v=(0,n.useMemo)(()=>[...A?[A]:[],...g].filter(e=>s.includes(e.patient.uuid)),[A,g,s]);return i().createElement("div",{className:$.A.admissionRequestCard},i().createElement(G.A,{wardPatient:e}),i().createElement("div",{className:$.A.admissionRequestCardHeaderBadge},i().createElement(r.ExtensionSlot,{name:"maternal-ward-patient-card-header-slot",state:{visit:e.visit}})),i().createElement(_,{id:"pregnancy-complications",...e}),p&&i().createElement(O,{otherPatient:p.patient,otherPatientAdmission:p.currentAdmission,isOtherPatientTheMother:!0},A&&i().createElement("div",null,i().createElement(E.CheckboxGroup,{legendText:""},i().createElement(E.Checkbox,{checked:s.includes(p.patient.uuid),className:$.A.checkbox,id:p.patient.uuid,key:"also-transfer-"+p.patient.uuid,labelText:"ADMIT"===A.inpatientRequest.dispositionType?o("alsoAdmitOrCancel","Also admit / cancel:"):o("alsoTransferOrCancel","Also transfer / cancel:"),onChange:(e,{checked:t,id:a})=>{u(t?[...s,a]:s.filter(e=>e!==a))}})))),h?.map(e=>i().createElement(O,{key:e.patient.uuid,otherPatient:e.patient,otherPatientAdmission:e.currentAdmission,isOtherPatientTheMother:!1},g.some(t=>t.patient.uuid===e.patient.uuid)&&i().createElement("div",null,i().createElement(E.CheckboxGroup,{legendText:""},i().createElement(E.Checkbox,{checked:s.includes(e.patient.uuid),className:$.A.checkbox,id:e.patient.uuid,key:"also-transfer-"+e.patient.uuid,labelText:g.find(t=>t.patient.uuid===e.patient.uuid)?.inpatientRequest.dispositionType==="ADMIT"?o("alsoAdmitOrCancel","Also admit / cancel:"):o("alsoTransferOrCancel","Also transfer / cancel:"),onChange:(e,{checked:t,id:a})=>{u(t?[...s,a]:s.filter(e=>e!==a))}}))))),i().createElement(W.A,{id:"admission-request-note",wardPatient:e}),i().createElement(U.A,{wardPatient:e,relatedTransferPatients:v}))},z=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{t}=(0,d.useTranslation)(),{inpatientRequestResponse:a}=e??{},{inpatientRequests:n,isLoading:l,error:s}=a??{},u=n?.reduce((e,t)=>(e[t.patient.uuid]=t,e),{});return l?i().createElement(v.A,null):s?i().createElement(r.ErrorState,{headerTitle:t("admissionRequests","Admission requests"),error:s}):i().createElement(i().Fragment,null,n?.map((e,t)=>{let a={patient:e.patient,visit:e.visit,bed:null,inpatientRequest:e,inpatientAdmission:null};return i().createElement(Z,{key:`admission-request-card-${t}`,wardPatient:a,inpatientRequestsOfWardByPatientUuid:u})}))},J=function(){let{wardPatientGroupDetails:e}=(0,r.useAppContext)("ward-view-context")??{},{wardUnassignedPatientsList:t}=e??{},a=t?.map(e=>i().createElement(L,{wardPatient:{patient:e.patient,visit:e.visit,bed:null,inpatientAdmission:e,inpatientRequest:e.currentInpatientRequest},childrenOfWardPatientInSameBed:[],key:e.patient.uuid}));return i().createElement(i().Fragment,null,a)};var Q=a(6545),j=a(929),K=a(875);let X=()=>{let e=(0,l.u)();(0,r.useDefineAppContext)("ward-view-context",{wardPatientGroupDetails:e,WardPatientHeader:b});let{allWardPatientUuids:t,isLoading:a}=e,c=function(e,t){let{t:a}=(0,d.useTranslation)(),{data:i,isLoading:l,error:s}=u({mothers:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!1},t&&e.length>0,o),{data:c,isLoading:m,error:p}=u({children:e,requireMotherHasActiveVisit:!0,requireChildHasActiveVisit:!0,requireChildBornDuringMothersActiveVisit:!1},t&&e.length>0,o);return s&&(0,r.showNotification)({title:a("errorLoadingChildren","Error loading children info"),kind:"error",critical:!0,description:s?.message}),p&&(0,r.showNotification)({title:a("errorLoadingMother","Error loading mother info"),kind:"error",critical:!0,description:p?.message}),(0,n.useMemo)(()=>{let e=new Map,t=new Map,a=l||m;for(let{child:a,childAdmission:n,mother:i,motherAdmission:r}of c??[])e.set(a.uuid,{patient:i,currentAdmission:r}),t.has(i.uuid)||t.set(i.uuid,[]),t.get(i.uuid).push({patient:a,currentAdmission:n});for(let{child:a,childAdmission:n,mother:r,motherAdmission:l}of i??[]){e.set(a.uuid,{patient:r,currentAdmission:l}),t.has(r.uuid)||t.set(r.uuid,[]);let i=t.get(r.uuid);i.some(({patient:e})=>e.uuid===a.uuid)||i.push({patient:a,currentAdmission:n})}return{motherByChildUuid:e,childrenByMotherUuid:t,isLoading:a}},[i,c,l,m])}(Array.from(t),!a);(0,r.useDefineAppContext)("maternal-ward-view-context",{motherChildRelationships:c});let m=i().createElement(H,c),p=i().createElement(K.A,{metrics:[s.d.PATIENTS,s.d.FEMALES_OF_REPRODUCTIVE_AGE,s.d.NEWBORNS,s.d.FREE_BEDS,s.d.TOTAL_BEDS,s.d.PENDING_OUT]}),h=i().createElement(J,null),E=i().createElement(z,null);return i().createElement(i().Fragment,null,i().createElement(j.A,{wardPendingPatients:E,wardMetrics:p}),i().createElement(Q.A,{wardBeds:m,wardUnassignedPatients:h}))}}}]);
|