@openmrs/esm-patient-notes-app 12.3.5-pre.12431 → 12.3.5-pre.12438
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/5117.js +1 -1
- package/dist/5117.js.map +1 -1
- package/dist/7078.js +1 -1
- package/dist/7078.js.map +1 -1
- package/dist/openmrs-esm-patient-notes-app.js +2 -2
- package/dist/openmrs-esm-patient-notes-app.js.buildmanifest.json +7 -7
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/notes/visit-notes-form.component.tsx +34 -7
- package/src/notes/visit-notes-form.test.tsx +122 -1
- package/translations/en.json +2 -0
package/.turbo/turbo-build.log
CHANGED
package/dist/5117.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_patient_notes_app=globalThis.webpackChunk_openmrs_esm_patient_notes_app||[]).push([["5117"],{4300(e){e.exports=JSON.parse('{"add":"Add","addImage":"Add image","addVisitNote":"Add visit note","clinicalNoteLabel":"Write your notes","clinicalNotePlaceholder":"Write any notes here","confirmDeleteStickyNote":"Confirm delete sticky note","confirmDeleteStickyNoteMessage":"Are you sure you want to delete this sticky note?","date":"Date","deleteStickyNote":"Delete sticky note","deleting":"Deleting","diagnoses":"Diagnoses","diagnosisSearchResults":"Diagnosis search results","discard":"Discard","editStickyNote":"Edit sticky note","editVisitNote":"Edit visit note","emptyDiagnosisText":"No diagnosis selected — Enter a diagnosis below","enterNotePlaceholder":"Enter your sticky note here...","enterPrimaryDiagnoses":"Enter Primary diagnoses","enterSecondaryDiagnoses":"Enter Secondary diagnoses","error":"Error","errorDeletingStickyNote":"Error deleting sticky note","errorDeletingStickyNoteMessage":"An error occurred while deleting the sticky note","errorFetchingConcepts":"There was a problem fetching concepts","errorLoadingStickyNote":"Couldn\'t load sticky note.","errorSavingStickyNote":"Error saving sticky note","errorTransformingDiagnoses":"Error transforming diagnoses","image":"Image","imageMarkedForRemoval":"Marked for removal","imageRemovalSaveHint":"Images marked for removal will be deleted when you save.","imageRemoved":"Image removed","imageUploadHelperText":"Upload an image or use this device\'s camera to capture an image","loadingSavedImages":"Loading saved images","noMatchingDiagnoses":"No diagnoses found matching","note":"Note","noVisitNoteToDisplay":"No visit note to display","primaryDiagnosis":"Primary diagnosis","primaryDiagnosisInputPlaceholder":"Choose a primary diagnosis","primaryDiagnosisRequired":"Choose at least one primary diagnosis","reAddImagesFromNote_one":"Open the note to add it again.","reAddImagesFromNote_other":"Open the note to add them again.","removeImage":"Remove image: {{name}}","retry":"Retry","saveAndClose":"Save and close","savedImage":"Saved image","savedImagesLoadError":"Couldn\'t load the images saved on this note","savedImagesLoadErrorHint":"Check the Attachments page before adding them again.","saving":"Saving","searchForPrimaryDiagnosis":"Search for a primary diagnosis","searchForSecondaryDiagnosis":"Search for a secondary diagnosis","secondaryDiagnosis":"Secondary diagnosis","secondaryDiagnosisInputPlaceholder":"Choose a secondary diagnosis","seeAll":"See all","stickyNote":"Sticky note","stickyNoteCreated":"Sticky note created","stickyNoteDeleted":"Sticky note deleted","stickyNoteDeletedSuccessfully":"The sticky note was deleted successfully","stickyNoteUpdated":"Sticky note updated","undo":"Undo","undoRemoveImage":"Undo removal: {{name}}","visitDate":"Visit date","visitNote":"Visit note","visitNoteNowVisible":"It is now visible on the Encounters page","visitNotePartialSaveError":"Could not save all changes. Some changes may already be saved. Try saving again.","visitNotes":"Visit notes","visitNoteSaved":"Visit note saved","visitNoteSavedImagesFailed_one":"Visit note saved, but {{count}} image was not uploaded","visitNoteSavedImagesFailed_other":"Visit note saved, but {{count}} images were not uploaded","visitNoteSaveError":"Error saving visit note"}')}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_patient_notes_app=globalThis.webpackChunk_openmrs_esm_patient_notes_app||[]).push([["5117"],{4300(e){e.exports=JSON.parse('{"add":"Add","addImage":"Add image","addVisitNote":"Add visit note","allowedFileExtensionsLoadError":"Couldn\'t load the allowed image formats","allowedFileExtensionsLoadErrorHint":"Reload the page to add images to this note.","clinicalNoteLabel":"Write your notes","clinicalNotePlaceholder":"Write any notes here","confirmDeleteStickyNote":"Confirm delete sticky note","confirmDeleteStickyNoteMessage":"Are you sure you want to delete this sticky note?","date":"Date","deleteStickyNote":"Delete sticky note","deleting":"Deleting","diagnoses":"Diagnoses","diagnosisSearchResults":"Diagnosis search results","discard":"Discard","editStickyNote":"Edit sticky note","editVisitNote":"Edit visit note","emptyDiagnosisText":"No diagnosis selected — Enter a diagnosis below","enterNotePlaceholder":"Enter your sticky note here...","enterPrimaryDiagnoses":"Enter Primary diagnoses","enterSecondaryDiagnoses":"Enter Secondary diagnoses","error":"Error","errorDeletingStickyNote":"Error deleting sticky note","errorDeletingStickyNoteMessage":"An error occurred while deleting the sticky note","errorFetchingConcepts":"There was a problem fetching concepts","errorLoadingStickyNote":"Couldn\'t load sticky note.","errorSavingStickyNote":"Error saving sticky note","errorTransformingDiagnoses":"Error transforming diagnoses","image":"Image","imageMarkedForRemoval":"Marked for removal","imageRemovalSaveHint":"Images marked for removal will be deleted when you save.","imageRemoved":"Image removed","imageUploadHelperText":"Upload an image or use this device\'s camera to capture an image","loadingSavedImages":"Loading saved images","noMatchingDiagnoses":"No diagnoses found matching","note":"Note","noVisitNoteToDisplay":"No visit note to display","primaryDiagnosis":"Primary diagnosis","primaryDiagnosisInputPlaceholder":"Choose a primary diagnosis","primaryDiagnosisRequired":"Choose at least one primary diagnosis","reAddImagesFromNote_one":"Open the note to add it again.","reAddImagesFromNote_other":"Open the note to add them again.","removeImage":"Remove image: {{name}}","retry":"Retry","saveAndClose":"Save and close","savedImage":"Saved image","savedImagesLoadError":"Couldn\'t load the images saved on this note","savedImagesLoadErrorHint":"Check the Attachments page before adding them again.","saving":"Saving","searchForPrimaryDiagnosis":"Search for a primary diagnosis","searchForSecondaryDiagnosis":"Search for a secondary diagnosis","secondaryDiagnosis":"Secondary diagnosis","secondaryDiagnosisInputPlaceholder":"Choose a secondary diagnosis","seeAll":"See all","stickyNote":"Sticky note","stickyNoteCreated":"Sticky note created","stickyNoteDeleted":"Sticky note deleted","stickyNoteDeletedSuccessfully":"The sticky note was deleted successfully","stickyNoteUpdated":"Sticky note updated","undo":"Undo","undoRemoveImage":"Undo removal: {{name}}","visitDate":"Visit date","visitNote":"Visit note","visitNoteNowVisible":"It is now visible on the Encounters page","visitNotePartialSaveError":"Could not save all changes. Some changes may already be saved. Try saving again.","visitNotes":"Visit notes","visitNoteSaved":"Visit note saved","visitNoteSavedImagesFailed_one":"Visit note saved, but {{count}} image was not uploaded","visitNoteSavedImagesFailed_other":"Visit note saved, but {{count}} images were not uploaded","visitNoteSaveError":"Error saving visit note"}')}}]);
|
package/dist/5117.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"5117.js","sources":["webpack://@openmrs/esm-patient-notes-app/json|/home/runner/work/openmrs-esm-patient-chart/openmrs-esm-patient-chart/packages/esm-patient-notes-app/translations/en.json"],"names":["JSON"],"mappings":"uJAAA,EAAO,OAAO,CAAGA,KAAK,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"5117.js","sources":["webpack://@openmrs/esm-patient-notes-app/json|/home/runner/work/openmrs-esm-patient-chart/openmrs-esm-patient-chart/packages/esm-patient-notes-app/translations/en.json"],"names":["JSON"],"mappings":"uJAAA,EAAO,OAAO,CAAGA,KAAK,KAAK,CAAC,kzG"}
|
package/dist/7078.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_patient_notes_app=globalThis.webpackChunk_openmrs_esm_patient_notes_app||[]).push([["7078"],{3298(e,t,a){a.d(t,{A:()=>F});var s=a(5399),n=a.n(s),i=a(3373),o=a.n(i),r=a(222),l=a.n(r),m=a(3892),c=a(7807),d=a(1619),u=a(6195),g=a(4049),_=a(824),p=a(324),h=a(5848),v=a(529),f=a(4632),E=a(2293),y=a(3040),N=a(1273);let S="-esm-patient-notes__visit-notes-form__columnLabel___EwgDF",b="-esm-patient-notes__visit-notes-form__imgThumbnailContainer___6-ih6",D="-esm-patient-notes__visit-notes-form__imgThumbnail___PGisE",k="-esm-patient-notes__visit-notes-form__savedImagesLoading___06xRV",C="-esm-patient-notes__visit-notes-form__imgThumbnailItem___XkrUE",w="-esm-patient-notes__visit-notes-form__removeButton___O7iSI",I="-esm-patient-notes__visit-notes-form__button___tic-m",T="-esm-patient-notes__visit-notes-form__row___+Ncuq",R="-esm-patient-notes__visit-notes-form__errorNotification___K-xrU",x="-esm-patient-notes__visit-notes-form__tag___00erk";function A({name:e,control:t,labelText:a,placeholder:i,handleSearch:o,error:r,setIsSearching:l}){let m="tablet"===(0,E.useLayoutType)(),c=(0,s.useRef)(null);return(0,s.useEffect)(()=>{r&&c.current.focus()},[r]),n().createElement(_.xI,{name:e,control:t,render:({field:{value:t,onChange:s,onBlur:d},fieldState:u})=>n().createElement(n().Fragment,null,n().createElement(E.ResponsiveWrapper,null,n().createElement(p.Search,{ref:c,size:m?"lg":"md",id:e,labelText:a,className:r&&"-esm-patient-notes__visit-notes-form__diagnoserrorOutline___Qwd-n",placeholder:i,renderIcon:r&&(e=>n().createElement(f.BF,{fill:"red",...e})),onChange:t=>{l(!0),s(t),o(e)},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){let a=document.getElementById(`${e}-results`)?.querySelectorAll("button");a?.length&&(t.preventDefault(),a["ArrowDown"===t.key?0:a.length-1].focus())}},value:t instanceof Date?t.toISOString():t,onBlur:d})),u?.error?.message&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__errorMessage___p-5JH"},u?.error?.message))})}function B({fieldName:e,isDiagnosisNotSelected:t,isLoading:a,isSearching:i,onAddDiagnosis:o,searchResults:r,t:l,value:m}){let c=(0,s.useRef)(null),d=(0,s.useCallback)(t=>{!t&&c.current?.contains(document.activeElement)&&document.getElementById(e)?.focus(),c.current=t},[e]);return m?i||a?n().createElement(P,null):!i&&r?.length>0?n().createElement("ul",{ref:d,id:`${e}-results`,className:"-esm-patient-notes__visit-notes-form__diagnosisList___KvUlY","aria-label":l("diagnosisSearchResults","Diagnosis search results"),onKeyDown:t=>{if("Escape"===t.key)t.preventDefault(),document.getElementById(e)?.focus();else if(["ArrowDown","ArrowUp","Home","End"].includes(t.key)){let e=Array.from(t.currentTarget.querySelectorAll("button")),a=e.findIndex(e=>e===document.activeElement);if(a<0)return;t.preventDefault();let s="Home"===t.key?0:"End"===t.key?e.length-1:(a+("ArrowDown"===t.key?1:-1)+e.length)%e.length;e[s].focus()}}},r.filter(t).map(t=>n().createElement("li",{className:"-esm-patient-notes__visit-notes-form__diagnosis___XsPGM",key:t.uuid},n().createElement("button",{type:"button",className:"-esm-patient-notes__visit-notes-form__diagnosisButton___gSR4E",onClick:()=>{o(t,e),document.getElementById(e)?.focus()}},t.display)))):r?.length===0?n().createElement(E.ResponsiveWrapper,null,n().createElement(p.Tile,{className:"-esm-patient-notes__visit-notes-form__emptyResults___fCV44"},n().createElement("span",null,l("noMatchingDiagnoses","No diagnoses found matching")," ",n().createElement("strong",null,'"',m,'"')))):void 0:null}function P(){return n().createElement(n().Fragment,null,Array.from({length:5}).map((e,t)=>n().createElement(p.SkeletonText,{key:t,className:"-esm-patient-notes__visit-notes-form__skeleton___Wp-mM"})))}let F=({encounter:e,formContext:t,patientUuid:a,patient:i,visitContext:r,closeWorkspace:f})=>{let P=!!("editing"===t&&e?.id),{t:F}=(0,c.useTranslation)(),L="tablet"===(0,E.useLayoutType)(),V=(0,E.useSession)(),{isPrimaryDiagnosisRequired:z,...H}=(0,E.useConfig)(),M=(0,s.useMemo)(()=>({patientUuid:a}),[a]),W=(0,s.useMemo)(()=>({patientUuid:a,patient:i}),[a,i]),{clinicianEncounterRole:U,encounterNoteTextConceptUuid:O,encounterTypeUuid:G,formConceptUuid:j}=H.visitNoteConfig,[X,q]=(0,s.useState)(!1),[K,$]=(0,s.useState)(!1),[J,Z]=(0,s.useState)(!1),[Q,Y]=(0,s.useState)([]),[ee,et]=(0,s.useState)([]),[ea,es]=(0,s.useState)(null),[en,ei]=(0,s.useState)(null),[eo,er]=(0,s.useState)([]),[el,em]=(0,s.useState)(),[ec,ed]=(0,s.useState)([]),[eu,eg]=(0,s.useState)(),[e_,ep]=(0,s.useState)(null),{allowedFileExtensions:eh}=(0,y.useAllowedFileExtensions)(),ev=(0,E.useFeatureFlag)("rde"),ef=(0,s.useMemo)(()=>u.z.object({noteDate:ev?u.z.date():u.z.date().optional(),primaryDiagnosisSearch:u.z.string(),secondaryDiagnosisSearch:u.z.string().optional(),clinicalNote:u.z.string().optional(),images:u.z.array(u.z.any()).optional(),removedImageIds:u.z.array(u.z.string())}),[F,ev]),eE=(0,s.useCallback)(async(e,t,a)=>{let s=await (0,g.u)(ef)(e,t,a);return z&&0===Q.length?{...s,errors:{...s.errors,primaryDiagnosisSearch:{type:"custom",message:F("primaryDiagnosisRequired","Choose at least one primary diagnosis")}}}:s},[ef,z,Q,F]),{clearErrors:ey,control:eN,formState:{errors:eS,dirtyFields:eb,isSubmitting:eD},handleSubmit:ek,getValues:eC,setValue:ew,watch:eI}=(0,_.mN)({mode:"onSubmit",resolver:eE,defaultValues:{images:[],removedImageIds:[],primaryDiagnosisSearch:"",noteDate:P?new Date(e.rawDatetime):new Date,clinicalNote:P?String(e?.obs?.find(e=>e.concept.uuid===O)?.value||""):""}});(0,s.useEffect)(()=>{if(e?.diagnoses?.length)try{let t=e.diagnoses.map(e=>({patient:a,diagnosis:{coded:e.diagnosis.coded?.uuid},certainty:e.certainty,rank:e.rank,display:e.display})),s=t.filter(e=>1===e.rank),n=t.filter(e=>2===e.rank);Y(s),et(n),er([...s,...n])}catch(e){ep(Error(F("errorTransformingDiagnoses","Error transforming diagnoses"))),(0,E.createErrorHandler)()}},[e,a,F]);let eT=eI("images"),eR=eI("removedImageIds"),{images:ex,isLoading:eA,error:eB}=(0,N.Vm)(a,P?e.id:void 0),{mutateVisitNotes:eP}=(0,N.aw)(a),{mutate:eF}=(0,d.useSWRConfig)(),eL=(0,s.useCallback)(()=>eF(e=>"string"==typeof e&&e.startsWith(`${E.restBaseUrl}/attachment`)),[eF]),eV=V?.sessionLocation?.uuid,ez=V?.currentProvider?.uuid,eH=(0,s.useMemo)(()=>(0,m.A)((e,t)=>{ey("primaryDiagnosisSearch"),e&&("primaryDiagnosisSearch"===t?q(!0):"secondaryDiagnosisSearch"===t&&$(!0),(0,N.ph)(e,H.diagnosisConceptClass).then(e=>{"primaryDiagnosisSearch"===t?(es(e),q(!1)):"secondaryDiagnosisSearch"===t&&(ei(e),$(!1))}).catch(e=>{ep(e),(0,E.createErrorHandler)()}))},500),[H.diagnosisConceptClass,ey]),eM=(0,s.useCallback)(e=>{let t=eI(e);t&&eH(t,e),Z(!1)},[eH,eI]),eW=(0,s.useCallback)(e=>({certainty:"PROVISIONAL",display:e.display,diagnosis:{coded:e.uuid},patient:a,rank:2}),[a]),eU=(0,s.useCallback)((e,t)=>{let a=eW(e);"primaryDiagnosisSearch"===t?(a.rank=1,ew("primaryDiagnosisSearch",""),es([]),Y(e=>[...e,a]),ey("primaryDiagnosisSearch")):"secondaryDiagnosisSearch"===t&&(ew("secondaryDiagnosisSearch",""),ei([]),et(e=>[...e,a])),er(e=>[...e,a])},[eW,ew,ey]),eO=(0,s.useCallback)((e,t)=>{"primaryInputSearch"===t?Y(Q.filter(t=>t.diagnosis.coded!==e.diagnosis.coded)):"secondaryInputSearch"===t&&et(ee.filter(t=>t.diagnosis.coded!==e.diagnosis.coded)),er(eo.filter(t=>t.diagnosis.coded!==e.diagnosis.coded))},[eo,Q,ee]),eG=e=>{let t=Q.some(t=>e.uuid===t.diagnosis.coded),a=ee.some(t=>e.uuid===t.diagnosis.coded);return!t&&!a},ej=(0,s.useCallback)(()=>{let e=(0,E.showModal)("capture-photo-modal",{saveFile:t=>(t.capturedFromWebcam&&!t.fileName.includes(".")&&(t.fileName=`${t.fileName}.png`),ew("images",[...eC("images"),t],{shouldDirty:!0}),e(),Promise.resolve()),closeModal:()=>{e()},allowedExtensions:eh&&Array.isArray(eh)?eh.filter(e=>!/pdf/i.test(e)):[],collectDescription:!0,multipleFiles:!0})},[eh,eC,ew]),eX=(0,s.useCallback)(t=>{let{noteDate:s,clinicalNote:n,images:i,removedImageIds:o}=t;if(eg(void 0),z&&!Q.length)return;let m=l()(s),c=new Date;30>=m.diff(c,"minute")&&(m=null);let d=e?.obs?.find(e=>e.concept.uuid===O),u={encounterDatetime:m?.format(),form:j,patient:a,location:eV,encounterProviders:[{encounterRole:U,provider:ez}],encounterType:G,obs:n?[{concept:{uuid:O,display:""},value:n,...d&&{uuid:d.uuid}}]:[],...!P&&r?.uuid&&{visit:r.uuid}},g=new AbortController;return Promise.resolve().then(async()=>{let t=!1,s=!1;try{for(let e of o)await (0,N.XH)(e),t=!0,ed(t=>[...t,e]),ew("removedImageIds",eC("removedImageIds").filter(t=>t!==e),{shouldDirty:!0});let n=eo.length!==(e?.diagnoses?.length??0)||eo.some(t=>!e?.diagnoses?.some(e=>e.diagnosis.coded?.uuid===t.diagnosis.coded&&e.rank===t.rank&&e.certainty===t.certainty));if(!P||n||Object.keys(eb).some(e=>"removedImageIds"!==e))return s=!0,await (P?(0,N.HE)(g,e.id,u):(0,N.v_)(g,u)).then(t=>{if(201===t.status||200===t.status){let a=e?.id||t.data.uuid;return P&&e?.diagnoses?.length?Promise.all(e.diagnoses.map(e=>(0,N.k7)(g,e.uuid))).then(()=>a):a}}).then(e=>Promise.all(eo.map(t=>{let s={encounter:e,patient:a,condition:null,diagnosis:{coded:t.diagnosis.coded},certainty:t.certainty,rank:t.rank};return(0,N.mN)(g,s)})).then(()=>e)).then(e=>i?.length?Promise.allSettled(i.map(t=>{let s={base64Content:t.base64Content,file:t.file,fileName:t.fileName,fileType:t.fileType,fileDescription:t.fileDescription||""};return(0,E.createAttachment)(a,s,e)})).then(e=>e.flatMap((e,t)=>"rejected"===e.status?[{image:i[t],reason:e.reason}]:[])):[])}finally{(t||s)&&((0,y.invalidateVisitAndEncounterData)(eF,a),eP(),(t||s&&i?.length)&&eL())}}).then((e=[])=>{if(f({discardUnsavedChanges:!0}),e.length){let[{reason:t}]=e,a=e.map(({image:e})=>e.fileDescription?.trim()||e.fileName?.trim()).filter(Boolean).join(", ");(0,E.showSnackbar)({isLowContrast:!1,kind:"warning",title:F("visitNoteSavedImagesFailed","Visit note saved, but {{count}} image was not uploaded",{count:e.length}),subtitle:[a,t?.responseBody?.error?.message??t?.message].filter(Boolean).join(": ").concat(" ",F("reAddImagesFromNote","Open the note to add it again.",{count:e.length}))});return}(0,E.showSnackbar)({isLowContrast:!0,subtitle:F("visitNoteNowVisible","It is now visible on the Visits page"),kind:"success",title:F("visitNoteSaved","Visit note saved")})}).catch(e=>{eg(F("visitNotePartialSaveError","Could not save all changes. Some changes may already be saved. Try saving again.")),(0,E.createErrorHandler)(),(0,E.showSnackbar)({title:F("visitNoteSaveError","Error saving visit note"),kind:"error",isLowContrast:!1,subtitle:e?.responseBody?.error?.message??e.message})})},[eb,eC,ew,r?.uuid,U,f,eo,e?.diagnoses,e?.id,e?.obs,O,G,j,eF,P,z,eV,eL,eP,a,ez,Q.length,F]),eq=Object.keys(eb).length>0;return n().createElement(E.Workspace2,{title:P?F("editVisitNote","Edit visit note"):F("addVisitNote","Add visit note"),hasUnsavedChanges:eq},n().createElement(p.Form,{className:"-esm-patient-notes__visit-notes-form__form___WXW3i",onSubmit:ek(eX,e=>console.error(e))},n().createElement(E.ExtensionSlot,{name:"visit-context-header-slot",state:M}),L&&n().createElement(p.Row,{className:"-esm-patient-notes__visit-notes-form__headerGridRow___jAAax"},n().createElement(E.ExtensionSlot,{name:"visit-form-header-slot",className:"-esm-patient-notes__visit-notes-form__dataGridRow___wKV9H",state:W})),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__formContainer___INxGb"},n().createElement(p.Stack,{gap:2},L?n().createElement("h2",{className:"-esm-patient-notes__visit-notes-form__heading___ZDibC"},P?F("editVisitNote","Edit visit note"):F("addVisitNote","Add visit note")):null,ev&&n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},F("date","Date"))),n().createElement(p.Column,{sm:3},n().createElement(_.xI,{name:"noteDate",control:eN,render:({field:e,fieldState:t})=>n().createElement(E.ResponsiveWrapper,null,n().createElement(E.OpenmrsDatePicker,{...e,"data-testid":"visitDateTimePicker",id:"visitDateTimePicker",invalid:!!t?.error?.message,invalidText:t?.error?.message,isDisabled:P,labelText:F("visitDate","Visit date"),maxDate:new Date}))}))),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__diagnosesText___sNLJv"},Q.map(e=>n().createElement(p.Tag,{className:x,filter:!0,key:e.diagnosis.coded,onClose:()=>eO(e,"primaryInputSearch"),type:"red"},e.display)),ee.map(e=>n().createElement(p.Tag,{className:x,filter:!0,key:e.diagnosis.coded,onClose:()=>eO(e,"secondaryInputSearch"),type:"blue"},e.display)),!Q.length&&!ee.length&&n().createElement("span",null,F("emptyDiagnosisText","No diagnosis selected — Enter a diagnosis below"))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},F("primaryDiagnosis","Primary diagnosis"))),n().createElement(p.Column,{sm:3},n().createElement(p.FormGroup,{legendText:F("searchForPrimaryDiagnosis","Search for a primary diagnosis")},n().createElement(A,{name:"primaryDiagnosisSearch",control:eN,labelText:F("enterPrimaryDiagnoses","Enter Primary diagnoses"),placeholder:F("primaryDiagnosisInputPlaceholder","Choose a primary diagnosis"),handleSearch:eM,error:eS?.primaryDiagnosisSearch,setIsSearching:Z}),e_?n().createElement(p.InlineNotification,{className:R,lowContrast:!0,title:F("error","Error"),subtitle:F("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>ep(null)}):null,n().createElement(B,{fieldName:"primaryDiagnosisSearch",isDiagnosisNotSelected:eG,isLoading:X,isSearching:J,onAddDiagnosis:eU,searchResults:ea,t:F,value:eI("primaryDiagnosisSearch")})))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},F("secondaryDiagnosis","Secondary diagnosis"))),n().createElement(p.Column,{sm:3},n().createElement(p.FormGroup,{legendText:F("searchForSecondaryDiagnosis","Search for a secondary diagnosis")},n().createElement(A,{name:"secondaryDiagnosisSearch",control:eN,labelText:F("enterSecondaryDiagnoses","Enter Secondary diagnoses"),placeholder:F("secondaryDiagnosisInputPlaceholder","Choose a secondary diagnosis"),handleSearch:eM,setIsSearching:Z}),e_?n().createElement(p.InlineNotification,{className:R,lowContrast:!0,title:F("error","Error"),subtitle:F("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>ep(null)}):null,n().createElement(B,{fieldName:"secondaryDiagnosisSearch",isDiagnosisNotSelected:eG,isLoading:K,isSearching:J,onAddDiagnosis:eU,searchResults:en,t:F,value:eI("secondaryDiagnosisSearch")})))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},F("note","Note"))),n().createElement(p.Column,{sm:3},n().createElement(_.xI,{name:"clinicalNote",control:eN,render:({field:{onChange:e,onBlur:t,value:a}})=>n().createElement(E.ResponsiveWrapper,null,n().createElement(p.TextArea,{id:"additionalNote",rows:el,labelText:F("clinicalNoteLabel","Write your notes"),placeholder:F("clinicalNotePlaceholder","Write any notes here"),value:a,onBlur:t,onChange:t=>{e(t),em(Math.ceil(t.target.scrollHeight/24))}}))}))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},F("image","Image"))),n().createElement(p.Column,{sm:3},n().createElement(p.FormGroup,{legendText:""},n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__imgUploadHelperText___+VxXT"},F("imageUploadHelperText","Upload images or use this device's camera to capture images")),n().createElement(p.Button,{className:"-esm-patient-notes__visit-notes-form__uploadButton___bTplo",kind:L?"ghost":"tertiary",onClick:ej,renderIcon:e=>n().createElement(h.OM,{size:16,...e})},F("addImage","Add image")),eA&&n().createElement(p.InlineLoading,{className:k,description:F("loadingSavedImages","Loading saved images")+"..."}),eB&&n().createElement(p.InlineNotification,{className:k,kind:"error",lowContrast:!0,hideCloseButton:!0,title:F("savedImagesLoadError","Couldn't load the images saved on this note"),subtitle:F("savedImagesLoadErrorHint","Check the Attachments page before adding them again.")}),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__imgThumbnailGrid___Tbu9Z"},ex.filter(e=>!ec.includes(e.id)).map(e=>{let t=eR.includes(e.id),a=e.description||e.filename||F("savedImage","Saved image");return n().createElement("div",{key:e.id,className:C},n().createElement("div",{className:b},n().createElement("img",{className:o()(D,{"-esm-patient-notes__visit-notes-form__pendingImage___nyrho":t}),src:e.src,alt:a})),t&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__removalStatus___9l-fi"},F("imageMarkedForRemoval","Marked for removal")),n().createElement(p.Button,{kind:t?"ghost":"secondary",size:"sm",disabled:eD,"aria-label":t?F("undoRemoveImage","Undo removal: {{name}}",{name:a}):F("removeImage","Remove image: {{name}}",{name:a}),className:t?"-esm-patient-notes__visit-notes-form__undoButton___-74Gv":w,onClick:()=>ew("removedImageIds",t?eR.filter(t=>t!==e.id):[...eR,e.id],{shouldDirty:!0})},t?F("undo","Undo"):n().createElement(v.bm,{size:16})))}),eT?.map((e,t)=>n().createElement("div",{key:t,className:C},n().createElement("div",{className:b},n().createElement("img",{className:D,src:e.base64Content,alt:e.fileDescription??e.fileName})),n().createElement(p.Button,{kind:"secondary",size:"sm","aria-label":F("removeImage","Remove image: {{name}}",{name:e.fileDescription?.trim()||e.fileName?.trim()||t+1}),className:w,onClick:()=>{let e;(e=[...eT]).splice(t,1),ew("images",e,{shouldDirty:!0}),(0,E.showSnackbar)({title:F("imageRemoved","Image removed"),kind:"success",isLowContrast:!0})}},n().createElement(v.bm,{size:16}))))),eR.length>0&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__removalHint___a6VpP"},F("imageRemovalSaveHint","Images marked for removal will be deleted when you save."))))))),eu&&n().createElement(p.InlineNotification,{kind:"error",lowContrast:!0,hideCloseButton:!0,title:F("visitNoteSaveError","Error saving visit note"),subtitle:eu}),n().createElement(p.ButtonSet,{className:o()({"-esm-patient-notes__visit-notes-form__tablet___R5OWW":L,"-esm-patient-notes__visit-notes-form__desktop___q-E7d":!L})},n().createElement(p.Button,{className:I,kind:"secondary",onClick:()=>f()},F("discard","Discard")),n().createElement(p.Button,{className:I,kind:"primary",disabled:!eq||eD,type:"submit"},eD?n().createElement(p.InlineLoading,{className:"-esm-patient-notes__visit-notes-form__spinner___nX4VV",description:F("saving","Saving")+"..."}):n().createElement("span",null,F("saveAndClose","Save and close"))))))}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_patient_notes_app=globalThis.webpackChunk_openmrs_esm_patient_notes_app||[]).push([["7078"],{3298(e,t,a){a.d(t,{A:()=>P});var s=a(5399),n=a.n(s),i=a(3373),o=a.n(i),r=a(222),l=a.n(r),m=a(3892),c=a(7807),d=a(1619),u=a(6195),g=a(4049),_=a(824),p=a(324),h=a(5848),f=a(529),v=a(4632),E=a(2293),y=a(3040),N=a(1273);let S="-esm-patient-notes__visit-notes-form__columnLabel___EwgDF",b="-esm-patient-notes__visit-notes-form__imgThumbnailContainer___6-ih6",D="-esm-patient-notes__visit-notes-form__imgThumbnail___PGisE",k="-esm-patient-notes__visit-notes-form__savedImagesLoading___06xRV",C="-esm-patient-notes__visit-notes-form__imgThumbnailItem___XkrUE",w="-esm-patient-notes__visit-notes-form__removeButton___O7iSI",I="-esm-patient-notes__visit-notes-form__button___tic-m",T="-esm-patient-notes__visit-notes-form__row___+Ncuq",x="-esm-patient-notes__visit-notes-form__errorNotification___K-xrU",R="-esm-patient-notes__visit-notes-form__tag___00erk",A=new Set(["jpg","jpeg","png","gif","webp","bmp"]);function B({name:e,control:t,labelText:a,placeholder:i,handleSearch:o,error:r,setIsSearching:l}){let m="tablet"===(0,E.useLayoutType)(),c=(0,s.useRef)(null);return(0,s.useEffect)(()=>{r&&c.current.focus()},[r]),n().createElement(_.xI,{name:e,control:t,render:({field:{value:t,onChange:s,onBlur:d},fieldState:u})=>n().createElement(n().Fragment,null,n().createElement(E.ResponsiveWrapper,null,n().createElement(p.Search,{ref:c,size:m?"lg":"md",id:e,labelText:a,className:r&&"-esm-patient-notes__visit-notes-form__diagnoserrorOutline___Qwd-n",placeholder:i,renderIcon:r&&(e=>n().createElement(v.BF,{fill:"red",...e})),onChange:t=>{l(!0),s(t),o(e)},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){let a=document.getElementById(`${e}-results`)?.querySelectorAll("button");a?.length&&(t.preventDefault(),a["ArrowDown"===t.key?0:a.length-1].focus())}},value:t instanceof Date?t.toISOString():t,onBlur:d})),u?.error?.message&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__errorMessage___p-5JH"},u?.error?.message))})}function L({fieldName:e,isDiagnosisNotSelected:t,isLoading:a,isSearching:i,onAddDiagnosis:o,searchResults:r,t:l,value:m}){let c=(0,s.useRef)(null),d=(0,s.useCallback)(t=>{!t&&c.current?.contains(document.activeElement)&&document.getElementById(e)?.focus(),c.current=t},[e]);return m?i||a?n().createElement(F,null):!i&&r?.length>0?n().createElement("ul",{ref:d,id:`${e}-results`,className:"-esm-patient-notes__visit-notes-form__diagnosisList___KvUlY","aria-label":l("diagnosisSearchResults","Diagnosis search results"),onKeyDown:t=>{if("Escape"===t.key)t.preventDefault(),document.getElementById(e)?.focus();else if(["ArrowDown","ArrowUp","Home","End"].includes(t.key)){let e=Array.from(t.currentTarget.querySelectorAll("button")),a=e.findIndex(e=>e===document.activeElement);if(a<0)return;t.preventDefault();let s="Home"===t.key?0:"End"===t.key?e.length-1:(a+("ArrowDown"===t.key?1:-1)+e.length)%e.length;e[s].focus()}}},r.filter(t).map(t=>n().createElement("li",{className:"-esm-patient-notes__visit-notes-form__diagnosis___XsPGM",key:t.uuid},n().createElement("button",{type:"button",className:"-esm-patient-notes__visit-notes-form__diagnosisButton___gSR4E",onClick:()=>{o(t,e),document.getElementById(e)?.focus()}},t.display)))):r?.length===0?n().createElement(E.ResponsiveWrapper,null,n().createElement(p.Tile,{className:"-esm-patient-notes__visit-notes-form__emptyResults___fCV44"},n().createElement("span",null,l("noMatchingDiagnoses","No diagnoses found matching")," ",n().createElement("strong",null,'"',m,'"')))):void 0:null}function F(){return n().createElement(n().Fragment,null,Array.from({length:5}).map((e,t)=>n().createElement(p.SkeletonText,{key:t,className:"-esm-patient-notes__visit-notes-form__skeleton___Wp-mM"})))}let P=({encounter:e,formContext:t,patientUuid:a,patient:i,visitContext:r,closeWorkspace:v})=>{let F=!!("editing"===t&&e?.id),{t:P}=(0,c.useTranslation)(),V="tablet"===(0,E.useLayoutType)(),z=(0,E.useSession)(),{isPrimaryDiagnosisRequired:H,...M}=(0,E.useConfig)(),W=(0,s.useMemo)(()=>({patientUuid:a}),[a]),U=(0,s.useMemo)(()=>({patientUuid:a,patient:i}),[a,i]),{clinicianEncounterRole:O,encounterNoteTextConceptUuid:G,encounterTypeUuid:j,formConceptUuid:X}=M.visitNoteConfig,[q,K]=(0,s.useState)(!1),[$,J]=(0,s.useState)(!1),[Z,Q]=(0,s.useState)(!1),[Y,ee]=(0,s.useState)([]),[et,ea]=(0,s.useState)([]),[es,en]=(0,s.useState)(null),[ei,eo]=(0,s.useState)(null),[er,el]=(0,s.useState)([]),[em,ec]=(0,s.useState)(),[ed,eu]=(0,s.useState)([]),[eg,e_]=(0,s.useState)(),[ep,eh]=(0,s.useState)(null),{allowedFileExtensions:ef,error:ev,isLoading:eE}=(0,y.useAllowedFileExtensions)(),ey=(0,s.useMemo)(()=>{let e=ef?.map(e=>e.trim().toLowerCase()).filter(Boolean);return e?.length?e.filter(e=>A.has(e)):[...A]},[ef]),eN=eE||!!ev||0===ey.length,eS=(0,E.useFeatureFlag)("rde"),eb=(0,s.useMemo)(()=>u.z.object({noteDate:eS?u.z.date():u.z.date().optional(),primaryDiagnosisSearch:u.z.string(),secondaryDiagnosisSearch:u.z.string().optional(),clinicalNote:u.z.string().optional(),images:u.z.array(u.z.any()).optional(),removedImageIds:u.z.array(u.z.string())}),[P,eS]),eD=(0,s.useCallback)(async(e,t,a)=>{let s=await (0,g.u)(eb)(e,t,a);return H&&0===Y.length?{...s,errors:{...s.errors,primaryDiagnosisSearch:{type:"custom",message:P("primaryDiagnosisRequired","Choose at least one primary diagnosis")}}}:s},[eb,H,Y,P]),{clearErrors:ek,control:eC,formState:{errors:ew,dirtyFields:eI,isSubmitting:eT},handleSubmit:ex,getValues:eR,setValue:eA,watch:eB}=(0,_.mN)({mode:"onSubmit",resolver:eD,defaultValues:{images:[],removedImageIds:[],primaryDiagnosisSearch:"",noteDate:F?new Date(e.rawDatetime):new Date,clinicalNote:F?String(e?.obs?.find(e=>e.concept.uuid===G)?.value||""):""}});(0,s.useEffect)(()=>{if(e?.diagnoses?.length)try{let t=e.diagnoses.map(e=>({patient:a,diagnosis:{coded:e.diagnosis.coded?.uuid},certainty:e.certainty,rank:e.rank,display:e.display})),s=t.filter(e=>1===e.rank),n=t.filter(e=>2===e.rank);ee(s),ea(n),el([...s,...n])}catch(e){eh(Error(P("errorTransformingDiagnoses","Error transforming diagnoses"))),(0,E.createErrorHandler)()}},[e,a,P]);let eL=eB("images"),eF=eB("removedImageIds"),{images:eP,isLoading:eV,error:ez}=(0,N.Vm)(a,F?e.id:void 0),{mutateVisitNotes:eH}=(0,N.aw)(a),{mutate:eM}=(0,d.useSWRConfig)(),eW=(0,s.useCallback)(()=>eM(e=>"string"==typeof e&&e.startsWith(`${E.restBaseUrl}/attachment`)),[eM]),eU=z?.sessionLocation?.uuid,eO=z?.currentProvider?.uuid,eG=(0,s.useMemo)(()=>(0,m.A)((e,t)=>{ek("primaryDiagnosisSearch"),e&&("primaryDiagnosisSearch"===t?K(!0):"secondaryDiagnosisSearch"===t&&J(!0),(0,N.ph)(e,M.diagnosisConceptClass).then(e=>{"primaryDiagnosisSearch"===t?(en(e),K(!1)):"secondaryDiagnosisSearch"===t&&(eo(e),J(!1))}).catch(e=>{eh(e),(0,E.createErrorHandler)()}))},500),[M.diagnosisConceptClass,ek]),ej=(0,s.useCallback)(e=>{let t=eB(e);t&&eG(t,e),Q(!1)},[eG,eB]),eX=(0,s.useCallback)(e=>({certainty:"PROVISIONAL",display:e.display,diagnosis:{coded:e.uuid},patient:a,rank:2}),[a]),eq=(0,s.useCallback)((e,t)=>{let a=eX(e);"primaryDiagnosisSearch"===t?(a.rank=1,eA("primaryDiagnosisSearch",""),en([]),ee(e=>[...e,a]),ek("primaryDiagnosisSearch")):"secondaryDiagnosisSearch"===t&&(eA("secondaryDiagnosisSearch",""),eo([]),ea(e=>[...e,a])),el(e=>[...e,a])},[eX,eA,ek]),eK=(0,s.useCallback)((e,t)=>{"primaryInputSearch"===t?ee(Y.filter(t=>t.diagnosis.coded!==e.diagnosis.coded)):"secondaryInputSearch"===t&&ea(et.filter(t=>t.diagnosis.coded!==e.diagnosis.coded)),el(er.filter(t=>t.diagnosis.coded!==e.diagnosis.coded))},[er,Y,et]),e$=e=>{let t=Y.some(t=>e.uuid===t.diagnosis.coded),a=et.some(t=>e.uuid===t.diagnosis.coded);return!t&&!a},eJ=(0,s.useCallback)(()=>{if(eN)return;let e=(0,E.showModal)("capture-photo-modal",{saveFile:t=>(t.capturedFromWebcam&&!t.fileName.includes(".")&&(t.fileName=`${t.fileName}.png`),eA("images",[...eR("images"),t],{shouldDirty:!0}),e(),Promise.resolve()),closeModal:()=>{e()},allowedExtensions:ey,collectDescription:!0,multipleFiles:!0,showUploadSnackbar:!1})},[ey,eR,eN,eA]),eZ=(0,s.useCallback)(t=>{let{noteDate:s,clinicalNote:n,images:i,removedImageIds:o}=t;if(e_(void 0),H&&!Y.length)return;let m=l()(s),c=new Date;30>=m.diff(c,"minute")&&(m=null);let d=e?.obs?.find(e=>e.concept.uuid===G),u={encounterDatetime:m?.format(),form:X,patient:a,location:eU,encounterProviders:[{encounterRole:O,provider:eO}],encounterType:j,obs:n?[{concept:{uuid:G,display:""},value:n,...d&&{uuid:d.uuid}}]:[],...!F&&r?.uuid&&{visit:r.uuid}},g=new AbortController;return Promise.resolve().then(async()=>{let t=!1,s=!1;try{for(let e of o)await (0,N.XH)(e),t=!0,eu(t=>[...t,e]),eA("removedImageIds",eR("removedImageIds").filter(t=>t!==e),{shouldDirty:!0});let n=er.length!==(e?.diagnoses?.length??0)||er.some(t=>!e?.diagnoses?.some(e=>e.diagnosis.coded?.uuid===t.diagnosis.coded&&e.rank===t.rank&&e.certainty===t.certainty));if(!F||n||Object.keys(eI).some(e=>"removedImageIds"!==e))return s=!0,await (F?(0,N.HE)(g,e.id,u):(0,N.v_)(g,u)).then(t=>{if(201===t.status||200===t.status){let a=e?.id||t.data.uuid;return F&&e?.diagnoses?.length?Promise.all(e.diagnoses.map(e=>(0,N.k7)(g,e.uuid))).then(()=>a):a}}).then(e=>Promise.all(er.map(t=>{let s={encounter:e,patient:a,condition:null,diagnosis:{coded:t.diagnosis.coded},certainty:t.certainty,rank:t.rank};return(0,N.mN)(g,s)})).then(()=>e)).then(e=>i?.length?Promise.allSettled(i.map(t=>{let s={base64Content:t.base64Content,file:t.file,fileName:t.fileName,fileType:t.fileType,fileDescription:t.fileDescription||""};return(0,E.createAttachment)(a,s,e)})).then(e=>e.flatMap((e,t)=>"rejected"===e.status?[{image:i[t],reason:e.reason}]:[])):[])}finally{(t||s)&&((0,y.invalidateVisitAndEncounterData)(eM,a),eH(),(t||s&&i?.length)&&eW())}}).then((e=[])=>{if(v({discardUnsavedChanges:!0}),e.length){let[{reason:t}]=e,a=e.map(({image:e})=>e.fileDescription?.trim()||e.fileName?.trim()).filter(Boolean).join(", ");(0,E.showSnackbar)({isLowContrast:!1,kind:"warning",title:P("visitNoteSavedImagesFailed","Visit note saved, but {{count}} image was not uploaded",{count:e.length}),subtitle:[a,t?.responseBody?.error?.message??t?.message].filter(Boolean).join(": ").concat(" ",P("reAddImagesFromNote","Open the note to add it again.",{count:e.length}))});return}(0,E.showSnackbar)({isLowContrast:!0,subtitle:P("visitNoteNowVisible","It is now visible on the Visits page"),kind:"success",title:P("visitNoteSaved","Visit note saved")})}).catch(e=>{e_(P("visitNotePartialSaveError","Could not save all changes. Some changes may already be saved. Try saving again.")),(0,E.createErrorHandler)(),(0,E.showSnackbar)({title:P("visitNoteSaveError","Error saving visit note"),kind:"error",isLowContrast:!1,subtitle:e?.responseBody?.error?.message??e.message})})},[eI,eR,eA,r?.uuid,O,v,er,e?.diagnoses,e?.id,e?.obs,G,j,X,eM,F,H,eU,eW,eH,a,eO,Y.length,P]),eQ=Object.keys(eI).length>0;return n().createElement(E.Workspace2,{title:F?P("editVisitNote","Edit visit note"):P("addVisitNote","Add visit note"),hasUnsavedChanges:eQ},n().createElement(p.Form,{className:"-esm-patient-notes__visit-notes-form__form___WXW3i",onSubmit:ex(eZ,e=>console.error(e))},n().createElement(E.ExtensionSlot,{name:"visit-context-header-slot",state:W}),V&&n().createElement(p.Row,{className:"-esm-patient-notes__visit-notes-form__headerGridRow___jAAax"},n().createElement(E.ExtensionSlot,{name:"visit-form-header-slot",className:"-esm-patient-notes__visit-notes-form__dataGridRow___wKV9H",state:U})),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__formContainer___INxGb"},n().createElement(p.Stack,{gap:2},V?n().createElement("h2",{className:"-esm-patient-notes__visit-notes-form__heading___ZDibC"},F?P("editVisitNote","Edit visit note"):P("addVisitNote","Add visit note")):null,eS&&n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},P("date","Date"))),n().createElement(p.Column,{sm:3},n().createElement(_.xI,{name:"noteDate",control:eC,render:({field:e,fieldState:t})=>n().createElement(E.ResponsiveWrapper,null,n().createElement(E.OpenmrsDatePicker,{...e,"data-testid":"visitDateTimePicker",id:"visitDateTimePicker",invalid:!!t?.error?.message,invalidText:t?.error?.message,isDisabled:F,labelText:P("visitDate","Visit date"),maxDate:new Date}))}))),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__diagnosesText___sNLJv"},Y.map(e=>n().createElement(p.Tag,{className:R,filter:!0,key:e.diagnosis.coded,onClose:()=>eK(e,"primaryInputSearch"),type:"red"},e.display)),et.map(e=>n().createElement(p.Tag,{className:R,filter:!0,key:e.diagnosis.coded,onClose:()=>eK(e,"secondaryInputSearch"),type:"blue"},e.display)),!Y.length&&!et.length&&n().createElement("span",null,P("emptyDiagnosisText","No diagnosis selected — Enter a diagnosis below"))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},P("primaryDiagnosis","Primary diagnosis"))),n().createElement(p.Column,{sm:3},n().createElement(p.FormGroup,{legendText:P("searchForPrimaryDiagnosis","Search for a primary diagnosis")},n().createElement(B,{name:"primaryDiagnosisSearch",control:eC,labelText:P("enterPrimaryDiagnoses","Enter Primary diagnoses"),placeholder:P("primaryDiagnosisInputPlaceholder","Choose a primary diagnosis"),handleSearch:ej,error:ew?.primaryDiagnosisSearch,setIsSearching:Q}),ep?n().createElement(p.InlineNotification,{className:x,lowContrast:!0,title:P("error","Error"),subtitle:P("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>eh(null)}):null,n().createElement(L,{fieldName:"primaryDiagnosisSearch",isDiagnosisNotSelected:e$,isLoading:q,isSearching:Z,onAddDiagnosis:eq,searchResults:es,t:P,value:eB("primaryDiagnosisSearch")})))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},P("secondaryDiagnosis","Secondary diagnosis"))),n().createElement(p.Column,{sm:3},n().createElement(p.FormGroup,{legendText:P("searchForSecondaryDiagnosis","Search for a secondary diagnosis")},n().createElement(B,{name:"secondaryDiagnosisSearch",control:eC,labelText:P("enterSecondaryDiagnoses","Enter Secondary diagnoses"),placeholder:P("secondaryDiagnosisInputPlaceholder","Choose a secondary diagnosis"),handleSearch:ej,setIsSearching:Q}),ep?n().createElement(p.InlineNotification,{className:x,lowContrast:!0,title:P("error","Error"),subtitle:P("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>eh(null)}):null,n().createElement(L,{fieldName:"secondaryDiagnosisSearch",isDiagnosisNotSelected:e$,isLoading:$,isSearching:Z,onAddDiagnosis:eq,searchResults:ei,t:P,value:eB("secondaryDiagnosisSearch")})))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},P("note","Note"))),n().createElement(p.Column,{sm:3},n().createElement(_.xI,{name:"clinicalNote",control:eC,render:({field:{onChange:e,onBlur:t,value:a}})=>n().createElement(E.ResponsiveWrapper,null,n().createElement(p.TextArea,{id:"additionalNote",rows:em,labelText:P("clinicalNoteLabel","Write your notes"),placeholder:P("clinicalNotePlaceholder","Write any notes here"),value:a,onBlur:t,onChange:t=>{e(t),ec(Math.ceil(t.target.scrollHeight/24))}}))}))),n().createElement(p.Row,{className:T},n().createElement(p.Column,{sm:1},n().createElement("span",{className:S},P("image","Image"))),n().createElement(p.Column,{sm:3},n().createElement(p.FormGroup,{legendText:""},n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__imgUploadHelperText___+VxXT"},P("imageUploadHelperText","Upload images or use this device's camera to capture images")),n().createElement(p.Button,{className:"-esm-patient-notes__visit-notes-form__uploadButton___bTplo",disabled:eN,kind:V?"ghost":"tertiary",onClick:eJ,renderIcon:e=>n().createElement(h.OM,{size:16,...e})},P("addImage","Add image")),ev&&n().createElement(p.InlineNotification,{className:k,kind:"error",lowContrast:!0,hideCloseButton:!0,title:P("allowedFileExtensionsLoadError","Couldn't load the allowed image formats"),subtitle:P("allowedFileExtensionsLoadErrorHint","Reload the page to add images to this note.")}),eV&&n().createElement(p.InlineLoading,{className:k,description:P("loadingSavedImages","Loading saved images")+"..."}),ez&&n().createElement(p.InlineNotification,{className:k,kind:"error",lowContrast:!0,hideCloseButton:!0,title:P("savedImagesLoadError","Couldn't load the images saved on this note"),subtitle:P("savedImagesLoadErrorHint","Check the Attachments page before adding them again.")}),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__imgThumbnailGrid___Tbu9Z"},eP.filter(e=>!ed.includes(e.id)).map(e=>{let t=eF.includes(e.id),a=e.description||e.filename||P("savedImage","Saved image");return n().createElement("div",{key:e.id,className:C},n().createElement("div",{className:b},n().createElement("img",{className:o()(D,{"-esm-patient-notes__visit-notes-form__pendingImage___nyrho":t}),src:e.src,alt:a})),t&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__removalStatus___9l-fi"},P("imageMarkedForRemoval","Marked for removal")),n().createElement(p.Button,{kind:t?"ghost":"secondary",size:"sm",disabled:eT,"aria-label":t?P("undoRemoveImage","Undo removal: {{name}}",{name:a}):P("removeImage","Remove image: {{name}}",{name:a}),className:t?"-esm-patient-notes__visit-notes-form__undoButton___-74Gv":w,onClick:()=>eA("removedImageIds",t?eF.filter(t=>t!==e.id):[...eF,e.id],{shouldDirty:!0})},t?P("undo","Undo"):n().createElement(f.bm,{size:16})))}),eL?.map((e,t)=>n().createElement("div",{key:t,className:C},n().createElement("div",{className:b},n().createElement("img",{className:D,src:e.base64Content,alt:e.fileDescription||e.fileName})),n().createElement(p.Button,{kind:"secondary",size:"sm","aria-label":P("removeImage","Remove image: {{name}}",{name:e.fileDescription?.trim()||e.fileName?.trim()||t+1}),className:w,onClick:()=>{let e;(e=[...eL]).splice(t,1),eA("images",e,{shouldDirty:!0}),(0,E.showSnackbar)({title:P("imageRemoved","Image removed"),kind:"success",isLowContrast:!0})}},n().createElement(f.bm,{size:16}))))),eF.length>0&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__removalHint___a6VpP"},P("imageRemovalSaveHint","Images marked for removal will be deleted when you save."))))))),eg&&n().createElement(p.InlineNotification,{kind:"error",lowContrast:!0,hideCloseButton:!0,title:P("visitNoteSaveError","Error saving visit note"),subtitle:eg}),n().createElement(p.ButtonSet,{className:o()({"-esm-patient-notes__visit-notes-form__tablet___R5OWW":V,"-esm-patient-notes__visit-notes-form__desktop___q-E7d":!V})},n().createElement(p.Button,{className:I,kind:"secondary",onClick:()=>v()},P("discard","Discard")),n().createElement(p.Button,{className:I,kind:"primary",disabled:!eQ||eT,type:"submit"},eT?n().createElement(p.InlineLoading,{className:"-esm-patient-notes__visit-notes-form__spinner___nX4VV",description:P("saving","Saving")+"..."}):n().createElement("span",null,P("saveAndClose","Save and close"))))))}}}]);
|
package/dist/7078.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7078.js","sources":["webpack://@openmrs/esm-patient-notes-app/./src/notes/visit-notes-form.scss?988c","webpack://@openmrs/esm-patient-notes-app/./src/notes/visit-notes-form.component.tsx"],"names":["DiagnosisSearch","name","control","labelText","placeholder","handleSearch","error","setIsSearching","isTablet","useLayoutType","inputRef","useRef","useEffect","Controller","value","onChange","onBlur","fieldState","ResponsiveWrapper","Search","props","WarningFilled","e","event","results","document","Date","DiagnosesDisplay","fieldName","isDiagnosisNotSelected","isLoading","isSearching","onAddDiagnosis","searchResults","t","resultsRef","setResultsRef","useCallback","node","Loader","Array","index","result","nextIndex","diagnosis","Tile","_","SkeletonText","encounter","formContext","patientUuid","patient","visitContext","closeWorkspace","isEditing","Boolean","useTranslation","session","useSession","isPrimaryDiagnosisRequired","config","useConfig","visitContextHeaderState","useMemo","memoizedState","clinicianEncounterRole","encounterNoteTextConceptUuid","encounterTypeUuid","formConceptUuid","isLoadingPrimaryDiagnoses","setIsLoadingPrimaryDiagnoses","useState","isLoadingSecondaryDiagnoses","setIsLoadingSecondaryDiagnoses","selectedPrimaryDiagnoses","setSelectedPrimaryDiagnoses","selectedSecondaryDiagnoses","setSelectedSecondaryDiagnoses","searchPrimaryResults","setSearchPrimaryResults","searchSecondaryResults","setSearchSecondaryResults","combinedDiagnoses","setCombinedDiagnoses","rows","setRows","removedImages","setRemovedImages","saveError","setSaveError","setError","allowedFileExtensions","useAllowedFileExtensions","isRetrospectiveDataEntryEnabled","useFeatureFlag","visitNoteFormSchema","z","customResolver","data","context","options","zodResult","zodResolver","clearErrors","errors","dirtyFields","isSubmitting","handleSubmit","getValues","setValue","watch","useForm","String","obs","transformedDiagnoses","d","primaryDiagnoses","secondaryDiagnoses","err","Error","createErrorHandler","currentImages","removedImageIds","savedImages","isLoadingSavedImages","savedImagesError","useVisitNoteImages","undefined","mutateVisitNotes","useVisitNotes","globalMutate","useSWRConfig","mutateAttachments","key","restBaseUrl","locationUuid","providerUuid","debouncedSearch","debounce","fieldQuery","fetchDiagnosisConceptsByName","matchingConceptDiagnoses","createDiagnosis","concept","handleAddDiagnosis","conceptDiagnosisToAdd","searchInputField","newDiagnosis","selectedDiagnoses","handleRemoveDiagnosis","diagnosisToRemove","isPrimaryDiagnosisSelected","selectedDiagnosis","isSecondaryDiagnosisSelected","showImageCaptureModal","close","showModal","file","Promise","ext","onSubmit","noteDate","clinicalNote","images","finalNoteDate","dayjs","now","existingClinicalNoteObs","visitNotePayload","abortController","AbortController","removedAny","noteSaveAttempted","imageId","removeVisitNoteImage","removed","id","diagnosesChanged","saved","Object","field","savePromise","updateVisitNote","saveVisitNote","response","encounterUuid","deletePatientDiagnosis","diagnosesPayload","savePatientDiagnosis","image","imageToUpload","createAttachment","invalidateVisitAndEncounterData","failedUploads","reason","names","showSnackbar","hasUserUnsavedChanges","Workspace2","Form","console","ExtensionSlot","Row","Stack","Column","OpenmrsDatePicker","Tag","FormGroup","InlineNotification","TextArea","Math","Button","Add","InlineLoading","isMarkedForRemoval","classnames","Close","updatedImages","ButtonSet"],"mappings":"uWACA,MAAgG,8DAA8iB,wEAAqF,+DAAkF,qEAA0K,mEAAgF,+DAAsE,yDAA+lB,sDAAkT,oEAAwE,oDC46B9kE,SAASA,EAAgB,CACvBC,KAAAA,CAAI,CACJC,QAAAA,CAAO,CACPC,UAAAA,CAAS,CACTC,YAAAA,CAAW,CACXC,aAAAA,CAAY,CACZC,MAAAA,CAAK,CACLC,eAAAA,CAAc,CACO,EACrB,IAAMC,EAAWC,AAAoB,WAApBA,AAAAA,GAAAA,EAAAA,aAAAA,AAAAA,IACXC,EAAW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GACC,kBAAC2G,EAAAA,aAAaA,CAAAA,CAAC,UDj6BypC,wDCi6B9nC,YAAanL,EAAE,SAAU,UAAY,K,GAE/E,kBAAC,YAAMA,EAAE,eAAgB,sBAOvC,C"}
|
|
1
|
+
{"version":3,"file":"7078.js","sources":["webpack://@openmrs/esm-patient-notes-app/./src/notes/visit-notes-form.scss?988c","webpack://@openmrs/esm-patient-notes-app/./src/notes/visit-notes-form.component.tsx"],"names":["imageExtensions","Set","DiagnosisSearch","name","control","labelText","placeholder","handleSearch","error","setIsSearching","isTablet","useLayoutType","inputRef","useRef","useEffect","Controller","value","onChange","onBlur","fieldState","ResponsiveWrapper","Search","props","WarningFilled","e","event","results","document","Date","DiagnosesDisplay","fieldName","isDiagnosisNotSelected","isLoading","isSearching","onAddDiagnosis","searchResults","t","resultsRef","setResultsRef","useCallback","node","Loader","Array","index","result","nextIndex","diagnosis","Tile","_","SkeletonText","encounter","formContext","patientUuid","patient","visitContext","closeWorkspace","isEditing","Boolean","useTranslation","session","useSession","isPrimaryDiagnosisRequired","config","useConfig","visitContextHeaderState","useMemo","memoizedState","clinicianEncounterRole","encounterNoteTextConceptUuid","encounterTypeUuid","formConceptUuid","isLoadingPrimaryDiagnoses","setIsLoadingPrimaryDiagnoses","useState","isLoadingSecondaryDiagnoses","setIsLoadingSecondaryDiagnoses","selectedPrimaryDiagnoses","setSelectedPrimaryDiagnoses","selectedSecondaryDiagnoses","setSelectedSecondaryDiagnoses","searchPrimaryResults","setSearchPrimaryResults","searchSecondaryResults","setSearchSecondaryResults","combinedDiagnoses","setCombinedDiagnoses","rows","setRows","removedImages","setRemovedImages","saveError","setSaveError","setError","allowedFileExtensions","allowedFileExtensionsError","isLoadingAllowedFileExtensions","useAllowedFileExtensions","allowedImageExtensions","extensions","extension","isImageCaptureDisabled","isRetrospectiveDataEntryEnabled","useFeatureFlag","visitNoteFormSchema","z","customResolver","data","context","options","zodResult","zodResolver","clearErrors","errors","dirtyFields","isSubmitting","handleSubmit","getValues","setValue","watch","useForm","String","obs","transformedDiagnoses","d","primaryDiagnoses","secondaryDiagnoses","err","Error","createErrorHandler","currentImages","removedImageIds","savedImages","isLoadingSavedImages","savedImagesError","useVisitNoteImages","undefined","mutateVisitNotes","useVisitNotes","globalMutate","useSWRConfig","mutateAttachments","key","restBaseUrl","locationUuid","providerUuid","debouncedSearch","debounce","fieldQuery","fetchDiagnosisConceptsByName","matchingConceptDiagnoses","createDiagnosis","concept","handleAddDiagnosis","conceptDiagnosisToAdd","searchInputField","newDiagnosis","selectedDiagnoses","handleRemoveDiagnosis","diagnosisToRemove","isPrimaryDiagnosisSelected","selectedDiagnosis","isSecondaryDiagnosisSelected","showImageCaptureModal","close","showModal","file","Promise","onSubmit","noteDate","clinicalNote","images","finalNoteDate","dayjs","now","existingClinicalNoteObs","visitNotePayload","abortController","AbortController","removedAny","noteSaveAttempted","imageId","removeVisitNoteImage","removed","id","diagnosesChanged","saved","Object","field","savePromise","updateVisitNote","saveVisitNote","response","encounterUuid","deletePatientDiagnosis","diagnosesPayload","savePatientDiagnosis","image","imageToUpload","createAttachment","invalidateVisitAndEncounterData","failedUploads","reason","names","showSnackbar","hasUserUnsavedChanges","Workspace2","Form","console","ExtensionSlot","Row","Stack","Column","OpenmrsDatePicker","Tag","FormGroup","InlineNotification","TextArea","Math","Button","Add","InlineLoading","isMarkedForRemoval","classnames","Close","updatedImages","ButtonSet"],"mappings":"uWACA,MAAgG,8DAA8iB,wEAAqF,+DAAkF,qEAA0K,mEAAgF,+DAAsE,yDAA+lB,sDAAkT,oEAAwE,oDCmGxkEA,EAAkB,IAAIC,IAAI,CAAC,MAAO,OAAQ,MAAO,MAAO,OAAQ,MAAM,EAo2B5E,SAASC,EAAgB,CACvBC,KAAAA,CAAI,CACJC,QAAAA,CAAO,CACPC,UAAAA,CAAS,CACTC,YAAAA,CAAW,CACXC,aAAAA,CAAY,CACZC,MAAAA,CAAK,CACLC,eAAAA,CAAc,CACO,EACrB,IAAMC,EAAWC,AAAoB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,E,OAKpB7F,GAAgB,MAAM,CAAG,GACxB,kBAAC,KAAE,UD/5Bu6E,2D,ECg6Bv6E9F,EAAE,uBAAwB,kEAQxCsD,IACC,kBAAC6H,EAAAA,kBAAkBA,CAAAA,CACjB,KAAK,QACL,eACA,mBACA,MAAOnL,EAAE,qBAAsB,2BAC/B,SAAUsD,E,GAGd,kBAACuI,EAAAA,SAASA,CAAAA,CAAC,UAAWH,IAAW,CDj7B8sC,uDCi7B3rCpN,EDj7B4vC,wDCi7BhuC,CAACA,CAAS,E,EACxF,kBAACgN,EAAAA,MAAMA,CAAAA,CAAC,SAAS,GAAiB,KAAK,YAAY,QAAS,IAAMnK,G,EAC/DnB,EAAE,UAAW,YAEhB,kBAACsL,EAAAA,MAAMA,CAAAA,CACL,SAAS,GACT,KAAK,UACL,SAAU,CAACd,IAAyB1F,GACpC,KAAK,Q,EAEJA,GACC,kBAAC0G,EAAAA,aAAaA,CAAAA,CAAC,UD57BypC,wDC47B9nC,YAAaxL,EAAE,SAAU,UAAY,K,GAE/E,kBAAC,YAAMA,EAAE,eAAgB,sBAOvC,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var _openmrs_esm_patient_notes_app;!function(){var e="u">typeof globalThis?globalThis:self;if(void 0===e._FEDERATION_RUNTIME_CORE||void 0===e._OPENMRS_FEDERATION_SDK||void 0===e._OPENMRS_FEDERATION_ERROR_CODES)throw Error("@openmrs/esm-patient-notes-app cannot start: the OpenMRS app shell serving this page does not provide the Module Federation runtime. This app was built with newer OpenMRS tooling than the app shell, so either upgrade @openmrs/esm-app-shell, or rebuild this app with tooling matching the app shell.");var t=e._FEDERATION_RUNTIME_CORE_FROM;t&&t.version&&"2.8"!==String(t.version).split(".").slice(0,2).join(".")&&console.warn("@openmrs/esm-patient-notes-app was built against Module Federation 2.8.x but the app shell provides "+t.version+". Shared dependencies may not de-duplicate correctly.")}(),(()=>{var e,t,r,n,o,i={8143(e,t,r){"use strict";var n,o,i,a,s,l,u,p,c,d,f,h,m=r(523),g=r.n(m);let y=[].filter(({plugin:e})=>e).map(({plugin:e,params:t})=>e(t)),b={};if((r.initializeSharingData||r.initializeExposesData)&&r.federation){let e=(e,t,r)=>{e&&e[t]&&(e[t]=r)},t=(e,t,r)=>{let n=r();Array.isArray(n)?(null!=e[t]||(e[t]=[]),e[t].push(...n)):"object"==typeof n&&null!==n&&(null!=e[t]||(e[t]={}),Object.assign(e[t],n))},m=(e,t,r)=>{null!=e[t]||(e[t]=r())},S=null!=(n=null==(l=r.remotesLoadingData)?void 0:l.chunkMapping)?n:{},E=null!=(o=null==(u=r.remotesLoadingData)?void 0:u.moduleIdToRemoteDataMapping)?o:{},_=null!=(i=null==(p=r.initializeSharingData)?void 0:p.scopeToSharingDataMapping)?i:{},O=null!=(a=null==(c=r.consumesLoadingData)?void 0:c.chunkMapping)?a:{},M=null!=(s=null==(d=r.consumesLoadingData)?void 0:d.moduleIdToConsumeDataMapping)?s:{},v={},R=[],T={},w=null==(f=r.initializeExposesData)?void 0:f.shareScope;for(let e in g())r.federation[e]=g()[e];m(r.federation,"consumesLoadingModuleToHandlerMapping",()=>{let e={};for(let[t,r]of Object.entries(M))e[t]={getter:r.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:r.requiredVersion,strictVersion:r.strictVersion,singleton:r.singleton,eager:r.eager},scope:[r.shareScope]},shareKey:r.shareKey};return e}),m(r.federation,"initOptions",()=>({})),m(r.federation.initOptions,"name",()=>"@openmrs/esm-patient-notes-app"),m(r.federation.initOptions,"shareStrategy",()=>"version-first"),m(r.federation.initOptions,"shared",()=>{let e={};for(let[t,r]of Object.entries(_))for(let n of r)if("object"==typeof n&&null!==n){let{name:r,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:u}=n,p={},c=function(e){return void 0!==e};c(s)&&(p.singleton=s),c(l)&&(p.requiredVersion=l),c(a)&&(p.eager=a),c(u)&&(p.strictVersion=u);let d={version:o,scope:[t],shareConfig:p,get:i};e[r]?e[r].push(d):e[r]=[d]}return e}),t(r.federation.initOptions,"remotes",()=>Object.values(b).flat().filter(e=>"script"===e.externalType)),t(r.federation.initOptions,"plugins",()=>y),m(r.federation,"bundlerRuntimeOptions",()=>({})),m(r.federation.bundlerRuntimeOptions,"remotes",()=>({})),m(r.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>S),m(r.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>b),m(r.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{let e={};for(let[t,r]of Object.entries(E))e[t]=[r.shareScope,r.name,r.externalModuleId,r.remoteName];return e}),m(r.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>r),t(r.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{let e={};for(let[t,r]of Object.entries(E)){let n=b[r.remoteName];n&&(e[t]=n)}return e}),e(r,"S",r.federation.bundlerRuntime.S),r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),e(r.f,"remotes",(e,t)=>r.federation.bundlerRuntime.remotes({chunkId:e,promises:t,chunkMapping:S,idToExternalAndNameMapping:r.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:r.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:r})),e(r.f,"consumes",(e,t)=>r.federation.bundlerRuntime.consumes({chunkId:e,promises:t,chunkMapping:O,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping,installedModules:v,webpackRequire:r})),e(r,"I",(e,t)=>r.federation.bundlerRuntime.I({shareScopeName:e,initScope:t,initPromises:R,initTokens:T,webpackRequire:r})),e(r,"initContainer",(e,t,n)=>r.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:t,remoteEntryInitOptions:n,shareScopeKey:w,webpackRequire:r})),e(r,"getContainer",(e,t)=>{var n=r.initializeExposesData.moduleMap;return r.R=t,t=Object.prototype.hasOwnProperty.call(n,e)?n[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,t}),r.federation.instance=r.federation.runtime.init(r.federation.initOptions),(null==(h=r.consumesLoadingData)?void 0:h.initialConsumes)&&r.federation.bundlerRuntime.installInitialConsumes({webpackRequire:r,installedModules:v,initialConsumes:r.consumesLoadingData.initialConsumes,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping})}},9188(e,t,r){"use strict";r.d(t,{get:()=>r.getContainer,init:()=>r.initContainer})},3054(e){"use strict";e.exports=globalThis._FEDERATION_RUNTIME_CORE},9170(e){"use strict";e.exports=globalThis._OPENMRS_FEDERATION_ERROR_CODES},1853(e){"use strict";e.exports=globalThis._OPENMRS_FEDERATION_SDK},1772(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(a(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,l=i(t),u=0,p=l.length;u<p;u++)a=l[u],s.call(e,a)||void 0===a||n(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(r=o(t,a))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},9837(e,t,r){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r(1772);let n=r(7789),o=r(3054),i={...o.helpers.global,getGlobalFederationInstance:n.getGlobalFederationInstance},a=o.helpers.share,s=o.helpers.utils;t.default={global:i,share:a,utils:s},t.global=i,t.share=a,t.utils=s},3738(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),r(1772);let n=r(7789),o=r(3054),i=r(9170);function a(e){let t=new((0,o.getGlobalFederationConstructor)()||o.ModuleFederation)({id:`${e.name}@${e.version||Date.now()}`,...e});return(0,o.setGlobalFederationInstance)(t),t}let s=null;(0,o.setGlobalFederationConstructor)(o.ModuleFederation),Object.defineProperty(t,"Module",{enumerable:!0,get:function(){return o.Module}}),t.ModuleFederation=o.ModuleFederation,t.createInstance=a,t.getInstance=function(e){return e?o.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(e)||null:s},Object.defineProperty(t,"getRemoteEntry",{enumerable:!0,get:function(){return o.getRemoteEntry}}),Object.defineProperty(t,"getRemoteInfo",{enumerable:!0,get:function(){return o.getRemoteInfo}}),t.init=function(e){let t=n.getGlobalFederationInstance(e.name,e.version),r={...e,id:e.id||""};return t?(t.initOptions(r),s||(s=t),t):s=a(r)},t.loadRemote=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.loadRemote.apply(s,e)},Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return o.loadScript}}),Object.defineProperty(t,"loadScriptNode",{enumerable:!0,get:function(){return o.loadScriptNode}}),t.loadShare=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.loadShare.apply(s,e)},t.loadShareSync=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.loadShareSync.apply(s,e)},t.preloadRemote=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.preloadRemote.apply(s,e)},Object.defineProperty(t,"registerGlobalPlugins",{enumerable:!0,get:function(){return o.registerGlobalPlugins}}),t.registerPlugins=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.registerPlugins.apply(s,e)},t.registerRemotes=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.registerRemotes.apply(s,e)},t.registerShared=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.registerShared.apply(s,e)}},7789(e,t,r){r(1772);let n=r(3054);t.getGlobalFederationInstance=function(e,t){let r="@openmrs/esm-patient-notes-app:12.3.5-pre.12431";return n.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&!!t&&n.options.version===t)}},223(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(a(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,l=i(t),u=0,p=l.length;u<p;u++)a=l[u],s.call(e,a)||void 0===a||n(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(r=o(t,a))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},3545(e,t){t.attachShareScopeMap=function(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}},6917(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.FEDERATION_SUPPORTED_TYPES=["script"]},1864(e,t,r){let n=r(3545),o=r(1092),i=r(2677),a=r(85),s=r(6781);t.consumes=function(e){o.updateConsumeOptions(e);let{chunkId:t,promises:r,installedModules:l,webpackRequire:u,chunkMapping:p,moduleToHandlerMapping:c}=e;n.attachShareScopeMap(u),u.o(p,t)&&p[t].forEach(e=>{if(u.o(l,e))return r.push(l[e]);let t=t=>{l[e]=0,u.m[e]=r=>{delete u.c[e];let n=t(),{shareInfo:o}=c[e];if(o?.shareConfig?.layer&&n&&"object"==typeof n)try{n.hasOwnProperty("layer")&&void 0!==n.layer||(n.layer=o.shareConfig.layer)}catch(e){}r.exports=n}},n=t=>{delete l[e],u.m[e]=r=>{throw delete u.c[e],t}};try{let o=u.federation.instance;if(!o)throw Error("Federation instance not found!");let{shareKey:p,getter:d,shareInfo:f,treeShakingGetter:h}=c[e],m=i.getUsedExports(u,p),g={...f};Array.isArray(g.scope)&&Array.isArray(g.scope[0])&&(g.scope=g.scope[0]),m&&(g.treeShaking={usedExports:m,useIn:[o.options.name]});let y=o.loadShare(p,{customShareInfo:g}).then(e=>{if(!1===e){if("function"!=typeof d)throw Error(s.getShortErrorMsg(a.RUNTIME_012,{[a.RUNTIME_012]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'},{shareKey:p}));return h?.()||d()}return e});y.then?r.push(l[e]=y.then(t).catch(n)):t(y)}catch(e){n(e)}})}},85(e,t){t.RUNTIME_012="RUNTIME-012"},6781(e,t){t.getShortErrorMsg=(e,t,r,n)=>{let o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`),n&&o.push(`Original Error Message:
|
|
1
|
+
var _openmrs_esm_patient_notes_app;!function(){var e="u">typeof globalThis?globalThis:self;if(void 0===e._FEDERATION_RUNTIME_CORE||void 0===e._OPENMRS_FEDERATION_SDK||void 0===e._OPENMRS_FEDERATION_ERROR_CODES)throw Error("@openmrs/esm-patient-notes-app cannot start: the OpenMRS app shell serving this page does not provide the Module Federation runtime. This app was built with newer OpenMRS tooling than the app shell, so either upgrade @openmrs/esm-app-shell, or rebuild this app with tooling matching the app shell.");var t=e._FEDERATION_RUNTIME_CORE_FROM;t&&t.version&&"2.8"!==String(t.version).split(".").slice(0,2).join(".")&&console.warn("@openmrs/esm-patient-notes-app was built against Module Federation 2.8.x but the app shell provides "+t.version+". Shared dependencies may not de-duplicate correctly.")}(),(()=>{var e,t,r,n,o,i={8143(e,t,r){"use strict";var n,o,i,a,s,l,u,p,c,d,f,h,m=r(523),g=r.n(m);let y=[].filter(({plugin:e})=>e).map(({plugin:e,params:t})=>e(t)),b={};if((r.initializeSharingData||r.initializeExposesData)&&r.federation){let e=(e,t,r)=>{e&&e[t]&&(e[t]=r)},t=(e,t,r)=>{let n=r();Array.isArray(n)?(null!=e[t]||(e[t]=[]),e[t].push(...n)):"object"==typeof n&&null!==n&&(null!=e[t]||(e[t]={}),Object.assign(e[t],n))},m=(e,t,r)=>{null!=e[t]||(e[t]=r())},S=null!=(n=null==(l=r.remotesLoadingData)?void 0:l.chunkMapping)?n:{},E=null!=(o=null==(u=r.remotesLoadingData)?void 0:u.moduleIdToRemoteDataMapping)?o:{},_=null!=(i=null==(p=r.initializeSharingData)?void 0:p.scopeToSharingDataMapping)?i:{},O=null!=(a=null==(c=r.consumesLoadingData)?void 0:c.chunkMapping)?a:{},M=null!=(s=null==(d=r.consumesLoadingData)?void 0:d.moduleIdToConsumeDataMapping)?s:{},v={},R=[],T={},w=null==(f=r.initializeExposesData)?void 0:f.shareScope;for(let e in g())r.federation[e]=g()[e];m(r.federation,"consumesLoadingModuleToHandlerMapping",()=>{let e={};for(let[t,r]of Object.entries(M))e[t]={getter:r.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:r.requiredVersion,strictVersion:r.strictVersion,singleton:r.singleton,eager:r.eager},scope:[r.shareScope]},shareKey:r.shareKey};return e}),m(r.federation,"initOptions",()=>({})),m(r.federation.initOptions,"name",()=>"@openmrs/esm-patient-notes-app"),m(r.federation.initOptions,"shareStrategy",()=>"version-first"),m(r.federation.initOptions,"shared",()=>{let e={};for(let[t,r]of Object.entries(_))for(let n of r)if("object"==typeof n&&null!==n){let{name:r,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:u}=n,p={},c=function(e){return void 0!==e};c(s)&&(p.singleton=s),c(l)&&(p.requiredVersion=l),c(a)&&(p.eager=a),c(u)&&(p.strictVersion=u);let d={version:o,scope:[t],shareConfig:p,get:i};e[r]?e[r].push(d):e[r]=[d]}return e}),t(r.federation.initOptions,"remotes",()=>Object.values(b).flat().filter(e=>"script"===e.externalType)),t(r.federation.initOptions,"plugins",()=>y),m(r.federation,"bundlerRuntimeOptions",()=>({})),m(r.federation.bundlerRuntimeOptions,"remotes",()=>({})),m(r.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>S),m(r.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>b),m(r.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{let e={};for(let[t,r]of Object.entries(E))e[t]=[r.shareScope,r.name,r.externalModuleId,r.remoteName];return e}),m(r.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>r),t(r.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{let e={};for(let[t,r]of Object.entries(E)){let n=b[r.remoteName];n&&(e[t]=n)}return e}),e(r,"S",r.federation.bundlerRuntime.S),r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),e(r.f,"remotes",(e,t)=>r.federation.bundlerRuntime.remotes({chunkId:e,promises:t,chunkMapping:S,idToExternalAndNameMapping:r.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:r.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:r})),e(r.f,"consumes",(e,t)=>r.federation.bundlerRuntime.consumes({chunkId:e,promises:t,chunkMapping:O,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping,installedModules:v,webpackRequire:r})),e(r,"I",(e,t)=>r.federation.bundlerRuntime.I({shareScopeName:e,initScope:t,initPromises:R,initTokens:T,webpackRequire:r})),e(r,"initContainer",(e,t,n)=>r.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:t,remoteEntryInitOptions:n,shareScopeKey:w,webpackRequire:r})),e(r,"getContainer",(e,t)=>{var n=r.initializeExposesData.moduleMap;return r.R=t,t=Object.prototype.hasOwnProperty.call(n,e)?n[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,t}),r.federation.instance=r.federation.runtime.init(r.federation.initOptions),(null==(h=r.consumesLoadingData)?void 0:h.initialConsumes)&&r.federation.bundlerRuntime.installInitialConsumes({webpackRequire:r,installedModules:v,initialConsumes:r.consumesLoadingData.initialConsumes,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping})}},9188(e,t,r){"use strict";r.d(t,{get:()=>r.getContainer,init:()=>r.initContainer})},3054(e){"use strict";e.exports=globalThis._FEDERATION_RUNTIME_CORE},9170(e){"use strict";e.exports=globalThis._OPENMRS_FEDERATION_ERROR_CODES},1853(e){"use strict";e.exports=globalThis._OPENMRS_FEDERATION_SDK},1772(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(a(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,l=i(t),u=0,p=l.length;u<p;u++)a=l[u],s.call(e,a)||void 0===a||n(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(r=o(t,a))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},9837(e,t,r){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r(1772);let n=r(7789),o=r(3054),i={...o.helpers.global,getGlobalFederationInstance:n.getGlobalFederationInstance},a=o.helpers.share,s=o.helpers.utils;t.default={global:i,share:a,utils:s},t.global=i,t.share=a,t.utils=s},3738(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),r(1772);let n=r(7789),o=r(3054),i=r(9170);function a(e){let t=new((0,o.getGlobalFederationConstructor)()||o.ModuleFederation)({id:`${e.name}@${e.version||Date.now()}`,...e});return(0,o.setGlobalFederationInstance)(t),t}let s=null;(0,o.setGlobalFederationConstructor)(o.ModuleFederation),Object.defineProperty(t,"Module",{enumerable:!0,get:function(){return o.Module}}),t.ModuleFederation=o.ModuleFederation,t.createInstance=a,t.getInstance=function(e){return e?o.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(e)||null:s},Object.defineProperty(t,"getRemoteEntry",{enumerable:!0,get:function(){return o.getRemoteEntry}}),Object.defineProperty(t,"getRemoteInfo",{enumerable:!0,get:function(){return o.getRemoteInfo}}),t.init=function(e){let t=n.getGlobalFederationInstance(e.name,e.version),r={...e,id:e.id||""};return t?(t.initOptions(r),s||(s=t),t):s=a(r)},t.loadRemote=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.loadRemote.apply(s,e)},Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return o.loadScript}}),Object.defineProperty(t,"loadScriptNode",{enumerable:!0,get:function(){return o.loadScriptNode}}),t.loadShare=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.loadShare.apply(s,e)},t.loadShareSync=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.loadShareSync.apply(s,e)},t.preloadRemote=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.preloadRemote.apply(s,e)},Object.defineProperty(t,"registerGlobalPlugins",{enumerable:!0,get:function(){return o.registerGlobalPlugins}}),t.registerPlugins=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.registerPlugins.apply(s,e)},t.registerRemotes=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.registerRemotes.apply(s,e)},t.registerShared=function(...e){return(0,o.assert)(s,i.RUNTIME_009,i.runtimeDescMap),s.registerShared.apply(s,e)}},7789(e,t,r){r(1772);let n=r(3054);t.getGlobalFederationInstance=function(e,t){let r="@openmrs/esm-patient-notes-app:12.3.5-pre.12438";return n.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&!!t&&n.options.version===t)}},223(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(a(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,l=i(t),u=0,p=l.length;u<p;u++)a=l[u],s.call(e,a)||void 0===a||n(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(r=o(t,a))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},3545(e,t){t.attachShareScopeMap=function(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}},6917(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.FEDERATION_SUPPORTED_TYPES=["script"]},1864(e,t,r){let n=r(3545),o=r(1092),i=r(2677),a=r(85),s=r(6781);t.consumes=function(e){o.updateConsumeOptions(e);let{chunkId:t,promises:r,installedModules:l,webpackRequire:u,chunkMapping:p,moduleToHandlerMapping:c}=e;n.attachShareScopeMap(u),u.o(p,t)&&p[t].forEach(e=>{if(u.o(l,e))return r.push(l[e]);let t=t=>{l[e]=0,u.m[e]=r=>{delete u.c[e];let n=t(),{shareInfo:o}=c[e];if(o?.shareConfig?.layer&&n&&"object"==typeof n)try{n.hasOwnProperty("layer")&&void 0!==n.layer||(n.layer=o.shareConfig.layer)}catch(e){}r.exports=n}},n=t=>{delete l[e],u.m[e]=r=>{throw delete u.c[e],t}};try{let o=u.federation.instance;if(!o)throw Error("Federation instance not found!");let{shareKey:p,getter:d,shareInfo:f,treeShakingGetter:h}=c[e],m=i.getUsedExports(u,p),g={...f};Array.isArray(g.scope)&&Array.isArray(g.scope[0])&&(g.scope=g.scope[0]),m&&(g.treeShaking={usedExports:m,useIn:[o.options.name]});let y=o.loadShare(p,{customShareInfo:g}).then(e=>{if(!1===e){if("function"!=typeof d)throw Error(s.getShortErrorMsg(a.RUNTIME_012,{[a.RUNTIME_012]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'},{shareKey:p}));return h?.()||d()}return e});y.then?r.push(l[e]=y.then(t).catch(n)):t(y)}catch(e){n(e)}})}},85(e,t){t.RUNTIME_012="RUNTIME-012"},6781(e,t){t.getShortErrorMsg=(e,t,r,n)=>{let o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`),n&&o.push(`Original Error Message:
|
|
2
2
|
${n}`),o.join("\n")}},1315(e,t){t.getSharedFallbackGetter=({shareKey:e,factory:t,version:r,webpackRequire:n,libraryType:o="global"})=>{let{runtime:i,instance:a,bundlerRuntime:s,sharedFallback:l}=n.federation;if(!l)return t;let u=l[e];if(!u)return t;let p=r?u.find(e=>e[1]===r):u[0];if(!p)throw Error(`No fallback item found for shareKey: ${e} and version: ${r}`);return()=>i.getRemoteEntry({origin:n.federation.instance,remoteInfo:{name:p[2],entry:`${n.p}${p[0]}`,type:o,entryGlobalName:p[2],shareScope:"default"}}).then(t=>{if(!t)throw Error(`Failed to load fallback entry for shareKey: ${e} and version: ${r}`);return t.init(n.federation.instance,s).then(()=>t.get())})}},2677(e,t){t.getUsedExports=function(e,t){let r=e.federation.usedExports;if(r)return r[t]}},523(e,t,r){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let n=r(223),o=r(3545),i=r(3586),a=r(1864),s=r(2221),l=r(4307),u=r(1180),p=r(367),c=r(1315),d=r(3738);d=n.__toESM(d);let f={remotes:i.remotes,consumes:a.consumes,I:s.initializeSharing,S:{},installInitialConsumes:l.installInitialConsumes,initContainerEntry:u.initContainerEntry,init:p.init,getSharedFallbackGetter:c.getSharedFallbackGetter},h={runtime:d,instance:void 0,initOptions:void 0,bundlerRuntime:f,attachShareScopeMap:o.attachShareScopeMap,bundlerRuntimeOptions:{}},m=h.instance,g=h.initOptions,y=h.bundlerRuntimeOptions;t.attachShareScopeMap=o.attachShareScopeMap,t.bundlerRuntime=f,t.bundlerRuntimeOptions=y,t.default=h,t.initOptions=g,t.instance=m,Object.defineProperty(t,"runtime",{enumerable:!0,get:function(){return d}})},367(e,t,r){let n=r(223),o=r(3738),i=r(9837);i=n.__toESM(i),t.init=function({webpackRequire:e}){let{initOptions:t,runtime:n,sharedFallback:a,bundlerRuntime:s,libraryType:l}=e.federation;if(!t)throw Error("initOptions is required!");return t.plugins||=[],t.plugins.push({name:"tree-shake-plugin",beforeInit(t){let{userOptions:n,origin:u,options:p}=t,c=n.version||p.version;if(!a)return t;let d=n.shared||{},f=[];Object.keys(d).forEach(t=>{(Array.isArray(d[t])?d[t]:[d[t]]).forEach(r=>{f.push([t,r]),"get"in r&&(r.treeShaking||={},r.treeShaking.get=r.get,r.get=s.getSharedFallbackGetter({shareKey:t,factory:r.get,webpackRequire:e,libraryType:l,version:r.version}))})});let h=i.default.global.getGlobalSnapshotInfoByModuleInfo({name:u.name,version:c});return h&&"shared"in h&&(Object.keys(p.shared||{}).forEach(e=>{p.shared[e].forEach(t=>{f.push([e,t])})}),f.forEach(([e,t])=>{((e,t)=>{let n=h.shared.find(t=>t.sharedName===e);if(!n)return;let{treeShaking:i}=t;if(!i)return;let{secondarySharedTreeShakingName:a,secondarySharedTreeShakingEntry:s,treeShakingStatus:p}=n;i.status!==p&&(i.status=p,s&&l&&a&&(i.get=async()=>{let e=await (0,o.getRemoteEntry)({origin:u,remoteInfo:{name:a,entry:s,type:l,entryGlobalName:a,shareScope:"default"}});return await e.init(u,r.federation.bundlerRuntime),e.get()}))})(e,t)})),t}}),n.init(t)}},1180(e,t){t.initContainerEntry=function(e){let{webpackRequire:t,shareScope:r,initScope:n,shareScopeKey:o,remoteEntryInitOptions:i}=e;if(!t.S||!t.federation||!t.federation.instance||!t.federation.initOptions)return;let a=t.federation.instance;a.initOptions({name:t.federation.initOptions.name,remotes:[],...i});let s=i?.shareScopeKeys,l=i?.shareScopeMap;if(o&&"string"!=typeof o)o.forEach(e=>{if(!s||!l)return void a.initShareScopeMap(e,r,{hostShareScopeMap:i?.shareScopeMap||{}});l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:i?.shareScopeMap||{}})});else{let e=o||"default";Array.isArray(s)?s.forEach(e=>{l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:i?.shareScopeMap||{}})}):a.initShareScopeMap(e,r,{hostShareScopeMap:i?.shareScopeMap||{}})}return(t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),Array.isArray(o))?t.federation.initOptions.shared?t.I(o,n):Promise.all(o.map(e=>t.I(e,n))).then(()=>!0):t.I(o||"default",n)}},2221(e,t,r){let n=r(3545),o=r(6917);t.initializeSharing=function({shareScopeName:e,webpackRequire:t,initPromises:r,initTokens:i,initScope:a}){let s=Array.isArray(e)?e:[e];var l=[],u=function(s){a||(a=[]);let l=t.federation.instance;var u=i[s];if(u||(u=i[s]={from:l.name}),a.indexOf(u)>=0)return;a.push(u);let p=r[s];if(p)return p;var c=r=>{var n=e=>{let t;return t="Initialization of sharing external failed: "+e,"u">typeof console&&console.warn&&console.warn(t)};try{var o=t(r);if(!o)return;var i=r=>r&&r.init&&r.init(t.S[s],a,{shareScopeMap:t.S||{},shareScopeKeys:e});if(o.then)return d.push(o.then(i,n));var l=i(o);if(l&&"boolean"!=typeof l&&l.then)return d.push(l.catch(n))}catch(e){n(e)}};let d=l.initializeSharing(s,{strategy:l.options.shareStrategy,initScope:a,from:"build"});n.attachShareScopeMap(t);let f=t.federation.bundlerRuntimeOptions.remotes;return(f&&Object.keys(f.idToRemoteMap).forEach(e=>{let t=f.idToRemoteMap[e],r=f.idToExternalAndNameMapping[e][2];if(t.length>1)c(r);else if(1===t.length){let e=t[0];o.FEDERATION_SUPPORTED_TYPES.includes(e.externalType)||c(r)}}),d.length)?r[s]=Promise.all(d).then(()=>r[s]=!0):r[s]=!0};return s.forEach(e=>{l.push(u(e))}),Promise.all(l).then(()=>!0)}},4307(e,t,r){let n=r(1092),o=r(2677);t.installInitialConsumes=function(e){n.updateConsumeOptions(e);let{moduleToHandlerMapping:t,webpackRequire:r,installedModules:i,initialConsumes:a,asyncLoad:s}=e,l=[];a.forEach(e=>{l.push([e,()=>(function(e){let{moduleId:t,moduleToHandlerMapping:r,webpackRequire:n,asyncLoad:i}=e,a=n.federation.instance;if(!a)throw Error("Federation instance not found!");let{shareKey:s,shareInfo:l}=r[t];try{let e=o.getUsedExports(n,s),t={...l};if(e&&(t.treeShaking={usedExports:e,useIn:[a.options.name]}),i)return a.loadShare(s,{customShareInfo:t});return a.loadShareSync(s,{customShareInfo:t})}catch(e){throw console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.'),console.error("The original error message is as follows: "),e}})({moduleId:e,moduleToHandlerMapping:t,webpackRequire:r,asyncLoad:s})])});let u=(e,n)=>{r.m[e]=o=>{i[e]=0,delete r.c[e];let a=n();if("function"!=typeof a)throw Error(`Shared module is not available for eager consumption: ${e}`);let s=a(),{shareInfo:l}=t[e];if(l?.shareConfig?.layer&&s&&"object"==typeof s)try{s.hasOwnProperty("layer")&&void 0!==s.layer||(s.layer=l.shareConfig.layer)}catch(e){}o.exports=s}};if(s)return Promise.all(l.map(async([e,t])=>{let r=await t();u(e,()=>r)}));l.forEach(([e,t])=>{u(e,t)})}},3586(e,t,r){r(223);let n=r(3545),o=r(6917),i=r(1092),a=r(1853);t.remotes=function(e){i.updateRemoteOptions(e);let{chunkId:t,promises:r,webpackRequire:s,chunkMapping:l,idToExternalAndNameMapping:u,idToRemoteMap:p}=e;n.attachShareScopeMap(s),s.o(l,t)&&l[t].forEach(e=>{let t=s.R;t||(t=[]);let n=u[e],i=p[e]||[];if(t.indexOf(n)>=0)return;if(t.push(n),n.p)return r.push(n.p);let l=t=>{t||(t=Error("Container missing")),"string"==typeof t.message&&(t.message+=`
|
|
3
|
-
while loading "${n[1]}" from ${n[2]}`),s.m[e]=()=>{throw t},n.p=0},c=(e,t,o,i,a,s)=>{try{let u=e(t,o);if(!u||!u.then)return a(u,i,s);{let e=u.then(e=>a(e,i),l);if(!s)return e;r.push(n.p=e)}}catch(e){l(e)}};var d=(e,r,o)=>c(r.get,n[1],t,0,f,o),f=t=>{n.p=1,s.m[e]=e=>{e.exports=t()}};1===i.length&&o.FEDERATION_SUPPORTED_TYPES.includes(i[0].externalType)&&i[0].name?c(()=>{try{let e=(0,a.decodeName)(i[0].name,a.ENCODE_NAME_PREFIX)+n[1].slice(1),t=s.federation.instance,r=()=>s.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===t.options.shareStrategy){let e=Array.isArray(n[0])?n[0]:[n[0]];return Promise.all(e.map(e=>t.sharedHandler.initializeSharing(e))).then(()=>r())}return r()}catch(e){l(e)}},n[2],0,0,f,1):c(s,n[2],0,0,(e,t,r)=>e?c(s.I,n[0],0,e,d,r):l(),1)})}},1092(e,t){t.updateConsumeOptions=function(e){let{webpackRequire:t,moduleToHandlerMapping:r}=e,{consumesLoadingData:n,initializeSharingData:o}=t,{sharedFallback:i,bundlerRuntime:a,libraryType:s}=t.federation;if(n&&!n._updated){let{moduleIdToConsumeDataMapping:o={},initialConsumes:l=[],chunkMapping:u={}}=n;if(Object.entries(o).forEach(([e,n])=>{r[e]||(r[e]={getter:i?a?.getSharedFallbackGetter({shareKey:n.shareKey,factory:n.fallback,webpackRequire:t,libraryType:s}):n.fallback,treeShakingGetter:i?n.fallback:void 0,shareInfo:{shareConfig:{requiredVersion:n.requiredVersion,strictVersion:n.strictVersion,singleton:n.singleton,eager:n.eager,layer:n.layer},scope:Array.isArray(n.shareScope)?n.shareScope:[n.shareScope||"default"],treeShaking:i?{get:n.fallback,mode:n.treeShakingMode}:void 0},shareKey:n.shareKey})}),"initialConsumes"in e){let{initialConsumes:t=[]}=e;l.forEach(e=>{t.includes(e)||t.push(e)})}if("chunkMapping"in e){let{chunkMapping:t={}}=e;Object.entries(u).forEach(([e,r])=>{t[e]||(t[e]=[]),r.forEach(r=>{t[e].includes(r)||t[e].push(r)})})}n._updated=1}if(o&&!o._updated){let{federation:e}=t;if(!e.instance||!o.scopeToSharingDataMapping)return;let r={};for(let[e,t]of Object.entries(o.scopeToSharingDataMapping))for(let n of t)if("object"==typeof n&&null!==n){let{name:t,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:u}=n,p={requiredVersion:`^${o}`},c=function(e){return void 0!==e};c(s)&&(p.singleton=s),c(l)&&(p.requiredVersion=l),c(a)&&(p.eager=a),c(u)&&(p.strictVersion=u);let d={version:o,scope:[e],shareConfig:p,get:i};r[t]?r[t].push(d):r[t]=[d]}e.instance.registerShared(r),o._updated=1}},t.updateRemoteOptions=function(e){let{webpackRequire:t,idToExternalAndNameMapping:r={},idToRemoteMap:n={},chunkMapping:o={}}=e,{remotesLoadingData:i}=t,a=t.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!i||i._updated||!a)return;let{chunkMapping:s,moduleIdToRemoteDataMapping:l}=i;if(s&&l){for(let[e,t]of Object.entries(l))if(r[e]||(r[e]=[t.shareScope,t.name,t.externalModuleId]),!n[e]&&a[t.remoteName]){let r=a[t.remoteName];n[e]||=[],r.forEach(t=>{n[e].includes(t)||n[e].push(t)})}o&&Object.entries(s).forEach(([e,t])=>{o[e]||(o[e]=[]),t.forEach(t=>{o[e].includes(t)||o[e].push(t)})}),i._updated=1}}}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e].call(r.exports,r,r.exports,s),r.exports}s.m=i,s.c=a,s.x=()=>s(9188),s.federation||(s.federation={chunkMatcher:function(e){return!/^((50|99)59|3543|4006|4957|5123|8652)$/.test(e)},rootOutputDir:""}),s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},u=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);s.r(r);var n={};l=l||[null,u({}),u([]),u(u)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~l.indexOf(o);o=u(o))Object.getOwnPropertyNames(o).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,s.d(r,n),r},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".js",s.miniCssF=e=>""+e+".css",s.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},s.l=function(e,t,r,n){if(p[e])return void p[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var u=a[l];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@openmrs/esm-patient-notes-app:"+r){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@openmrs/esm-patient-notes-app:"+r),o.src=e),p[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(d);var n=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.rv=()=>"1.7.9",s.S={},s.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@carbon/react",version:"1.92.1",factory:()=>Promise.all([s.e("689"),s.e("4669"),s.e("9488"),s.e("5"),s.e("8652"),s.e("3390")]).then(()=>()=>s(6020)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"@openmrs/esm-framework",version:"10.0.1-pre.5522",factory:()=>Promise.all([s.e("689"),s.e("4669"),s.e("7621"),s.e("3625"),s.e("8652"),s.e("3543"),s.e("5059"),s.e("9959"),s.e("5123")]).then(()=>()=>s(2096)),eager:0,singleton:1,requiredVersion:"10.x",strictVersion:0},{name:"@openmrs/esm-patient-common-lib",version:"12.3.5-pre.12431",factory:()=>Promise.all([s.e("7621"),s.e("8652"),s.e("3543"),s.e("9959"),s.e("1284"),s.e("4006"),s.e("9116")]).then(()=>()=>s(7295)),eager:0,singleton:1,requiredVersion:"12.x",strictVersion:0},{name:"dayjs",version:"1.11.13",factory:()=>s.e("5697").then(()=>()=>s(3464)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"react-i18next",version:"16.0.0",factory:()=>Promise.all([s.e("1789"),s.e("8652")]).then(()=>()=>s(2348)),eager:0,singleton:1,requiredVersion:"16.x",strictVersion:0},{name:"react-router-dom",version:"6.30.4",factory:()=>Promise.all([s.e("689"),s.e("9712"),s.e("8652")]).then(()=>()=>s(7059)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"react",version:"18.3.1",factory:()=>s.e("466").then(()=>()=>s(4041)),eager:0,singleton:1,requiredVersion:"18.x",strictVersion:0},{name:"rxjs",version:"6.6.7",factory:()=>s.e("9105").then(()=>()=>s(7864)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"swr/_internal",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("8652")]).then(()=>()=>s(2372)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/immutable",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("8652"),s.e("9061")]).then(()=>()=>s(9876)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/infinite",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("8652"),s.e("9771")]).then(()=>()=>s(2470)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("8652"),s.e("7209")]).then(()=>()=>s(5216)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0}]},uniqueName:"@openmrs/esm-patient-notes-app"},s.I=s.I||function(){throw Error("should have __webpack_require__.I")},s.g.importScripts&&(c=s.g.location+"");var l,u,p,c,d=s.g.document;if(!c&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(c=d.currentScript.src),!c)){var f=d.getElementsByTagName("script");if(f.length)for(var h=f.length-1;h>-1&&(!c||!/^http(s?):/.test(c));)c=f[h--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");if(s.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.consumesLoadingData={chunkMapping:{9959:["7807","324","1619"],8652:["5399"],4006:["2293"],5123:["3432","682","4354"],8800:["3040"],5059:["222"],3543:["5571","3660"]},moduleIdToConsumeDataMapping:{682:{shareScope:"default",shareKey:"swr/infinite",import:"swr/infinite",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("2152")]).then(()=>()=>s(2470))},4354:{shareScope:"default",shareKey:"rxjs",import:"rxjs",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("9105").then(()=>()=>s(7864))},3432:{shareScope:"default",shareKey:"swr/_internal",import:"swr/_internal",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("3989").then(()=>()=>s(2372))},2293:{shareScope:"default",shareKey:"@openmrs/esm-framework",import:"@openmrs/esm-framework",requiredVersion:"10.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("689"),s.e("4669"),s.e("3625"),s.e("3543"),s.e("5059"),s.e("5123")]).then(()=>()=>s(2096))},3040:{shareScope:"default",shareKey:"@openmrs/esm-patient-common-lib",import:"@openmrs/esm-patient-common-lib",requiredVersion:"12.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3543"),s.e("1284"),s.e("4957")]).then(()=>()=>s(7295))},3660:{shareScope:"default",shareKey:"swr/immutable",import:"swr/immutable",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("1442")]).then(()=>()=>s(9876))},5571:{shareScope:"default",shareKey:"react-router-dom",import:"react-router-dom",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("689"),s.e("9712")]).then(()=>()=>s(7059))},222:{shareScope:"default",shareKey:"dayjs",import:"dayjs",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("5697").then(()=>()=>s(3464))},5399:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("466").then(()=>()=>s(4041))},7807:{shareScope:"default",shareKey:"react-i18next",import:"react-i18next",requiredVersion:"16.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("1789").then(()=>()=>s(2348))},324:{shareScope:"default",shareKey:"@carbon/react",import:"@carbon/react",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("689"),s.e("4669"),s.e("9488"),s.e("5")]).then(()=>()=>s(6020))},1619:{shareScope:"default",shareKey:"swr",import:"swr",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("9590")]).then(()=>()=>s(5216))}},initialConsumes:[]},s.f.consumes=s.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},"u">typeof document){var m=function(e,t,r,n,o){var i=document.createElement("link");return i.rel="stylesheet",i.type="text/css",s.nc&&(i.nonce=s.nc),i.href=t,i.onerror=i.onload=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var a=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}},r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i),i},g=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if(i&&(i=i.split("?")[0]),"stylesheet"===o.rel&&(i===e||i===t))return o}for(var a=document.getElementsByTagName("style"),n=0;n<a.length;n++){var o=a[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},y={2190:0};s.f.miniCss=function(e,t){if(y[e])t.push(y[e]);else 0!==y[e]&&({2286:1,2842:1,3625:1,4957:1,5861:1,8800:1,8962:1,9116:1})[e]&&t.push(y[e]=new Promise(function(t,r){var n=s.miniCssF(e),o=s.p+n;if(g(n,o))return t();m(e,o,null,t,r)}).then(function(){y[e]=0},function(t){throw delete y[e],t}))}}s.initializeExposesData={moduleMap:{"./start":()=>Promise.all([s.e("7621"),s.e("7682"),s.e("8652"),s.e("9959"),s.e("4006"),s.e("8800")]).then(()=>()=>s(7251))},shareScope:"default"},s.getContainer=s.getContainer||function(){throw Error("should have __webpack_require__.getContainer")},s.initContainer=s.initContainer||function(){throw Error("should have __webpack_require__.initContainer")},e={2190:0},s.f.j=function(t,r){var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^((50|99)59|3543|4006|4957|5123|8652)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=s.p+s.u(t),a=Error();s.l(i,function(r){if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}},"chunk-"+t,t)}},t=(t,r)=>{var n,o,[i,a,l]=r,u=0;if(i.some(t=>0!==e[t])){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);l&&l(s)}for(t&&t(r);u<i.length;u++)o=i[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},(r=globalThis.webpackChunk_openmrs_esm_patient_notes_app=globalThis.webpackChunk_openmrs_esm_patient_notes_app||[]).forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r)),s.ruid="bundler=rspack@1.7.9",n=s.x,o=!1,s.x=function(){if(o||(o=!0,s(8143)),"function"==typeof n)return n();console.warn("[MF] Invalid prevStartup")},_openmrs_esm_patient_notes_app=s.x()})();
|
|
3
|
+
while loading "${n[1]}" from ${n[2]}`),s.m[e]=()=>{throw t},n.p=0},c=(e,t,o,i,a,s)=>{try{let u=e(t,o);if(!u||!u.then)return a(u,i,s);{let e=u.then(e=>a(e,i),l);if(!s)return e;r.push(n.p=e)}}catch(e){l(e)}};var d=(e,r,o)=>c(r.get,n[1],t,0,f,o),f=t=>{n.p=1,s.m[e]=e=>{e.exports=t()}};1===i.length&&o.FEDERATION_SUPPORTED_TYPES.includes(i[0].externalType)&&i[0].name?c(()=>{try{let e=(0,a.decodeName)(i[0].name,a.ENCODE_NAME_PREFIX)+n[1].slice(1),t=s.federation.instance,r=()=>s.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===t.options.shareStrategy){let e=Array.isArray(n[0])?n[0]:[n[0]];return Promise.all(e.map(e=>t.sharedHandler.initializeSharing(e))).then(()=>r())}return r()}catch(e){l(e)}},n[2],0,0,f,1):c(s,n[2],0,0,(e,t,r)=>e?c(s.I,n[0],0,e,d,r):l(),1)})}},1092(e,t){t.updateConsumeOptions=function(e){let{webpackRequire:t,moduleToHandlerMapping:r}=e,{consumesLoadingData:n,initializeSharingData:o}=t,{sharedFallback:i,bundlerRuntime:a,libraryType:s}=t.federation;if(n&&!n._updated){let{moduleIdToConsumeDataMapping:o={},initialConsumes:l=[],chunkMapping:u={}}=n;if(Object.entries(o).forEach(([e,n])=>{r[e]||(r[e]={getter:i?a?.getSharedFallbackGetter({shareKey:n.shareKey,factory:n.fallback,webpackRequire:t,libraryType:s}):n.fallback,treeShakingGetter:i?n.fallback:void 0,shareInfo:{shareConfig:{requiredVersion:n.requiredVersion,strictVersion:n.strictVersion,singleton:n.singleton,eager:n.eager,layer:n.layer},scope:Array.isArray(n.shareScope)?n.shareScope:[n.shareScope||"default"],treeShaking:i?{get:n.fallback,mode:n.treeShakingMode}:void 0},shareKey:n.shareKey})}),"initialConsumes"in e){let{initialConsumes:t=[]}=e;l.forEach(e=>{t.includes(e)||t.push(e)})}if("chunkMapping"in e){let{chunkMapping:t={}}=e;Object.entries(u).forEach(([e,r])=>{t[e]||(t[e]=[]),r.forEach(r=>{t[e].includes(r)||t[e].push(r)})})}n._updated=1}if(o&&!o._updated){let{federation:e}=t;if(!e.instance||!o.scopeToSharingDataMapping)return;let r={};for(let[e,t]of Object.entries(o.scopeToSharingDataMapping))for(let n of t)if("object"==typeof n&&null!==n){let{name:t,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:u}=n,p={requiredVersion:`^${o}`},c=function(e){return void 0!==e};c(s)&&(p.singleton=s),c(l)&&(p.requiredVersion=l),c(a)&&(p.eager=a),c(u)&&(p.strictVersion=u);let d={version:o,scope:[e],shareConfig:p,get:i};r[t]?r[t].push(d):r[t]=[d]}e.instance.registerShared(r),o._updated=1}},t.updateRemoteOptions=function(e){let{webpackRequire:t,idToExternalAndNameMapping:r={},idToRemoteMap:n={},chunkMapping:o={}}=e,{remotesLoadingData:i}=t,a=t.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!i||i._updated||!a)return;let{chunkMapping:s,moduleIdToRemoteDataMapping:l}=i;if(s&&l){for(let[e,t]of Object.entries(l))if(r[e]||(r[e]=[t.shareScope,t.name,t.externalModuleId]),!n[e]&&a[t.remoteName]){let r=a[t.remoteName];n[e]||=[],r.forEach(t=>{n[e].includes(t)||n[e].push(t)})}o&&Object.entries(s).forEach(([e,t])=>{o[e]||(o[e]=[]),t.forEach(t=>{o[e].includes(t)||o[e].push(t)})}),i._updated=1}}}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e].call(r.exports,r,r.exports,s),r.exports}s.m=i,s.c=a,s.x=()=>s(9188),s.federation||(s.federation={chunkMatcher:function(e){return!/^((50|99)59|3543|4006|4957|5123|8652)$/.test(e)},rootOutputDir:""}),s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},u=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);s.r(r);var n={};l=l||[null,u({}),u([]),u(u)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~l.indexOf(o);o=u(o))Object.getOwnPropertyNames(o).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,s.d(r,n),r},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".js",s.miniCssF=e=>""+e+".css",s.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},s.l=function(e,t,r,n){if(p[e])return void p[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var u=a[l];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@openmrs/esm-patient-notes-app:"+r){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@openmrs/esm-patient-notes-app:"+r),o.src=e),p[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(d);var n=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.rv=()=>"1.7.9",s.S={},s.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@carbon/react",version:"1.92.1",factory:()=>Promise.all([s.e("689"),s.e("4669"),s.e("9488"),s.e("5"),s.e("8652"),s.e("3390")]).then(()=>()=>s(6020)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"@openmrs/esm-framework",version:"10.0.1-pre.5522",factory:()=>Promise.all([s.e("689"),s.e("4669"),s.e("7621"),s.e("3625"),s.e("8652"),s.e("3543"),s.e("5059"),s.e("9959"),s.e("5123")]).then(()=>()=>s(2096)),eager:0,singleton:1,requiredVersion:"10.x",strictVersion:0},{name:"@openmrs/esm-patient-common-lib",version:"12.3.5-pre.12438",factory:()=>Promise.all([s.e("7621"),s.e("8652"),s.e("3543"),s.e("9959"),s.e("1284"),s.e("4006"),s.e("9116")]).then(()=>()=>s(7295)),eager:0,singleton:1,requiredVersion:"12.x",strictVersion:0},{name:"dayjs",version:"1.11.13",factory:()=>s.e("5697").then(()=>()=>s(3464)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"react-i18next",version:"16.0.0",factory:()=>Promise.all([s.e("1789"),s.e("8652")]).then(()=>()=>s(2348)),eager:0,singleton:1,requiredVersion:"16.x",strictVersion:0},{name:"react-router-dom",version:"6.30.4",factory:()=>Promise.all([s.e("689"),s.e("9712"),s.e("8652")]).then(()=>()=>s(7059)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"react",version:"18.3.1",factory:()=>s.e("466").then(()=>()=>s(4041)),eager:0,singleton:1,requiredVersion:"18.x",strictVersion:0},{name:"rxjs",version:"6.6.7",factory:()=>s.e("9105").then(()=>()=>s(7864)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"swr/_internal",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("8652")]).then(()=>()=>s(2372)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/immutable",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("8652"),s.e("9061")]).then(()=>()=>s(9876)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/infinite",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("8652"),s.e("9771")]).then(()=>()=>s(2470)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr",version:"2.5.1",factory:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("8652"),s.e("7209")]).then(()=>()=>s(5216)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0}]},uniqueName:"@openmrs/esm-patient-notes-app"},s.I=s.I||function(){throw Error("should have __webpack_require__.I")},s.g.importScripts&&(c=s.g.location+"");var l,u,p,c,d=s.g.document;if(!c&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(c=d.currentScript.src),!c)){var f=d.getElementsByTagName("script");if(f.length)for(var h=f.length-1;h>-1&&(!c||!/^http(s?):/.test(c));)c=f[h--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");if(s.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.consumesLoadingData={chunkMapping:{9959:["7807","324","1619"],8652:["5399"],4006:["2293"],5123:["3432","682","4354"],8800:["3040"],5059:["222"],3543:["5571","3660"]},moduleIdToConsumeDataMapping:{682:{shareScope:"default",shareKey:"swr/infinite",import:"swr/infinite",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("2152")]).then(()=>()=>s(2470))},4354:{shareScope:"default",shareKey:"rxjs",import:"rxjs",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("9105").then(()=>()=>s(7864))},3432:{shareScope:"default",shareKey:"swr/_internal",import:"swr/_internal",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("3989").then(()=>()=>s(2372))},2293:{shareScope:"default",shareKey:"@openmrs/esm-framework",import:"@openmrs/esm-framework",requiredVersion:"10.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("689"),s.e("4669"),s.e("3625"),s.e("3543"),s.e("5059"),s.e("5123")]).then(()=>()=>s(2096))},3040:{shareScope:"default",shareKey:"@openmrs/esm-patient-common-lib",import:"@openmrs/esm-patient-common-lib",requiredVersion:"12.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3543"),s.e("1284"),s.e("4957")]).then(()=>()=>s(7295))},3660:{shareScope:"default",shareKey:"swr/immutable",import:"swr/immutable",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("1442")]).then(()=>()=>s(9876))},5571:{shareScope:"default",shareKey:"react-router-dom",import:"react-router-dom",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("689"),s.e("9712")]).then(()=>()=>s(7059))},222:{shareScope:"default",shareKey:"dayjs",import:"dayjs",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("5697").then(()=>()=>s(3464))},5399:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("466").then(()=>()=>s(4041))},7807:{shareScope:"default",shareKey:"react-i18next",import:"react-i18next",requiredVersion:"16.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("1789").then(()=>()=>s(2348))},324:{shareScope:"default",shareKey:"@carbon/react",import:"@carbon/react",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("689"),s.e("4669"),s.e("9488"),s.e("5")]).then(()=>()=>s(6020))},1619:{shareScope:"default",shareKey:"swr",import:"swr",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("3989"),s.e("4560"),s.e("9590")]).then(()=>()=>s(5216))}},initialConsumes:[]},s.f.consumes=s.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},"u">typeof document){var m=function(e,t,r,n,o){var i=document.createElement("link");return i.rel="stylesheet",i.type="text/css",s.nc&&(i.nonce=s.nc),i.href=t,i.onerror=i.onload=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var a=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}},r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i),i},g=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if(i&&(i=i.split("?")[0]),"stylesheet"===o.rel&&(i===e||i===t))return o}for(var a=document.getElementsByTagName("style"),n=0;n<a.length;n++){var o=a[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},y={2190:0};s.f.miniCss=function(e,t){if(y[e])t.push(y[e]);else 0!==y[e]&&({2286:1,2842:1,3625:1,4957:1,5861:1,8800:1,8962:1,9116:1})[e]&&t.push(y[e]=new Promise(function(t,r){var n=s.miniCssF(e),o=s.p+n;if(g(n,o))return t();m(e,o,null,t,r)}).then(function(){y[e]=0},function(t){throw delete y[e],t}))}}s.initializeExposesData={moduleMap:{"./start":()=>Promise.all([s.e("7621"),s.e("7682"),s.e("8652"),s.e("9959"),s.e("4006"),s.e("8800")]).then(()=>()=>s(7251))},shareScope:"default"},s.getContainer=s.getContainer||function(){throw Error("should have __webpack_require__.getContainer")},s.initContainer=s.initContainer||function(){throw Error("should have __webpack_require__.initContainer")},e={2190:0},s.f.j=function(t,r){var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^((50|99)59|3543|4006|4957|5123|8652)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=s.p+s.u(t),a=Error();s.l(i,function(r){if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}},"chunk-"+t,t)}},t=(t,r)=>{var n,o,[i,a,l]=r,u=0;if(i.some(t=>0!==e[t])){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);l&&l(s)}for(t&&t(r);u<i.length;u++)o=i[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},(r=globalThis.webpackChunk_openmrs_esm_patient_notes_app=globalThis.webpackChunk_openmrs_esm_patient_notes_app||[]).forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r)),s.ruid="bundler=rspack@1.7.9",n=s.x,o=!1,s.x=function(){if(o||(o=!0,s(8143)),"function"==typeof n)return n();console.warn("[MF] Invalid prevStartup")},_openmrs_esm_patient_notes_app=s.x()})();
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
"auxiliaryFiles": [
|
|
241
241
|
"openmrs-esm-patient-notes-app.js.map"
|
|
242
242
|
],
|
|
243
|
-
"hash": "
|
|
243
|
+
"hash": "4b659172eececf5f",
|
|
244
244
|
"childrenByOrder": {}
|
|
245
245
|
},
|
|
246
246
|
{
|
|
@@ -914,9 +914,9 @@
|
|
|
914
914
|
"rendered": true,
|
|
915
915
|
"initial": false,
|
|
916
916
|
"entry": false,
|
|
917
|
-
"size":
|
|
917
|
+
"size": 3373,
|
|
918
918
|
"sizes": {
|
|
919
|
-
"javascript":
|
|
919
|
+
"javascript": 3373
|
|
920
920
|
},
|
|
921
921
|
"names": [],
|
|
922
922
|
"idHints": [],
|
|
@@ -929,7 +929,7 @@
|
|
|
929
929
|
"auxiliaryFiles": [
|
|
930
930
|
"5117.js.map"
|
|
931
931
|
],
|
|
932
|
-
"hash": "
|
|
932
|
+
"hash": "447f4bdb09504066",
|
|
933
933
|
"childrenByOrder": {}
|
|
934
934
|
},
|
|
935
935
|
{
|
|
@@ -1356,9 +1356,9 @@
|
|
|
1356
1356
|
"initial": false,
|
|
1357
1357
|
"entry": false,
|
|
1358
1358
|
"reason": "split chunk (cache group: default)",
|
|
1359
|
-
"size":
|
|
1359
|
+
"size": 43571,
|
|
1360
1360
|
"sizes": {
|
|
1361
|
-
"javascript":
|
|
1361
|
+
"javascript": 43571
|
|
1362
1362
|
},
|
|
1363
1363
|
"names": [],
|
|
1364
1364
|
"idHints": [
|
|
@@ -1373,7 +1373,7 @@
|
|
|
1373
1373
|
"auxiliaryFiles": [
|
|
1374
1374
|
"7078.js.map"
|
|
1375
1375
|
],
|
|
1376
|
-
"hash": "
|
|
1376
|
+
"hash": "6eaf45df064e6ec6",
|
|
1377
1377
|
"childrenByOrder": {}
|
|
1378
1378
|
},
|
|
1379
1379
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"notes-overview-widget","component":"notesOverview","meta":{"fullWidth":false},"order":5},{"name":"sticky-notes-button","component":"stickyNotesButton","slot":"patient-info-slot","order":1}],"modals":[{"name":"delete-sticky-note-modal","component":"deleteStickyNoteModal"},{"name":"sticky-note-modal","component":"stickyNoteModal"}],"workspaces2":[{"name":"visit-notes-form-workspace","component":"visitNotesFormWorkspace","window":"visit-note"}],"workspaceWindows2":[{"name":"visit-note","icon":"visitNotesActionButton","group":"patient-chart","order":2}],"version":"12.3.5-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"notes-overview-widget","component":"notesOverview","meta":{"fullWidth":false},"order":5},{"name":"sticky-notes-button","component":"stickyNotesButton","slot":"patient-info-slot","order":1}],"modals":[{"name":"delete-sticky-note-modal","component":"deleteStickyNoteModal"},{"name":"sticky-note-modal","component":"stickyNoteModal"}],"workspaces2":[{"name":"visit-notes-form-workspace","component":"visitNotesFormWorkspace","window":"visit-note"}],"workspaceWindows2":[{"name":"visit-note","icon":"visitNotesActionButton","group":"patient-chart","order":2}],"version":"12.3.5-pre.12438"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-notes-app",
|
|
3
|
-
"version": "12.3.5-pre.
|
|
3
|
+
"version": "12.3.5-pre.12438",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Patient notes microfrontend for the OpenMRS SPA",
|
|
6
6
|
"browser": "dist/openmrs-esm-patient-notes-app.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@carbon/react": "^1.92.1",
|
|
57
|
-
"@openmrs/esm-patient-common-lib": "12.3.5-pre.
|
|
57
|
+
"@openmrs/esm-patient-common-lib": "12.3.5-pre.12438",
|
|
58
58
|
"openmrs": "next",
|
|
59
59
|
"vitest": "^4.1.2"
|
|
60
60
|
},
|
|
@@ -97,6 +97,9 @@ const createSchema = (t: TFunction, isRetrospectiveDataEntryEnabled: boolean) =>
|
|
|
97
97
|
|
|
98
98
|
const SEARCH_TIMEOUT_MS = 500;
|
|
99
99
|
|
|
100
|
+
/** Image formats browsers render, so a staged file always has a real thumbnail. */
|
|
101
|
+
const imageExtensions = new Set(['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp']);
|
|
102
|
+
|
|
100
103
|
export interface VisitNotesFormProps {
|
|
101
104
|
encounter?: Encounter;
|
|
102
105
|
formContext: 'creating' | 'editing';
|
|
@@ -139,7 +142,17 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
|
|
|
139
142
|
const [removedImages, setRemovedImages] = useState<string[]>([]);
|
|
140
143
|
const [saveError, setSaveError] = useState<string>();
|
|
141
144
|
const [error, setError] = useState<Error>(null);
|
|
142
|
-
const {
|
|
145
|
+
const {
|
|
146
|
+
allowedFileExtensions,
|
|
147
|
+
error: allowedFileExtensionsError,
|
|
148
|
+
isLoading: isLoadingAllowedFileExtensions,
|
|
149
|
+
} = useAllowedFileExtensions();
|
|
150
|
+
const allowedImageExtensions = useMemo(() => {
|
|
151
|
+
const extensions = allowedFileExtensions?.map((extension) => extension.trim().toLowerCase()).filter(Boolean);
|
|
152
|
+
return extensions?.length ? extensions.filter((extension) => imageExtensions.has(extension)) : [...imageExtensions];
|
|
153
|
+
}, [allowedFileExtensions]);
|
|
154
|
+
const isImageCaptureDisabled =
|
|
155
|
+
isLoadingAllowedFileExtensions || Boolean(allowedFileExtensionsError) || allowedImageExtensions.length === 0;
|
|
143
156
|
const isRetrospectiveDataEntryEnabled = useFeatureFlag('rde');
|
|
144
157
|
|
|
145
158
|
const visitNoteFormSchema = useMemo(
|
|
@@ -343,6 +356,10 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
|
|
|
343
356
|
};
|
|
344
357
|
|
|
345
358
|
const showImageCaptureModal = useCallback(() => {
|
|
359
|
+
if (isImageCaptureDisabled) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
|
|
346
363
|
const close = showModal('capture-photo-modal', {
|
|
347
364
|
saveFile: (file: UploadedFile) => {
|
|
348
365
|
if (file.capturedFromWebcam && !file.fileName.includes('.')) {
|
|
@@ -356,14 +373,13 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
|
|
|
356
373
|
closeModal: () => {
|
|
357
374
|
close();
|
|
358
375
|
},
|
|
359
|
-
allowedExtensions:
|
|
360
|
-
allowedFileExtensions && Array.isArray(allowedFileExtensions)
|
|
361
|
-
? allowedFileExtensions.filter((ext) => !/pdf/i.test(ext))
|
|
362
|
-
: [],
|
|
376
|
+
allowedExtensions: allowedImageExtensions,
|
|
363
377
|
collectDescription: true,
|
|
364
378
|
multipleFiles: true,
|
|
379
|
+
// Files are only staged here; they upload when the note is saved.
|
|
380
|
+
showUploadSnackbar: false,
|
|
365
381
|
});
|
|
366
|
-
}, [
|
|
382
|
+
}, [allowedImageExtensions, getValues, isImageCaptureDisabled, setValue]);
|
|
367
383
|
|
|
368
384
|
const handleRemoveImage = (index: number) => {
|
|
369
385
|
const updatedImages = [...currentImages];
|
|
@@ -804,12 +820,23 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
|
|
|
804
820
|
</p>
|
|
805
821
|
<Button
|
|
806
822
|
className={styles.uploadButton}
|
|
823
|
+
disabled={isImageCaptureDisabled}
|
|
807
824
|
kind={isTablet ? 'ghost' : 'tertiary'}
|
|
808
825
|
onClick={showImageCaptureModal}
|
|
809
826
|
renderIcon={(props) => <Add size={16} {...props} />}
|
|
810
827
|
>
|
|
811
828
|
{t('addImage', 'Add image')}
|
|
812
829
|
</Button>
|
|
830
|
+
{allowedFileExtensionsError && (
|
|
831
|
+
<InlineNotification
|
|
832
|
+
className={styles.savedImagesLoading}
|
|
833
|
+
kind="error"
|
|
834
|
+
lowContrast
|
|
835
|
+
hideCloseButton
|
|
836
|
+
title={t('allowedFileExtensionsLoadError', "Couldn't load the allowed image formats")}
|
|
837
|
+
subtitle={t('allowedFileExtensionsLoadErrorHint', 'Reload the page to add images to this note.')}
|
|
838
|
+
/>
|
|
839
|
+
)}
|
|
813
840
|
{isLoadingSavedImages && (
|
|
814
841
|
<InlineLoading
|
|
815
842
|
className={styles.savedImagesLoading}
|
|
@@ -881,7 +908,7 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
|
|
|
881
908
|
<img
|
|
882
909
|
className={styles.imgThumbnail}
|
|
883
910
|
src={image.base64Content}
|
|
884
|
-
alt={image.fileDescription
|
|
911
|
+
alt={image.fileDescription || image.fileName}
|
|
885
912
|
/>
|
|
886
913
|
</div>
|
|
887
914
|
<Button
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
type PatientWorkspace2DefinitionProps,
|
|
29
29
|
type PatientWorkspaceGroupProps,
|
|
30
|
+
useAllowedFileExtensions,
|
|
30
31
|
} from '@openmrs/esm-patient-common-lib';
|
|
31
32
|
import {
|
|
32
33
|
fetchDiagnosisConceptsByName,
|
|
@@ -78,7 +79,7 @@ function renderVisitNotesForm(
|
|
|
78
79
|
workspaceProps: { ...defaultProps.workspaceProps, ...workspaceProps },
|
|
79
80
|
groupProps: { ...defaultProps.groupProps, ...groupProps },
|
|
80
81
|
};
|
|
81
|
-
render(<VisitNotesFormWorkspace {...props} />);
|
|
82
|
+
return render(<VisitNotesFormWorkspace {...props} />);
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
function renderExportedVisitNotesForm(workspaceProps: Partial<ExportedVisitNotesFormWorkspaceProps> = {}) {
|
|
@@ -106,6 +107,14 @@ const mockedUseFeatureFlag = vi.mocked(useFeatureFlag);
|
|
|
106
107
|
|
|
107
108
|
vi.mock('lodash-es/debounce', () => vi.fn((fn) => fn));
|
|
108
109
|
|
|
110
|
+
vi.mock('@openmrs/esm-patient-common-lib', async () => {
|
|
111
|
+
const actual = await vi.importActual<Record<string, unknown>>('@openmrs/esm-patient-common-lib');
|
|
112
|
+
return {
|
|
113
|
+
...actual,
|
|
114
|
+
useAllowedFileExtensions: vi.fn(() => ({ allowedFileExtensions: ['png'], error: undefined, isLoading: false })),
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
|
|
109
118
|
vi.mock('./visit-notes.resource', () => ({
|
|
110
119
|
fetchDiagnosisConceptsByName: vi.fn(),
|
|
111
120
|
removeVisitNoteImage: vi.fn(),
|
|
@@ -854,6 +863,11 @@ const noSavedImages = { images: [], isLoading: false, error: null };
|
|
|
854
863
|
afterEach(() => {
|
|
855
864
|
mockUseConfig.mockReturnValue(defaultConfig);
|
|
856
865
|
vi.mocked(useVisitNoteImages).mockReturnValue(noSavedImages);
|
|
866
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({
|
|
867
|
+
allowedFileExtensions: ['png'],
|
|
868
|
+
error: undefined,
|
|
869
|
+
isLoading: false,
|
|
870
|
+
});
|
|
857
871
|
});
|
|
858
872
|
|
|
859
873
|
// The image tests save notes without a diagnosis, so the config must not require one.
|
|
@@ -1144,6 +1158,113 @@ test.each([false, true])(
|
|
|
1144
1158
|
expect(refreshNotes).toHaveBeenCalledTimes(1);
|
|
1145
1159
|
},
|
|
1146
1160
|
);
|
|
1161
|
+
test('only offers image formats to the picker and stages files without an upload toast', async () => {
|
|
1162
|
+
const user = userEvent.setup();
|
|
1163
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({
|
|
1164
|
+
allowedFileExtensions: ['jpeg', 'png', 'pdf', 'docx'],
|
|
1165
|
+
error: undefined,
|
|
1166
|
+
isLoading: false,
|
|
1167
|
+
});
|
|
1168
|
+
vi.mocked(showModal).mockReturnValue(vi.fn());
|
|
1169
|
+
renderVisitNotesForm();
|
|
1170
|
+
|
|
1171
|
+
await user.click(screen.getByRole('button', { name: /add image/i }));
|
|
1172
|
+
|
|
1173
|
+
expect(showModal).toHaveBeenCalledWith(
|
|
1174
|
+
'capture-photo-modal',
|
|
1175
|
+
expect.objectContaining({ allowedExtensions: ['jpeg', 'png'], showUploadSnackbar: false }),
|
|
1176
|
+
);
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
test('waits for the extension list before opening an image-only picker', async () => {
|
|
1180
|
+
const user = userEvent.setup();
|
|
1181
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({
|
|
1182
|
+
allowedFileExtensions: undefined,
|
|
1183
|
+
error: undefined,
|
|
1184
|
+
isLoading: true,
|
|
1185
|
+
});
|
|
1186
|
+
vi.mocked(showModal).mockReturnValue(vi.fn());
|
|
1187
|
+
const { rerender } = renderVisitNotesForm();
|
|
1188
|
+
|
|
1189
|
+
const addImage = screen.getByRole('button', { name: /add image/i });
|
|
1190
|
+
expect(addImage).toBeDisabled();
|
|
1191
|
+
await user.click(addImage);
|
|
1192
|
+
expect(showModal).not.toHaveBeenCalled();
|
|
1193
|
+
|
|
1194
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({
|
|
1195
|
+
allowedFileExtensions: ['png', 'pdf', 'docx'],
|
|
1196
|
+
error: undefined,
|
|
1197
|
+
isLoading: false,
|
|
1198
|
+
});
|
|
1199
|
+
rerender(<VisitNotesFormWorkspace {...defaultProps} />);
|
|
1200
|
+
|
|
1201
|
+
expect(addImage).toBeEnabled();
|
|
1202
|
+
await user.click(addImage);
|
|
1203
|
+
expect(showModal).toHaveBeenCalledExactlyOnceWith(
|
|
1204
|
+
'capture-photo-modal',
|
|
1205
|
+
expect.objectContaining({ allowedExtensions: ['png'], showUploadSnackbar: false }),
|
|
1206
|
+
);
|
|
1207
|
+
});
|
|
1208
|
+
|
|
1209
|
+
test.each([
|
|
1210
|
+
{ allowedFileExtensions: undefined, error: new Error('Offline') },
|
|
1211
|
+
{ allowedFileExtensions: ['png', 'pdf'], error: new Error('Offline') },
|
|
1212
|
+
])('does not open the picker when restrictions are unavailable: %o', async (result) => {
|
|
1213
|
+
const user = userEvent.setup();
|
|
1214
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({ ...result, isLoading: false });
|
|
1215
|
+
renderVisitNotesForm();
|
|
1216
|
+
|
|
1217
|
+
const addImage = screen.getByRole('button', { name: /add image/i });
|
|
1218
|
+
expect(addImage).toBeDisabled();
|
|
1219
|
+
await user.click(addImage);
|
|
1220
|
+
expect(showModal).not.toHaveBeenCalled();
|
|
1221
|
+
});
|
|
1222
|
+
|
|
1223
|
+
test.each([undefined, [], [''], [' ']].map((allowedFileExtensions) => ({ allowedFileExtensions })))(
|
|
1224
|
+
'offers supported images when the backend has no extension restrictions: %j',
|
|
1225
|
+
async ({ allowedFileExtensions }) => {
|
|
1226
|
+
const user = userEvent.setup();
|
|
1227
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({ allowedFileExtensions, error: undefined, isLoading: false });
|
|
1228
|
+
vi.mocked(showModal).mockReturnValue(vi.fn());
|
|
1229
|
+
renderVisitNotesForm();
|
|
1230
|
+
|
|
1231
|
+
const addImage = screen.getByRole('button', { name: /add image/i });
|
|
1232
|
+
expect(addImage).toBeEnabled();
|
|
1233
|
+
await user.click(addImage);
|
|
1234
|
+
expect(showModal).toHaveBeenCalledWith(
|
|
1235
|
+
'capture-photo-modal',
|
|
1236
|
+
expect.objectContaining({ allowedExtensions: ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'] }),
|
|
1237
|
+
);
|
|
1238
|
+
},
|
|
1239
|
+
);
|
|
1240
|
+
|
|
1241
|
+
test('disables image capture when the backend only allows documents', async () => {
|
|
1242
|
+
const user = userEvent.setup();
|
|
1243
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({
|
|
1244
|
+
allowedFileExtensions: ['pdf', 'docx'],
|
|
1245
|
+
error: undefined,
|
|
1246
|
+
isLoading: false,
|
|
1247
|
+
});
|
|
1248
|
+
renderVisitNotesForm();
|
|
1249
|
+
|
|
1250
|
+
const addImage = screen.getByRole('button', { name: /add image/i });
|
|
1251
|
+
expect(addImage).toBeDisabled();
|
|
1252
|
+
await user.click(addImage);
|
|
1253
|
+
expect(showModal).not.toHaveBeenCalled();
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
test('explains why image capture is disabled when loading restrictions fails', () => {
|
|
1257
|
+
vi.mocked(useAllowedFileExtensions).mockReturnValue({
|
|
1258
|
+
allowedFileExtensions: undefined,
|
|
1259
|
+
error: new Error('Offline'),
|
|
1260
|
+
isLoading: false,
|
|
1261
|
+
});
|
|
1262
|
+
renderVisitNotesForm();
|
|
1263
|
+
|
|
1264
|
+
expect(screen.getByRole('button', { name: /add image/i })).toBeDisabled();
|
|
1265
|
+
expect(screen.getByText("Couldn't load the allowed image formats")).toBeInTheDocument();
|
|
1266
|
+
expect(screen.getByText('Reload the page to add images to this note.')).toBeInTheDocument();
|
|
1267
|
+
});
|
|
1147
1268
|
|
|
1148
1269
|
test('keeps a saved image removal when a replacement upload fails and closes with a warning', async () => {
|
|
1149
1270
|
const user = userEvent.setup();
|
package/translations/en.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"add": "Add",
|
|
3
3
|
"addImage": "Add image",
|
|
4
4
|
"addVisitNote": "Add visit note",
|
|
5
|
+
"allowedFileExtensionsLoadError": "Couldn't load the allowed image formats",
|
|
6
|
+
"allowedFileExtensionsLoadErrorHint": "Reload the page to add images to this note.",
|
|
5
7
|
"clinicalNoteLabel": "Write your notes",
|
|
6
8
|
"clinicalNotePlaceholder": "Write any notes here",
|
|
7
9
|
"confirmDeleteStickyNote": "Confirm delete sticky note",
|