@openmrs/esm-patient-notes-app 12.3.5-pre.12384 → 12.3.5-pre.12386

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.
@@ -3,4 +3,4 @@
3
3
  │ 2883.js (872.775 KiB)
4
4
  
5
5
 
6
- Rspack compiled with 1 warning in 19.27 s
6
+ Rspack compiled with 1 warning in 21.67 s
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","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","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","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,i2F"}
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,mpG"}
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),r=a.n(i),o=a(222),l=a.n(o),m=a(3892),c=a(7807),d=a(1619),_=a(6195),u=a(4049),g=a(824),p=a(4916),v=a(5848),h=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",I="-esm-patient-notes__visit-notes-form__imgThumbnailItem___XkrUE",C="-esm-patient-notes__visit-notes-form__removeButton___O7iSI",w="-esm-patient-notes__visit-notes-form__button___tic-m",T="-esm-patient-notes__visit-notes-form__row___+Ncuq",P="-esm-patient-notes__visit-notes-form__errorNotification___K-xrU",V="-esm-patient-notes__visit-notes-form__tag___00erk";function A({name:e,control:t,labelText:a,placeholder:i,handleSearch:r,error:o,setIsSearching:l}){let m="tablet"===(0,E.useLayoutType)(),c=(0,s.useRef)(null);return(0,s.useEffect)(()=>{o&&c.current.focus()},[o]),n().createElement(g.xI,{name:e,control:t,render:({field:{value:t,onChange:s,onBlur:d},fieldState:_})=>n().createElement(n().Fragment,null,n().createElement(E.ResponsiveWrapper,null,n().createElement(p.vji,{ref:c,size:m?"lg":"md",id:e,labelText:a,className:o&&"-esm-patient-notes__visit-notes-form__diagnoserrorOutline___Qwd-n",placeholder:i,renderIcon:o&&(e=>n().createElement(f.BF,{fill:"red",...e})),onChange:t=>{l(!0),s(t),r(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})),_?.error?.message&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__errorMessage___p-5JH"},_?.error?.message))})}function x({fieldName:e,isDiagnosisNotSelected:t,isLoading:a,isSearching:i,onAddDiagnosis:r,searchResults:o,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(R,null):!i&&o?.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()}}},o.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:()=>{r(t,e),document.getElementById(e)?.focus()}},t.display)))):o?.length===0?n().createElement(E.ResponsiveWrapper,null,n().createElement(p.FAs,{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 R(){return n().createElement(n().Fragment,null,Array.from({length:5}).map((e,t)=>n().createElement(p.rrI,{key:t,className:"-esm-patient-notes__visit-notes-form__skeleton___Wp-mM"})))}let F=({encounter:e,formContext:t,patientUuid:a,patient:i,visitContext:o,closeWorkspace:f})=>{let R=!!("editing"===t&&e?.id),{t:F}=(0,c.useTranslation)(),L="tablet"===(0,E.useLayoutType)(),H=(0,E.useSession)(),{isPrimaryDiagnosisRequired:z,...B}=(0,E.useConfig)(),W=(0,s.useMemo)(()=>({patientUuid:a}),[a]),M=(0,s.useMemo)(()=>({patientUuid:a,patient:i}),[a,i]),{clinicianEncounterRole:O,encounterNoteTextConceptUuid:U,encounterTypeUuid:Z,formConceptUuid:$}=B.visitNoteConfig,[j,G]=(0,s.useState)(!1),[X,q]=(0,s.useState)(!1),[K,J]=(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),[er,eo]=(0,s.useState)([]),[el,em]=(0,s.useState)(),[ec,ed]=(0,s.useState)([]),[e_,eu]=(0,s.useState)(),[eg,ep]=(0,s.useState)(null),{allowedFileExtensions:ev}=(0,y.useAllowedFileExtensions)(),eh=(0,E.useFeatureFlag)("rde"),ef=(0,s.useMemo)(()=>_.z.object({noteDate:eh?_.z.date():_.z.date().optional(),primaryDiagnosisSearch:_.z.string(),secondaryDiagnosisSearch:_.z.string().optional(),clinicalNote:_.z.string().optional(),images:_.z.array(_.z.any()).optional(),removedImageIds:_.z.array(_.z.string())}),[F,eh]),eE=(0,s.useCallback)(async(e,t,a)=>{let s=await (0,u.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:eI,setValue:eC,watch:ew}=(0,g.mN)({mode:"onSubmit",resolver:eE,defaultValues:{images:[],removedImageIds:[],primaryDiagnosisSearch:"",noteDate:R?new Date(e.rawDatetime):new Date,clinicalNote:R?String(e?.obs?.find(e=>e.concept.uuid===U)?.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),eo([...s,...n])}catch(e){ep(Error(F("errorTransformingDiagnoses","Error transforming diagnoses"))),(0,E.createErrorHandler)()}},[e,a,F]);let eT=ew("images"),eP=ew("removedImageIds"),{images:eV,isLoading:eA,error:ex}=(0,N.Vm)(a,R?e.id:void 0),{mutateVisitNotes:eR}=(0,N.aw)(a),{mutate:eF}=(0,d.useSWRConfig)(),eL=(0,s.useCallback)(()=>eF(e=>"string"==typeof e&&e.startsWith(`${E.restBaseUrl}/attachment`)),[eF]),eH=H?.sessionLocation?.uuid,ez=H?.currentProvider?.uuid,eB=(0,s.useMemo)(()=>(0,m.A)((e,t)=>{ey("primaryDiagnosisSearch"),e&&("primaryDiagnosisSearch"===t?G(!0):"secondaryDiagnosisSearch"===t&&q(!0),(0,N.ph)(e,B.diagnosisConceptClass).then(e=>{"primaryDiagnosisSearch"===t?(es(e),G(!1)):"secondaryDiagnosisSearch"===t&&(ei(e),q(!1))}).catch(e=>{ep(e),(0,E.createErrorHandler)()}))},500),[B.diagnosisConceptClass,ey]),eW=(0,s.useCallback)(e=>{let t=ew(e);t&&eB(t,e),J(!1)},[eB,ew]),eM=(0,s.useCallback)(e=>({certainty:"PROVISIONAL",display:e.display,diagnosis:{coded:e.uuid},patient:a,rank:2}),[a]),eO=(0,s.useCallback)((e,t)=>{let a=eM(e);"primaryDiagnosisSearch"===t?(a.rank=1,eC("primaryDiagnosisSearch",""),es([]),Y(e=>[...e,a]),ey("primaryDiagnosisSearch")):"secondaryDiagnosisSearch"===t&&(eC("secondaryDiagnosisSearch",""),ei([]),et(e=>[...e,a])),eo(e=>[...e,a])},[eM,eC,ey]),eU=(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)),eo(er.filter(t=>t.diagnosis.coded!==e.diagnosis.coded))},[er,Q,ee]),eZ=e=>{let t=Q.some(t=>e.uuid===t.diagnosis.coded),a=ee.some(t=>e.uuid===t.diagnosis.coded);return!t&&!a},e$=(0,s.useCallback)(()=>{let e=(0,E.showModal)("capture-photo-modal",{saveFile:t=>(t.capturedFromWebcam&&!t.fileName.includes(".")&&(t.fileName=`${t.fileName}.png`),eC("images",[...eI("images"),t],{shouldDirty:!0}),e(),Promise.resolve()),closeModal:()=>{e()},allowedExtensions:ev&&Array.isArray(ev)?ev.filter(e=>!/pdf/i.test(e)):[],collectDescription:!0,multipleFiles:!0})},[ev,eI,eC]),ej=(0,s.useCallback)(t=>{let{noteDate:s,clinicalNote:n,images:i,removedImageIds:r}=t;if(eu(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===U),_={encounterDatetime:m?.format(),form:$,patient:a,location:eH,encounterProviders:[{encounterRole:O,provider:ez}],encounterType:Z,obs:n?[{concept:{uuid:U,display:""},value:n,...d&&{uuid:d.uuid}}]:[],...!R&&o?.uuid&&{visit:o.uuid}},u=new AbortController;return Promise.resolve().then(async()=>{let t=!1,s=!1;try{for(let e of r)await (0,N.XH)(e),t=!0,ed(t=>[...t,e]),eC("removedImageIds",eI("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));(!R||n||Object.keys(eb).some(e=>"removedImageIds"!==e))&&(s=!0,await (R?(0,N.HE)(u,e.id,_):(0,N.v_)(u,_)).then(t=>{if(201===t.status||200===t.status){let a=e?.id||t.data.uuid;return R&&e?.diagnoses?.length?Promise.all(e.diagnoses.map(e=>(0,N.k7)(u,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)(u,s)})).then(()=>e)).then(e=>i?.length?Promise.all(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)})):Promise.resolve([])))}finally{(t||s)&&((0,y.invalidateVisitAndEncounterData)(eF,a),eR(),(t||s&&i?.length)&&eL())}}).then(()=>{f({discardUnsavedChanges:!0}),(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=>{eu(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,eI,eC,o?.uuid,O,f,er,e?.diagnoses,e?.id,e?.obs,U,Z,$,eF,R,z,eH,eL,eR,a,ez,Q.length,F]),eG=Object.keys(eb).length>0;return n().createElement(E.Workspace2,{title:R?F("editVisitNote","Edit visit note"):F("addVisitNote","Add visit note"),hasUnsavedChanges:eG},n().createElement(p.lVW,{className:"-esm-patient-notes__visit-notes-form__form___WXW3i",onSubmit:ek(ej,e=>console.error(e))},n().createElement(E.ExtensionSlot,{name:"visit-context-header-slot",state:W}),L&&n().createElement(p.fI1,{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:M})),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__formContainer___INxGb"},n().createElement(p.BJc,{gap:2},L?n().createElement("h2",{className:"-esm-patient-notes__visit-notes-form__heading___ZDibC"},R?F("editVisitNote","Edit visit note"):F("addVisitNote","Add visit note")):null,eh&&n().createElement(p.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("date","Date"))),n().createElement(p.VPZ,{sm:3},n().createElement(g.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:R,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.vwO,{className:V,filter:!0,key:e.diagnosis.coded,onClose:()=>eU(e,"primaryInputSearch"),type:"red"},e.display)),ee.map(e=>n().createElement(p.vwO,{className:V,filter:!0,key:e.diagnosis.coded,onClose:()=>eU(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.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("primaryDiagnosis","Primary diagnosis"))),n().createElement(p.VPZ,{sm:3},n().createElement(p.gE_,{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:eW,error:eS?.primaryDiagnosisSearch,setIsSearching:J}),eg?n().createElement(p.jeF,{className:P,lowContrast:!0,title:F("error","Error"),subtitle:F("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>ep(null)}):null,n().createElement(x,{fieldName:"primaryDiagnosisSearch",isDiagnosisNotSelected:eZ,isLoading:j,isSearching:K,onAddDiagnosis:eO,searchResults:ea,t:F,value:ew("primaryDiagnosisSearch")})))),n().createElement(p.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("secondaryDiagnosis","Secondary diagnosis"))),n().createElement(p.VPZ,{sm:3},n().createElement(p.gE_,{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:eW,setIsSearching:J}),eg?n().createElement(p.jeF,{className:P,lowContrast:!0,title:F("error","Error"),subtitle:F("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>ep(null)}):null,n().createElement(x,{fieldName:"secondaryDiagnosisSearch",isDiagnosisNotSelected:eZ,isLoading:X,isSearching:K,onAddDiagnosis:eO,searchResults:en,t:F,value:ew("secondaryDiagnosisSearch")})))),n().createElement(p.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("note","Note"))),n().createElement(p.VPZ,{sm:3},n().createElement(g.xI,{name:"clinicalNote",control:eN,render:({field:{onChange:e,onBlur:t,value:a}})=>n().createElement(E.ResponsiveWrapper,null,n().createElement(p.fs1,{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.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("image","Image"))),n().createElement(p.VPZ,{sm:3},n().createElement(p.gE_,{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.$nd,{className:"-esm-patient-notes__visit-notes-form__uploadButton___bTplo",kind:L?"ghost":"tertiary",onClick:e$,renderIcon:e=>n().createElement(v.OM,{size:16,...e})},F("addImage","Add image")),eA&&n().createElement(p.OuH,{className:k,description:F("loadingSavedImages","Loading saved images")+"..."}),ex&&n().createElement(p.jeF,{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"},eV.filter(e=>!ec.includes(e.id)).map(e=>{let t=eP.includes(e.id),a=e.description||e.filename||F("savedImage","Saved image");return n().createElement("div",{key:e.id,className:I},n().createElement("div",{className:b},n().createElement("img",{className:r()(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.$nd,{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":C,onClick:()=>eC("removedImageIds",t?eP.filter(t=>t!==e.id):[...eP,e.id],{shouldDirty:!0})},t?F("undo","Undo"):n().createElement(h.bm,{size:16})))}),eT?.map((e,t)=>n().createElement("div",{key:t,className:I},n().createElement("div",{className:b},n().createElement("img",{className:D,src:e.base64Content,alt:e.fileDescription??e.fileName})),n().createElement(p.$nd,{kind:"secondary",size:"sm","aria-label":F("removeImage","Remove image: {{name}}",{name:e.fileDescription?.trim()||e.fileName?.trim()||t+1}),className:C,onClick:()=>{let e;(e=[...eT]).splice(t,1),eC("images",e,{shouldDirty:!0}),(0,E.showSnackbar)({title:F("imageRemoved","Image removed"),kind:"success",isLowContrast:!0})}},n().createElement(h.bm,{size:16}))))),eP.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."))))))),e_&&n().createElement(p.jeF,{kind:"error",lowContrast:!0,hideCloseButton:!0,title:F("visitNoteSaveError","Error saving visit note"),subtitle:e_}),n().createElement(p.Te$,{className:r()({"-esm-patient-notes__visit-notes-form__tablet___R5OWW":L,"-esm-patient-notes__visit-notes-form__desktop___q-E7d":!L})},n().createElement(p.$nd,{className:w,kind:"secondary",onClick:()=>f()},F("discard","Discard")),n().createElement(p.$nd,{className:w,kind:"primary",disabled:!eG||eD,type:"submit"},eD?n().createElement(p.OuH,{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:()=>F});var s=a(5399),n=a.n(s),i=a(3373),r=a.n(i),o=a(222),l=a.n(o),m=a(3892),c=a(7807),d=a(1619),_=a(6195),g=a(4049),u=a(824),p=a(4916),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",I="-esm-patient-notes__visit-notes-form__imgThumbnailItem___XkrUE",C="-esm-patient-notes__visit-notes-form__removeButton___O7iSI",w="-esm-patient-notes__visit-notes-form__button___tic-m",T="-esm-patient-notes__visit-notes-form__row___+Ncuq",P="-esm-patient-notes__visit-notes-form__errorNotification___K-xrU",V="-esm-patient-notes__visit-notes-form__tag___00erk";function A({name:e,control:t,labelText:a,placeholder:i,handleSearch:r,error:o,setIsSearching:l}){let m="tablet"===(0,E.useLayoutType)(),c=(0,s.useRef)(null);return(0,s.useEffect)(()=>{o&&c.current.focus()},[o]),n().createElement(u.xI,{name:e,control:t,render:({field:{value:t,onChange:s,onBlur:d},fieldState:_})=>n().createElement(n().Fragment,null,n().createElement(E.ResponsiveWrapper,null,n().createElement(p.vji,{ref:c,size:m?"lg":"md",id:e,labelText:a,className:o&&"-esm-patient-notes__visit-notes-form__diagnoserrorOutline___Qwd-n",placeholder:i,renderIcon:o&&(e=>n().createElement(f.BF,{fill:"red",...e})),onChange:t=>{l(!0),s(t),r(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})),_?.error?.message&&n().createElement("p",{className:"-esm-patient-notes__visit-notes-form__errorMessage___p-5JH"},_?.error?.message))})}function x({fieldName:e,isDiagnosisNotSelected:t,isLoading:a,isSearching:i,onAddDiagnosis:r,searchResults:o,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(R,null):!i&&o?.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()}}},o.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:()=>{r(t,e),document.getElementById(e)?.focus()}},t.display)))):o?.length===0?n().createElement(E.ResponsiveWrapper,null,n().createElement(p.FAs,{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 R(){return n().createElement(n().Fragment,null,Array.from({length:5}).map((e,t)=>n().createElement(p.rrI,{key:t,className:"-esm-patient-notes__visit-notes-form__skeleton___Wp-mM"})))}let F=({encounter:e,formContext:t,patientUuid:a,patient:i,visitContext:o,closeWorkspace:f})=>{let R=!!("editing"===t&&e?.id),{t:F}=(0,c.useTranslation)(),B="tablet"===(0,E.useLayoutType)(),L=(0,E.useSession)(),{isPrimaryDiagnosisRequired:H,...z}=(0,E.useConfig)(),W=(0,s.useMemo)(()=>({patientUuid:a}),[a]),M=(0,s.useMemo)(()=>({patientUuid:a,patient:i}),[a,i]),{clinicianEncounterRole:O,encounterNoteTextConceptUuid:U,encounterTypeUuid:j,formConceptUuid:Z}=z.visitNoteConfig,[$,G]=(0,s.useState)(!1),[X,q]=(0,s.useState)(!1),[K,J]=(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),[er,eo]=(0,s.useState)([]),[el,em]=(0,s.useState)(),[ec,ed]=(0,s.useState)([]),[e_,eg]=(0,s.useState)(),[eu,ep]=(0,s.useState)(null),{allowedFileExtensions:eh}=(0,y.useAllowedFileExtensions)(),ev=(0,E.useFeatureFlag)("rde"),ef=(0,s.useMemo)(()=>_.z.object({noteDate:ev?_.z.date():_.z.date().optional(),primaryDiagnosisSearch:_.z.string(),secondaryDiagnosisSearch:_.z.string().optional(),clinicalNote:_.z.string().optional(),images:_.z.array(_.z.any()).optional(),removedImageIds:_.z.array(_.z.string())}),[F,ev]),eE=(0,s.useCallback)(async(e,t,a)=>{let s=await (0,g.u)(ef)(e,t,a);return H&&0===Q.length?{...s,errors:{...s.errors,primaryDiagnosisSearch:{type:"custom",message:F("primaryDiagnosisRequired","Choose at least one primary diagnosis")}}}:s},[ef,H,Q,F]),{clearErrors:ey,control:eN,formState:{errors:eS,dirtyFields:eb,isSubmitting:eD},handleSubmit:ek,getValues:eI,setValue:eC,watch:ew}=(0,u.mN)({mode:"onSubmit",resolver:eE,defaultValues:{images:[],removedImageIds:[],primaryDiagnosisSearch:"",noteDate:R?new Date(e.rawDatetime):new Date,clinicalNote:R?String(e?.obs?.find(e=>e.concept.uuid===U)?.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),eo([...s,...n])}catch(e){ep(Error(F("errorTransformingDiagnoses","Error transforming diagnoses"))),(0,E.createErrorHandler)()}},[e,a,F]);let eT=ew("images"),eP=ew("removedImageIds"),{images:eV,isLoading:eA,error:ex}=(0,N.Vm)(a,R?e.id:void 0),{mutateVisitNotes:eR}=(0,N.aw)(a),{mutate:eF}=(0,d.useSWRConfig)(),eB=(0,s.useCallback)(()=>eF(e=>"string"==typeof e&&e.startsWith(`${E.restBaseUrl}/attachment`)),[eF]),eL=L?.sessionLocation?.uuid,eH=L?.currentProvider?.uuid,ez=(0,s.useMemo)(()=>(0,m.A)((e,t)=>{ey("primaryDiagnosisSearch"),e&&("primaryDiagnosisSearch"===t?G(!0):"secondaryDiagnosisSearch"===t&&q(!0),(0,N.ph)(e,z.diagnosisConceptClass).then(e=>{"primaryDiagnosisSearch"===t?(es(e),G(!1)):"secondaryDiagnosisSearch"===t&&(ei(e),q(!1))}).catch(e=>{ep(e),(0,E.createErrorHandler)()}))},500),[z.diagnosisConceptClass,ey]),eW=(0,s.useCallback)(e=>{let t=ew(e);t&&ez(t,e),J(!1)},[ez,ew]),eM=(0,s.useCallback)(e=>({certainty:"PROVISIONAL",display:e.display,diagnosis:{coded:e.uuid},patient:a,rank:2}),[a]),eO=(0,s.useCallback)((e,t)=>{let a=eM(e);"primaryDiagnosisSearch"===t?(a.rank=1,eC("primaryDiagnosisSearch",""),es([]),Y(e=>[...e,a]),ey("primaryDiagnosisSearch")):"secondaryDiagnosisSearch"===t&&(eC("secondaryDiagnosisSearch",""),ei([]),et(e=>[...e,a])),eo(e=>[...e,a])},[eM,eC,ey]),eU=(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)),eo(er.filter(t=>t.diagnosis.coded!==e.diagnosis.coded))},[er,Q,ee]),ej=e=>{let t=Q.some(t=>e.uuid===t.diagnosis.coded),a=ee.some(t=>e.uuid===t.diagnosis.coded);return!t&&!a},eZ=(0,s.useCallback)(()=>{let e=(0,E.showModal)("capture-photo-modal",{saveFile:t=>(t.capturedFromWebcam&&!t.fileName.includes(".")&&(t.fileName=`${t.fileName}.png`),eC("images",[...eI("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,eI,eC]),e$=(0,s.useCallback)(t=>{let{noteDate:s,clinicalNote:n,images:i,removedImageIds:r}=t;if(eg(void 0),H&&!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===U),_={encounterDatetime:m?.format(),form:Z,patient:a,location:eL,encounterProviders:[{encounterRole:O,provider:eH}],encounterType:j,obs:n?[{concept:{uuid:U,display:""},value:n,...d&&{uuid:d.uuid}}]:[],...!R&&o?.uuid&&{visit:o.uuid}},g=new AbortController;return Promise.resolve().then(async()=>{let t=!1,s=!1;try{for(let e of r)await (0,N.XH)(e),t=!0,ed(t=>[...t,e]),eC("removedImageIds",eI("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(!R||n||Object.keys(eb).some(e=>"removedImageIds"!==e))return s=!0,await (R?(0,N.HE)(g,e.id,_):(0,N.v_)(g,_)).then(t=>{if(201===t.status||200===t.status){let a=e?.id||t.data.uuid;return R&&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)(eF,a),eR(),(t||s&&i?.length)&&eB())}}).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,eI,eC,o?.uuid,O,f,er,e?.diagnoses,e?.id,e?.obs,U,j,Z,eF,R,H,eL,eB,eR,a,eH,Q.length,F]),eG=Object.keys(eb).length>0;return n().createElement(E.Workspace2,{title:R?F("editVisitNote","Edit visit note"):F("addVisitNote","Add visit note"),hasUnsavedChanges:eG},n().createElement(p.lVW,{className:"-esm-patient-notes__visit-notes-form__form___WXW3i",onSubmit:ek(e$,e=>console.error(e))},n().createElement(E.ExtensionSlot,{name:"visit-context-header-slot",state:W}),B&&n().createElement(p.fI1,{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:M})),n().createElement("div",{className:"-esm-patient-notes__visit-notes-form__formContainer___INxGb"},n().createElement(p.BJc,{gap:2},B?n().createElement("h2",{className:"-esm-patient-notes__visit-notes-form__heading___ZDibC"},R?F("editVisitNote","Edit visit note"):F("addVisitNote","Add visit note")):null,ev&&n().createElement(p.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("date","Date"))),n().createElement(p.VPZ,{sm:3},n().createElement(u.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:R,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.vwO,{className:V,filter:!0,key:e.diagnosis.coded,onClose:()=>eU(e,"primaryInputSearch"),type:"red"},e.display)),ee.map(e=>n().createElement(p.vwO,{className:V,filter:!0,key:e.diagnosis.coded,onClose:()=>eU(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.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("primaryDiagnosis","Primary diagnosis"))),n().createElement(p.VPZ,{sm:3},n().createElement(p.gE_,{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:eW,error:eS?.primaryDiagnosisSearch,setIsSearching:J}),eu?n().createElement(p.jeF,{className:P,lowContrast:!0,title:F("error","Error"),subtitle:F("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>ep(null)}):null,n().createElement(x,{fieldName:"primaryDiagnosisSearch",isDiagnosisNotSelected:ej,isLoading:$,isSearching:K,onAddDiagnosis:eO,searchResults:ea,t:F,value:ew("primaryDiagnosisSearch")})))),n().createElement(p.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("secondaryDiagnosis","Secondary diagnosis"))),n().createElement(p.VPZ,{sm:3},n().createElement(p.gE_,{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:eW,setIsSearching:J}),eu?n().createElement(p.jeF,{className:P,lowContrast:!0,title:F("error","Error"),subtitle:F("errorFetchingConcepts","There was a problem fetching concepts")+".",onClose:()=>ep(null)}):null,n().createElement(x,{fieldName:"secondaryDiagnosisSearch",isDiagnosisNotSelected:ej,isLoading:X,isSearching:K,onAddDiagnosis:eO,searchResults:en,t:F,value:ew("secondaryDiagnosisSearch")})))),n().createElement(p.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("note","Note"))),n().createElement(p.VPZ,{sm:3},n().createElement(u.xI,{name:"clinicalNote",control:eN,render:({field:{onChange:e,onBlur:t,value:a}})=>n().createElement(E.ResponsiveWrapper,null,n().createElement(p.fs1,{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.fI1,{className:T},n().createElement(p.VPZ,{sm:1},n().createElement("span",{className:S},F("image","Image"))),n().createElement(p.VPZ,{sm:3},n().createElement(p.gE_,{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.$nd,{className:"-esm-patient-notes__visit-notes-form__uploadButton___bTplo",kind:B?"ghost":"tertiary",onClick:eZ,renderIcon:e=>n().createElement(h.OM,{size:16,...e})},F("addImage","Add image")),eA&&n().createElement(p.OuH,{className:k,description:F("loadingSavedImages","Loading saved images")+"..."}),ex&&n().createElement(p.jeF,{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"},eV.filter(e=>!ec.includes(e.id)).map(e=>{let t=eP.includes(e.id),a=e.description||e.filename||F("savedImage","Saved image");return n().createElement("div",{key:e.id,className:I},n().createElement("div",{className:b},n().createElement("img",{className:r()(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.$nd,{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":C,onClick:()=>eC("removedImageIds",t?eP.filter(t=>t!==e.id):[...eP,e.id],{shouldDirty:!0})},t?F("undo","Undo"):n().createElement(v.bm,{size:16})))}),eT?.map((e,t)=>n().createElement("div",{key:t,className:I},n().createElement("div",{className:b},n().createElement("img",{className:D,src:e.base64Content,alt:e.fileDescription??e.fileName})),n().createElement(p.$nd,{kind:"secondary",size:"sm","aria-label":F("removeImage","Remove image: {{name}}",{name:e.fileDescription?.trim()||e.fileName?.trim()||t+1}),className:C,onClick:()=>{let e;(e=[...eT]).splice(t,1),eC("images",e,{shouldDirty:!0}),(0,E.showSnackbar)({title:F("imageRemoved","Image removed"),kind:"success",isLowContrast:!0})}},n().createElement(v.bm,{size:16}))))),eP.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."))))))),e_&&n().createElement(p.jeF,{kind:"error",lowContrast:!0,hideCloseButton:!0,title:F("visitNoteSaveError","Error saving visit note"),subtitle:e_}),n().createElement(p.Te$,{className:r()({"-esm-patient-notes__visit-notes-form__tablet___R5OWW":B,"-esm-patient-notes__visit-notes-form__desktop___q-E7d":!B})},n().createElement(p.$nd,{className:w,kind:"secondary",onClick:()=>f()},F("discard","Discard")),n().createElement(p.$nd,{className:w,kind:"primary",disabled:!eG||eD,type:"submit"},eD?n().createElement(p.OuH,{className:"-esm-patient-notes__visit-notes-form__spinner___nX4VV",description:F("saving","Saving")+"..."}):n().createElement("span",null,F("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","showSnackbar","hasUserUnsavedChanges","Workspace2","Form","console","ExtensionSlot","Row","Stack","Column","OpenmrsDatePicker","Tag","FormGroup","InlineNotification","TextArea","Math","Button","Add","InlineLoading","isMarkedForRemoval","classnames","Close","updatedImages","ButtonSet"],"mappings":"wWACA,MAAgG,8DAA8iB,wEAAqF,+DAAkF,qEAA0K,mEAAgF,+DAAsE,yDAA+lB,sDAAkT,oEAAwE,oDCg5B9kE,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,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u6E,2D,ECy2Bv6ExF,EAAE,uBAAwB,kEAQxCsD,IACC,kBAACqH,EAAAA,GAAkBA,CAAAA,CACjB,KAAK,QACL,eACA,mBACA,MAAO3K,EAAE,qBAAsB,2BAC/B,SAAUsD,E,GAGd,kBAAC+H,EAAAA,GAASA,CAAAA,CAAC,UAAWH,IAAW,CD13B8sC,uDC03B3rC5M,ED13B4vC,wDC03BhuC,CAACA,CAAS,E,EACxF,kBAACwM,EAAAA,GAAMA,CAAAA,CAAC,SAAS,GAAiB,KAAK,YAAY,QAAS,IAAM3J,G,EAC/DnB,EAAE,UAAW,YAEhB,kBAAC8K,EAAAA,GAAMA,CAAAA,CACL,SAAS,GACT,KAAK,UACL,SAAU,CAACd,IAAyBxF,GACpC,KAAK,Q,EAEJA,GACC,kBAACwG,EAAAA,GAAaA,CAAAA,CAAC,UDr4BypC,wDCq4B9nC,YAAahL,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":["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","isMarkedFor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AO9K,EAAE,qBAAsB,2BAC/B,SAAUsD,E,GAGd,kBAACkI,EAAAA,GAASA,CAAAA,CAAC,UAAWH,IAAW,CDt5B8sC,uDCs5B3rC/M,EDt5B4vC,wDCs5BhuC,CAACA,CAAS,E,EACxF,kBAAC2M,EAAAA,GAAMA,CAAAA,CAAC,SAAS,GAAiB,KAAK,YAAY,QAAS,IAAM9J,G,EAC/DnB,EAAE,UAAW,YAEhB,kBAACiL,EAAAA,GAAMA,CAAAA,CACL,SAAS,GACT,KAAK,UACL,SAAU,CAACd,IAAyB3F,GACpC,KAAK,Q,EAEJA,GACC,kBAAC2G,EAAAA,GAAaA,CAAAA,CAAC,UDj6BypC,wDCi6B9nC,YAAanL,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.12384";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.12386";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!/^(3543|4006|4957|5059|5123|7518|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:"@openmrs/esm-framework",version:"10.0.1-pre.5498",factory:()=>Promise.all([s.e("689"),s.e("5996"),s.e("2883"),s.e("8652"),s.e("3543"),s.e("5059"),s.e("7518"),s.e("5123")]).then(()=>()=>s(2158)),eager:0,singleton:1,requiredVersion:"10.x",strictVersion:0},{name:"@openmrs/esm-patient-common-lib",version:"12.3.5-pre.12384",factory:()=>Promise.all([s.e("689"),s.e("5996"),s.e("8652"),s.e("3543"),s.e("7518"),s.e("648"),s.e("4006"),s.e("9116")]).then(()=>()=>s(6059)),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:{8652:["5399"],4006:["2293"],5123:["3432","682","4354"],8800:["3040"],7518:["7807","1619"],5059:["222"],3543:["5571","3660"]},moduleIdToConsumeDataMapping:{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("2883"),s.e("3543"),s.e("5059"),s.e("5123")]).then(()=>()=>s(2158))},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("648"),s.e("4957")]).then(()=>()=>s(6059))},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:()=>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))},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))},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))}},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,2883: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("689"),s.e("5996"),s.e("7682"),s.e("8652"),s.e("7518"),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(/^(3543|4006|4957|5059|5123|7518|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!/^(3543|4006|4957|5059|5123|7518|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:"@openmrs/esm-framework",version:"10.0.1-pre.5498",factory:()=>Promise.all([s.e("689"),s.e("5996"),s.e("2883"),s.e("8652"),s.e("3543"),s.e("5059"),s.e("7518"),s.e("5123")]).then(()=>()=>s(2158)),eager:0,singleton:1,requiredVersion:"10.x",strictVersion:0},{name:"@openmrs/esm-patient-common-lib",version:"12.3.5-pre.12386",factory:()=>Promise.all([s.e("689"),s.e("5996"),s.e("8652"),s.e("3543"),s.e("7518"),s.e("648"),s.e("4006"),s.e("9116")]).then(()=>()=>s(6059)),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:{8652:["5399"],4006:["2293"],5123:["3432","682","4354"],8800:["3040"],7518:["7807","1619"],5059:["222"],3543:["5571","3660"]},moduleIdToConsumeDataMapping:{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("2883"),s.e("3543"),s.e("5059"),s.e("5123")]).then(()=>()=>s(2158))},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("648"),s.e("4957")]).then(()=>()=>s(6059))},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:()=>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))},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))},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))}},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,2883: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("689"),s.e("5996"),s.e("7682"),s.e("8652"),s.e("7518"),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(/^(3543|4006|4957|5059|5123|7518|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()})();
@@ -214,7 +214,7 @@
214
214
  "auxiliaryFiles": [
215
215
  "openmrs-esm-patient-notes-app.js.map"
216
216
  ],
217
- "hash": "5247ef9d17920ed5",
217
+ "hash": "735c60a1733c7aea",
218
218
  "childrenByOrder": {}
219
219
  },
220
220
  {
@@ -788,9 +788,9 @@
788
788
  "rendered": true,
789
789
  "initial": false,
790
790
  "entry": false,
791
- "size": 2909,
791
+ "size": 3215,
792
792
  "sizes": {
793
- "javascript": 2909
793
+ "javascript": 3215
794
794
  },
795
795
  "names": [],
796
796
  "idHints": [],
@@ -803,7 +803,7 @@
803
803
  "auxiliaryFiles": [
804
804
  "5117.js.map"
805
805
  ],
806
- "hash": "5689f65339181207",
806
+ "hash": "7bb5817d6494fa17",
807
807
  "childrenByOrder": {}
808
808
  },
809
809
  {
@@ -1282,9 +1282,9 @@
1282
1282
  "initial": false,
1283
1283
  "entry": false,
1284
1284
  "reason": "split chunk (cache group: default)",
1285
- "size": 40841,
1285
+ "size": 42221,
1286
1286
  "sizes": {
1287
- "javascript": 40841
1287
+ "javascript": 42221
1288
1288
  },
1289
1289
  "names": [],
1290
1290
  "idHints": [
@@ -1299,7 +1299,7 @@
1299
1299
  "auxiliaryFiles": [
1300
1300
  "7078.js.map"
1301
1301
  ],
1302
- "hash": "3785f01edb8f47b5",
1302
+ "hash": "d7f54ab89f61a38d",
1303
1303
  "childrenByOrder": {}
1304
1304
  },
1305
1305
  {
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.12384"}
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.12386"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-notes-app",
3
- "version": "12.3.5-pre.12384",
3
+ "version": "12.3.5-pre.12386",
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",
@@ -52,7 +52,7 @@
52
52
  "swr": "2.x"
53
53
  },
54
54
  "devDependencies": {
55
- "@openmrs/esm-patient-common-lib": "12.3.5-pre.12384",
55
+ "@openmrs/esm-patient-common-lib": "12.3.5-pre.12386",
56
56
  "openmrs": "next",
57
57
  "vitest": "^4.1.2"
58
58
  },
@@ -466,22 +466,27 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
466
466
  .then((encounterUuid) => {
467
467
  // Only images added in this session are in the form state. Images already saved on the
468
468
  // note are shown from the server and never re-uploaded.
469
- if (images?.length) {
470
- return Promise.all(
471
- images.map((image) => {
472
- const imageToUpload: UploadedFile = {
473
- base64Content: image.base64Content,
474
- file: image.file,
475
- fileName: image.fileName,
476
- fileType: image.fileType,
477
- fileDescription: image.fileDescription || '',
478
- };
479
- return createAttachment(patientUuid, imageToUpload, encounterUuid);
480
- }),
481
- );
482
- } else {
483
- return Promise.resolve([]);
469
+ if (!images?.length) {
470
+ return [];
484
471
  }
472
+ // The note and its diagnoses are already saved by now, so one rejected image must not
473
+ // fail the whole save: every image that can upload does, and the rest are reported.
474
+ return Promise.allSettled(
475
+ images.map((image) => {
476
+ const imageToUpload: UploadedFile = {
477
+ base64Content: image.base64Content,
478
+ file: image.file,
479
+ fileName: image.fileName,
480
+ fileType: image.fileType,
481
+ fileDescription: image.fileDescription || '',
482
+ };
483
+ return createAttachment(patientUuid, imageToUpload, encounterUuid);
484
+ }),
485
+ ).then((results) =>
486
+ results.flatMap((result, index) =>
487
+ result.status === 'rejected' ? [{ image: images[index], reason: result.reason }] : [],
488
+ ),
489
+ );
485
490
  });
486
491
  };
487
492
  return Promise.resolve()
@@ -518,7 +523,7 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
518
523
  Object.keys(dirtyFields).some((field) => field !== 'removedImageIds')
519
524
  ) {
520
525
  noteSaveAttempted = true;
521
- await saveNote();
526
+ return await saveNote();
522
527
  }
523
528
  } finally {
524
529
  if (removedAny || noteSaveAttempted) {
@@ -530,9 +535,32 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({
530
535
  }
531
536
  }
532
537
  })
533
- .then(() => {
538
+ .then((failedUploads = []) => {
534
539
  closeWorkspace({ discardUnsavedChanges: true });
535
540
 
541
+ if (failedUploads.length) {
542
+ const [{ reason }] = failedUploads;
543
+ const names = failedUploads
544
+ .map(({ image }) => image.fileDescription?.trim() || image.fileName?.trim())
545
+ .filter(Boolean)
546
+ .join(', ');
547
+ showSnackbar({
548
+ isLowContrast: false,
549
+ kind: 'warning',
550
+ title: t('visitNoteSavedImagesFailed', 'Visit note saved, but {{count}} image was not uploaded', {
551
+ count: failedUploads.length,
552
+ }),
553
+ subtitle: [names, reason?.responseBody?.error?.message ?? reason?.message]
554
+ .filter(Boolean)
555
+ .join(': ')
556
+ .concat(
557
+ ' ',
558
+ t('reAddImagesFromNote', 'Open the note to add it again.', { count: failedUploads.length }),
559
+ ),
560
+ });
561
+ return;
562
+ }
563
+
536
564
  showSnackbar({
537
565
  isLowContrast: true,
538
566
  subtitle: t('visitNoteNowVisible', 'It is now visible on the Visits page'),
@@ -969,6 +969,57 @@ test('tells the user when the saved images could not be loaded', () => {
969
969
  expect(screen.queryByText(/loading saved images/i)).not.toBeInTheDocument();
970
970
  });
971
971
 
972
+ test('saves the note and reports the images the server rejected instead of failing the whole save', async () => {
973
+ const user = userEvent.setup();
974
+ vi.mocked(showModal).mockReturnValue(vi.fn());
975
+ allowNotesWithoutDiagnosis();
976
+ mockSaveVisitNote.mockResolvedValueOnce({ status: 201, data: { uuid: 'new-note' } } as unknown as Awaited<
977
+ ReturnType<typeof saveVisitNote>
978
+ >);
979
+ vi.mocked(createAttachment)
980
+ .mockResolvedValueOnce({} as Awaited<ReturnType<typeof createAttachment>>)
981
+ .mockRejectedValueOnce({ responseBody: { error: { message: 'The file content type text/plain is not allowed' } } });
982
+ renderVisitNotesForm();
983
+
984
+ await addImage(user, newImage);
985
+ await addImage(user, { ...newImage, fileName: 'notes.png', fileDescription: 'Scanned notes' });
986
+ await user.click(screen.getByRole('button', { name: /save and close/i }));
987
+
988
+ await waitFor(() => expect(defaultProps.closeWorkspace).toHaveBeenCalled());
989
+ expect(mockSaveVisitNote).toHaveBeenCalledTimes(1);
990
+ expect(createAttachment).toHaveBeenCalledTimes(2);
991
+ expect(mockShowSnackbar).toHaveBeenCalledWith(
992
+ expect.objectContaining({
993
+ kind: 'warning',
994
+ title: 'Visit note saved, but 1 image was not uploaded',
995
+ subtitle: 'Scanned notes: The file content type text/plain is not allowed Open the note to add it again.',
996
+ }),
997
+ );
998
+ expect(mockShowSnackbar).not.toHaveBeenCalledWith(expect.objectContaining({ title: 'Error saving visit note' }));
999
+ });
1000
+
1001
+ test('still reports a failure to save the note itself as an error and keeps the form open', async () => {
1002
+ const user = userEvent.setup();
1003
+ allowNotesWithoutDiagnosis();
1004
+ mockSaveVisitNote.mockRejectedValueOnce({ responseBody: { error: { message: 'Encounter datetime is invalid' } } });
1005
+ renderVisitNotesForm();
1006
+
1007
+ await user.type(screen.getByRole('textbox', { name: /write your notes/i }), 'Some note');
1008
+ await user.click(screen.getByRole('button', { name: /save and close/i }));
1009
+
1010
+ await waitFor(() =>
1011
+ expect(mockShowSnackbar).toHaveBeenCalledWith(
1012
+ expect.objectContaining({
1013
+ kind: 'error',
1014
+ title: 'Error saving visit note',
1015
+ subtitle: 'Encounter datetime is invalid',
1016
+ }),
1017
+ ),
1018
+ );
1019
+ expect(defaultProps.closeWorkspace).not.toHaveBeenCalled();
1020
+ expect(createAttachment).not.toHaveBeenCalled();
1021
+ });
1022
+
972
1023
  function setupSavedImages() {
973
1024
  allowNotesWithoutDiagnosis();
974
1025
  vi.mocked(useVisitNoteImages).mockReturnValue({
@@ -1093,3 +1144,20 @@ test.each([false, true])(
1093
1144
  expect(refreshNotes).toHaveBeenCalledTimes(1);
1094
1145
  },
1095
1146
  );
1147
+
1148
+ test('keeps a saved image removal when a replacement upload fails and closes with a warning', async () => {
1149
+ const user = userEvent.setup();
1150
+ vi.mocked(showModal).mockReturnValue(vi.fn());
1151
+ setupSavedImages();
1152
+ mockUpdateVisitNote.mockResolvedValueOnce({ status: 200 } as Awaited<ReturnType<typeof updateVisitNote>>);
1153
+ vi.mocked(createAttachment).mockRejectedValueOnce(new Error('Upload rejected'));
1154
+ await user.click(screen.getByRole('button', { name: 'Remove image: front.png' }));
1155
+ await addImage(user, newImage);
1156
+ await user.click(screen.getByRole('button', { name: /save and close/i }));
1157
+ await waitFor(() => expect(defaultProps.closeWorkspace).toHaveBeenCalledWith({ discardUnsavedChanges: true }));
1158
+ expect(removeVisitNoteImage).toHaveBeenCalledExactlyOnceWith('att-1');
1159
+ expect(mockUpdateVisitNote).toHaveBeenCalledTimes(1);
1160
+ expect(createAttachment).toHaveBeenCalledTimes(1);
1161
+ expect(mockShowSnackbar).toHaveBeenCalledWith(expect.objectContaining({ kind: 'warning' }));
1162
+ expect(mockShowSnackbar).not.toHaveBeenCalledWith(expect.objectContaining({ kind: 'error' }));
1163
+ });
@@ -37,6 +37,8 @@
37
37
  "primaryDiagnosis": "Primary diagnosis",
38
38
  "primaryDiagnosisInputPlaceholder": "Choose a primary diagnosis",
39
39
  "primaryDiagnosisRequired": "Choose at least one primary diagnosis",
40
+ "reAddImagesFromNote_one": "Open the note to add it again.",
41
+ "reAddImagesFromNote_other": "Open the note to add them again.",
40
42
  "removeImage": "Remove image: {{name}}",
41
43
  "retry": "Retry",
42
44
  "saveAndClose": "Save and close",
@@ -62,5 +64,7 @@
62
64
  "visitNotePartialSaveError": "Could not save all changes. Some changes may already be saved. Try saving again.",
63
65
  "visitNotes": "Visit notes",
64
66
  "visitNoteSaved": "Visit note saved",
67
+ "visitNoteSavedImagesFailed_one": "Visit note saved, but {{count}} image was not uploaded",
68
+ "visitNoteSavedImagesFailed_other": "Visit note saved, but {{count}} images were not uploaded",
65
69
  "visitNoteSaveError": "Error saving visit note"
66
70
  }