@openmrs/esm-fast-data-entry-app 1.5.1-pre.982 → 1.5.1-pre.986
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1519.js +1 -1
- package/dist/3378.js +1 -1
- package/dist/4253.js +1 -1
- package/dist/4757.js +1 -1
- package/dist/6107.js +1 -1
- package/dist/6606.js +1 -1
- package/dist/6977.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js +2 -2
- package/dist/routes.json +1 -1
- package/package.json +2 -2
package/dist/1519.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["1519"],{8414(e,t,a){let l;a.d(t,{A:()=>o});let r="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),n=new Uint8Array(16),s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));let o=function(e,t,a){if(r&&!t&&!e)return r();let o=(e=e||{}).random||(e.rng||function(){if(!l&&!(l="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(n)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){a=a||0;for(let e=0;e<16;++e)t[a+e]=o[e];return t}return function(e,t=0){return s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]}(o)}},1369(e,t,a){a.d(t,{K:()=>n});var l=a(7979),r=a.n(l);let n=({width:e="64",height:t="64"})=>r().createElement("svg",{width:e,height:t,viewBox:"0 0 64 64"},r().createElement("title",null,"Empty data illustration"),r().createElement("g",{fill:"none",fillRule:"evenodd"},r().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),r().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),r().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),r().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),r().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),r().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),r().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),r().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),r().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),r().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},957(e,t,a){a.r(t),a.d(t,{default:()=>f});var l=a(7979),r=a.n(l),n=a(3826),s=a(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["1519"],{8414(e,t,a){let l;a.d(t,{A:()=>o});let r="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),n=new Uint8Array(16),s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));let o=function(e,t,a){if(r&&!t&&!e)return r();let o=(e=e||{}).random||(e.rng||function(){if(!l&&!(l="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(n)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){a=a||0;for(let e=0;e<16;++e)t[a+e]=o[e];return t}return function(e,t=0){return s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]}(o)}},1369(e,t,a){a.d(t,{K:()=>n});var l=a(7979),r=a.n(l);let n=({width:e="64",height:t="64"})=>r().createElement("svg",{width:e,height:t,viewBox:"0 0 64 64"},r().createElement("title",null,"Empty data illustration"),r().createElement("g",{fill:"none",fillRule:"evenodd"},r().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),r().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),r().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),r().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),r().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),r().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),r().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),r().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),r().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),r().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},957(e,t,a){a.r(t),a.d(t,{default:()=>f});var l=a(7979),r=a.n(l),n=a(3826),s=a(2908),o=a(3392),i=a(3455),c=a(6984),m=a(5565),u=a(9943),d=a(1369);let p=({headerTitle:e,displayText:t})=>{let a="tablet"===(0,s.useLayoutType)();return r().createElement(o.Layer,null,r().createElement(o.Tile,{className:"-esm-fast-data-entry__styles__tile___89Biq"},r().createElement("div",{className:a?"-esm-fast-data-entry__styles__tabletHeading___BpoJn":"-esm-fast-data-entry__styles__desktopHeading___t75bY"},r().createElement("h4",null,e)),r().createElement(d.K,null),r().createElement("p",{className:"-esm-fast-data-entry__styles__content___mRTpB"},t)))},_=({rows:e,error:t,isLoading:a,activeForms:i,activeGroupForms:c})=>{let{t:m}=(0,n.useTranslation)(),d=(0,l.useMemo)(()=>[{key:"display",header:m("formName","Form Name"),isSortable:!0},{key:"actions",header:m("actions","Actions")},{key:"actions2",header:""}],[m]),_=e?.map(e=>({...e,actions:r().createElement(u.Link,{to:`form/${e.uuid}`},i.includes(e.uuid)?m("resumeSession","Resume Session"):m("fillForm","Fill Form")),actions2:!e.disableGroupSession&&r().createElement(u.Link,{to:`groupform/${e.uuid}`},c.includes(e.uuid)?m("resumeGroupSession","Resume Group Session"):m("startGroupSession","Start Group Session"))}));return a?r().createElement(o.DataTableSkeleton,null):t?r().createElement(s.ErrorState,{headerTitle:m("errorLoadingData","Error Loading Data"),error:t}):0===_.length?r().createElement(p,{headerTitle:m("noFormsFound","No Forms To Show"),displayText:m("noFormsFoundMessage","No forms could be found for this category. Please double check the form concept uuids and access permissions.")}):r().createElement(o.DataTable,{rows:_,headers:d},({rows:e,headers:t,getTableProps:a,getHeaderProps:l,getRowProps:n,onInputChange:s})=>r().createElement(o.TableContainer,null,r().createElement("div",{className:"-esm-fast-data-entry__styles__toolbarWrapper___yCs0-"},r().createElement(o.TableToolbar,{className:"-esm-fast-data-entry__styles__tableToolbar___aPwyR"},r().createElement(o.TableToolbarContent,null,r().createElement(o.TableToolbarSearch,{onChange:s})))),r().createElement(o.Table,a(),r().createElement(o.TableHead,null,r().createElement(o.TableRow,null,t.map(e=>r().createElement(o.TableHeader,l({header:e,isSortable:e.isSortable}),e.header)))),r().createElement(o.TableBody,null,e?.map(e=>r().createElement(o.TableRow,n({row:e}),e.cells.map(e=>r().createElement(o.TableCell,{key:e.id},e.value))))))))},f=()=>{let e=(0,s.useConfig)(),{t}=(0,n.useTranslation)(),{formCategories:a,formCategoriesToShow:l}=e,{forms:u,isLoading:d,error:p}=(0,m.mr)(),f=((e=[],t=[])=>{let a=new Map(t.flatMap(({forms:e})=>e.map(({formUUID:e,disableGroupSession:t})=>[e,t])));return e.map(e=>({...e,id:e.uuid,display:e.display||e.name,disableGroupSession:a.get(e.uuid)}))})(u,a),{user:y}=(0,s.useSession)(),E=localStorage.getItem(i.dd+":"+y?.uuid),b=localStorage.getItem(c.oU+":"+y?.uuid),h=[],g=[];E&&JSON.parse(E)?._storageVersion===i.KA&&Object.entries(JSON.parse(E).forms).forEach(([e,t])=>{t.workflowState&&h.push(e)}),b&&JSON.parse(b)?._storageVersion===c.D8&&Object.entries(JSON.parse(b).forms).forEach(([e,t])=>{t.workflowState&&g.push(e)});let T=l.map(e=>{let t=a.find(t=>t.name===e),l=[];if(t&&f&&f.length){let e=t.forms?.map(e=>e.formUUID);l=f.filter(t=>e.includes(t.uuid)).sort((t,a)=>e.indexOf(t.uuid)-e.indexOf(a.uuid))}return{name:e,rows:l}});return r().createElement("div",null,r().createElement(s.PageHeader,{className:"-esm-fast-data-entry__styles__header___19SBT"},r().createElement(s.PageHeaderContent,{illustration:r().createElement(s.DataEntryPictogram,null),title:t("fastDataEntry","Fast Data Entry")})),r().createElement("div",{className:"-esm-fast-data-entry__styles__mainContent___n-nk5"},r().createElement(o.Tabs,null,r().createElement(o.TabList,null,r().createElement(o.Tab,{"aria-label":t("allForms","All Forms")},`${t("allForms","All Forms")} (${f?f?.length:"??"})`),T?.map((e,a)=>r().createElement(o.Tab,{"aria-label":e.name,key:a},`${t(e.name,e.name)} (${e.rows.length})`))),r().createElement(o.TabPanels,null,r().createElement(o.TabPanel,null,r().createElement(_,{rows:f,error:p,isLoading:d,activeForms:h,activeGroupForms:g})),T?.map((e,t)=>r().createElement(o.TabPanel,{key:t},r().createElement(_,{rows:e.rows,error:p,isLoading:d,activeForms:h,activeGroupForms:g})))))))}},5565(e,t,a){a.d(t,{J0:()=>u.A,XT:()=>m,mr:()=>i}),a(7979);var l=a(2908),r=a(1943),n=a.n(r);let s="(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))",o=`${l.restBaseUrl}/form?v=custom:${s}`,i=(l.restBaseUrl,function(e=!1){let t=(0,l.useSession)(),{data:a,error:r}=n()([o,e],async()=>{let e=await (0,l.openmrsFetch)(o);return e.data?.results?.filter(e=>e.published&&!/component/i.test(e.name))??[]});return{forms:a?.filter(e=>!!(0,l.userHasAccess)(e.encounterType?.editPrivilege?.display,t?.user)),isLoading:!r&&!a,error:r}}),c=`${l.restBaseUrl}/encounter/`,m=e=>{let t=`${c}${e}`,{data:a,error:r}=n()(t,async()=>(await (0,l.openmrsFetch)(t)).data||null);return{encounter:a,isLoading:!r&&a,error:r}};var u=a(1291);a(5301)}}]);
|
package/dist/3378.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["3378"],{4767(e,o,t){var n={"./uk.json":["723","9072"],"./ar.json":["4132","7045"],"./ru_RU.json":["986","8359"],"./uz_UZ.json":["890","7175"],"./fr.json":["4055","6508"],"./sw_KE.json":["8618","903"],"./uz.json":["3584","6377"],"./en.json":["4300","5117"],"./ky.json":["8163","2416"],"./pl.json":["1119","6724"],"./sq.json":["8371","4928"],"./ka.json":["795","1480"],"./si.json":["6859","6904"],"./zh_TW.json":["439","556"],"./de.json":["4944","5145"],"./lg.json":["4618","8695"],"./vi.json":["9214","6371"],"./tr.json":["5241","434"],"./es_MX.json":["8349","1646"],"./tr_TR.json":["9900","1869"],"./zh_CN.json":["9879","5644"],"./en_US.json":["9569","4106"],"./he.json":["4652","2317"],"./id.json":["2690","6047"],"./ku.json":["9895","4348"],"./es.json":["3099","7912"],"./ne.json":["2146","5503"],"./ar_SY.json":["7617","282"],"./uz@Latn.json":["7097","4658"],"./bn.json":["7159","6444"],"./cs.json":["6589","7182"],"./zh.json":["5661","7742"],"./hi_IN.json":["5442","4383"],"./pt_BR.json":["6468","1877"],"./qu.json":["5173","8358"],"./ro_RO.json":["6022","3963"],"./sw.json":["9913","997"],"./am.json":["1197","9806"],"./pt.json":["6679","5132"],"./it.json":["9538","4111"],"./km.json":["4335","5940"],"./hi.json":["6840","2881"]};function s(e){if(!t.o(n,e))return Promise.resolve().then(function(){var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o});var o=n[e],s=o[0];return t.e(o[1]).then(function(){return t(s)})}s.keys=()=>Object.keys(n),s.id=4767,e.exports=s},7481(e,o,t){"use strict";t.r(o),t.d(o,{formsAppMenuLink:()=>c,cancelSessionModal:()=>_,importTranslation:()=>r,startupApp:()=>f,addGroupModal:()=>y,patientLocationMismatchModal:()=>l,completeSessionModal:()=>d,root:()=>p});var n=t(
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["3378"],{4767(e,o,t){var n={"./uk.json":["723","9072"],"./ar.json":["4132","7045"],"./ru_RU.json":["986","8359"],"./uz_UZ.json":["890","7175"],"./fr.json":["4055","6508"],"./sw_KE.json":["8618","903"],"./uz.json":["3584","6377"],"./en.json":["4300","5117"],"./ky.json":["8163","2416"],"./pl.json":["1119","6724"],"./sq.json":["8371","4928"],"./ka.json":["795","1480"],"./si.json":["6859","6904"],"./zh_TW.json":["439","556"],"./de.json":["4944","5145"],"./lg.json":["4618","8695"],"./vi.json":["9214","6371"],"./tr.json":["5241","434"],"./es_MX.json":["8349","1646"],"./tr_TR.json":["9900","1869"],"./zh_CN.json":["9879","5644"],"./en_US.json":["9569","4106"],"./he.json":["4652","2317"],"./id.json":["2690","6047"],"./ku.json":["9895","4348"],"./es.json":["3099","7912"],"./ne.json":["2146","5503"],"./ar_SY.json":["7617","282"],"./uz@Latn.json":["7097","4658"],"./bn.json":["7159","6444"],"./cs.json":["6589","7182"],"./zh.json":["5661","7742"],"./hi_IN.json":["5442","4383"],"./pt_BR.json":["6468","1877"],"./qu.json":["5173","8358"],"./ro_RO.json":["6022","3963"],"./sw.json":["9913","997"],"./am.json":["1197","9806"],"./pt.json":["6679","5132"],"./it.json":["9538","4111"],"./km.json":["4335","5940"],"./hi.json":["6840","2881"]};function s(e){if(!t.o(n,e))return Promise.resolve().then(function(){var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o});var o=n[e],s=o[0];return t.e(o[1]).then(function(){return t(s)})}s.keys=()=>Object.keys(n),s.id=4767,e.exports=s},7481(e,o,t){"use strict";t.r(o),t.d(o,{formsAppMenuLink:()=>c,cancelSessionModal:()=>_,importTranslation:()=>r,startupApp:()=>f,addGroupModal:()=>y,patientLocationMismatchModal:()=>l,completeSessionModal:()=>d,root:()=>p});var n=t(2908);let s={formCategories:{_type:n.Type.Array,_description:"Organize forms into categories. A form can belong to multiple categories.",_elements:{name:{_type:n.Type.String,_description:"Category name"},forms:{_type:n.Type.Array,_description:"List of forms for this category.",_elements:{formUUID:{_type:n.Type.UUID,_description:"UUID of form"},name:{_type:n.Type.String,_description:"Name of form"},disableGroupSession:{_type:n.Type.Boolean,_description:"Disable group sessions for this form",_default:!1}}}},_default:[]},formCategoriesToShow:{_type:n.Type.Array,_description:"Forms to show by default on the forms app home page.",_elements:{_type:n.Type.String,_description:"Name of category"},_default:[]},groupSessionConcepts:{sessionName:{_type:n.Type.UUID,_description:"UUID of concept for Session Name",_default:"e2559620-900b-4f66-ae41-0b9c4adfb654"},sessionDate:{_type:n.Type.UUID,_description:"UUID of concept for Session Date",_default:"ceaca505-6dff-4940-8a43-8c060a0924d7"},practitionerName:{_type:n.Type.UUID,_description:"UUID of concept for Practitioner Name",_default:"f1a2d58c-1a0e-4148-931a-aac224649fdc"},sessionNotes:{_type:n.Type.UUID,_description:"UUID of concept for Session Notes",_default:"fa8fedc0-c066-4da3-8dc1-2ad8621fc480"},cohortTypeId:{_type:n.Type.UUID,_description:"UUID of cohort type",_default:"eee9970e-7ca0-4e8c-a280-c33e9d5f6a04"},cohortId:{_type:n.Type.UUID,_description:"UUID of concept for cohort identifier",_default:"5461f231-7e59-4be8-93a4-6d49fd13c00a"},cohortName:{_type:n.Type.UUID,_description:"UUID of concept for cohort name",_default:"6029f289-92a6-4a68-80f1-3078d0152449"},sessionUuid:{_type:n.Type.UUID,_description:"UUID of concept for session identifier",_default:"6a803908-8a5b-4598-adea-19358c83529a"}},specificQuestions:{_type:n.Type.Array,_description:"List of specific questions to populate forms.",_elements:{forms:{_type:n.Type.Array,_description:"List of form UUIDs for which the question applies.",_elements:{_type:n.Type.UUID},_default:[]},questionId:{_type:n.Type.String,_description:"ID of the question.",_default:""}},_default:[]},patientLocationMismatchCheck:{_type:n.Type.Boolean,_description:"Whether to prompt for confirmation if the selected patient is not at the same location as the current session.",_default:!1},enforcePatientListLocationMatch:{_type:n.Type.Boolean,_description:"If true, prevents adding patients from a different location than the current session.",_default:!1}},i="@openmrs/esm-fast-data-entry-app",a={featureName:"fast-data-entry-app",moduleName:i},r=t(4767),p=(0,n.getAsyncLifecycle)(()=>Promise.all([t.e("3080"),t.e("2044"),t.e("9403")]).then(t.bind(t,2934)),a),c=(0,n.getAsyncLifecycle)(()=>Promise.all([t.e("3080"),t.e("9823"),t.e("4253")]).then(t.bind(t,4796)),a);function f(){(0,n.defineConfigSchema)(i,s)}let _=(0,n.getAsyncLifecycle)(()=>Promise.all([t.e("3080"),t.e("9823"),t.e("9177"),t.e("1801")]).then(t.bind(t,7136)),a),d=(0,n.getAsyncLifecycle)(()=>Promise.all([t.e("3080"),t.e("9823"),t.e("9177"),t.e("9228")]).then(t.bind(t,7927)),a),y=(0,n.getAsyncLifecycle)(()=>Promise.all([t.e("1617"),t.e("3080"),t.e("9823"),t.e("9177"),t.e("6028"),t.e("6977")]).then(t.bind(t,2263)),a),l=(0,n.getAsyncLifecycle)(()=>Promise.all([t.e("3080"),t.e("9823"),t.e("9177"),t.e("9147")]).then(t.bind(t,5078)),a)}}]);
|
package/dist/4253.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["4253"],{4796(a,e,n){n.r(e),n.d(e,{default:()=>_});var t=n(7979),s=n.n(t),r=n(3826),p=n(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["4253"],{4796(a,e,n){n.r(e),n.d(e,{default:()=>_});var t=n(7979),s=n.n(t),r=n(3826),p=n(2908);function _(){let{t:a}=(0,r.useTranslation)();return s().createElement(p.ConfigurableLink,{to:"${openmrsSpaBase}/forms"},a("formsAppMenuLink","Fast Data Entry"))}}}]);
|
package/dist/4757.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["4757"],{5852(t,e,i){i.d(e,{Ay:()=>l,NX:()=>m,Z1:()=>U});var a=i(7979),o=i.n(a),r=i(3455),u=i(9943),n=i(5725),s=i(8345);let d={addPatient:t=>void 0,openPatientSearch:()=>void 0,saveEncounter:t=>void 0,editEncounter:t=>void 0,submitForNext:()=>void 0,submitForReview:()=>void 0,submitForComplete:()=>void 0,goToReview:()=>void 0,destroySession:()=>void 0,closeSession:()=>void 0},m={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{},singleSessionVisitTypeUuid:null,userUuid:null},c=o().createContext({...m,...d}),U=({children:t})=>{let{user:e}=(0,s.useSession)(),{formUuid:i}=(0,u.useParams)(),U=i.split("&")[0],{search:l}=(0,u.useLocation)(),v=new URLSearchParams(l).get("patientUuid"),[f,E]=(0,a.useReducer)(r.Ay,{...m,...d}),F=(0,n.A)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),p=F?.result?.data?.results?.[0]?.value,S=(0,a.useMemo)(()=>({initializeWorkflowState:({activeFormUuid:t,newPatientUuid:i})=>E({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:t,newPatientUuid:i,userUuid:e.uuid}),addPatient:t=>E({type:"ADD_PATIENT",patientUuid:t}),openPatientSearch:()=>E({type:"OPEN_PATIENT_SEARCH"}),saveEncounter:t=>E({type:"SAVE_ENCOUNTER",encounterUuid:t}),submitForNext:()=>E({type:"SUBMIT_FOR_NEXT"}),submitForReview:()=>E({type:"SUBMIT_FOR_REVIEW"}),submitForComplete:()=>E({type:"SUBMIT_FOR_COMPLETE"}),editEncounter:t=>E({type:"EDIT_ENCOUNTER",patientUuid:t}),goToReview:()=>E({type:"GO_TO_REVIEW"}),destroySession:()=>E({type:"DESTROY_SESSION"}),closeSession:()=>E({type:"CLOSE_SESSION"})}),[e]);return(0,a.useEffect)(()=>{f?.workflowState===null&&U&&S.initializeWorkflowState({activeFormUuid:U,newPatientUuid:v})},[U,v,f?.workflowState,S]),o().createElement(c.Provider,{value:{...f,...S,workflowState:f.forms?.[f.activeFormUuid]?.workflowState??m.workflowState,activePatientUuid:f.forms?.[f.activeFormUuid]?.activePatientUuid??m.activePatientUuid,activeEncounterUuid:f.forms?.[f.activeFormUuid]?.activeEncounterUuid??m.activeEncounterUuid,patientUuids:f.forms?.[f.activeFormUuid]?.patientUuids??m.patientUuids,encounters:f.forms?.[f.activeFormUuid]?.encounters??m.encounters,singleSessionVisitTypeUuid:p}},t)},l=c},3455(t,e,i){i.d(e,{Ay:()=>d,KA:()=>r,dd:()=>u});var a=i(8345),o=i(5852);let r="1.1.0",u="openmrs:fastDataEntryWorkflowState",n=t=>{localStorage.setItem(u+":"+t.userUuid,JSON.stringify(t))},s={workflowState:"NEW_PATIENT",activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{}},d=(t,e)=>{switch(e.type){case"INITIALIZE_WORKFLOW_STATE":{let t=localStorage.getItem(u+":"+e.userUuid),i=t?JSON.parse(t):{},a={},d=e.newPatientUuid?{activePatientUuid:e.newPatientUuid,workflowState:"EDIT_FORM"}:{};return t&&i._storageVersion===r?(a={...i,activeFormUuid:e.activeFormUuid,forms:{...i.forms,[e.activeFormUuid]:{...s,...i.forms[e.activeFormUuid],...d,patientUuids:i.forms[e.activeFormUuid]?.patientUuids||s.patientUuids}}},e.newPatientUuid&&!a.forms[e.activeFormUuid].patientUuids.includes(e.newPatientUuid)&&a.forms[e.activeFormUuid].patientUuids.push(e.newPatientUuid)):a={...o.NX,_storageVersion:r,forms:{[e.activeFormUuid]:s},activeFormUuid:e.activeFormUuid,userUuid:e.userUuid},n(a),{...a}}case"ADD_PATIENT":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],patientUuids:[...t.forms[t.activeFormUuid].patientUuids,e.patientUuid],activePatientUuid:e.patientUuid,activeEncounterUuid:null,workflowState:"EDIT_FORM"}}};return n(i),i}case"OPEN_PATIENT_SEARCH":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activePatientUuid:null,activeEncounterUuid:null,workflowState:"NEW_PATIENT"}}};return n(e),e}case"SAVE_ENCOUNTER":if("SUBMIT_FOR_COMPLETE"===t.forms[t.activeFormUuid].workflowState){let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return n(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),o}{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],encounters:{...t.forms[t.activeFormUuid].encounters,[t.forms[t.activeFormUuid].activePatientUuid]:e.encounterUuid},activePatientUuid:null,activeEncounterUuid:null,workflowState:"SUBMIT_FOR_NEXT"===t.forms[t.activeFormUuid].workflowState?"NEW_PATIENT":"SUBMIT_FOR_REVIEW"===t.forms[t.activeFormUuid].workflowState?"REVIEW":t.forms[t.activeFormUuid].workflowState}}};return n(i),i}case"EDIT_ENCOUNTER":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:t.forms[t.activeFormUuid].encounters[e.patientUuid],activePatientUuid:e.patientUuid,workflowState:"EDIT_FORM"}}};return n(i),i}case"SUBMIT_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_NEXT"}}};case"SUBMIT_FOR_REVIEW":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_REVIEW"}}};case"SUBMIT_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_COMPLETE"}}};case"GO_TO_REVIEW":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:null,activePatientUuid:null,workflowState:"REVIEW"}}};return n(e),e}case"DESTROY_SESSION":{let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return n(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),o}case"CLOSE_SESSION":{let e={...t,activeFormUuid:null};return n(e),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),e}default:return t}}},6984(t,e,i){i.d(e,{Ay:()=>m,D8:()=>u,oU:()=>n});var a=i(8345),o=i(5852),r=i(8414);let u="1.0.5",n="openmrs:fastDataEntryGroupWorkflowState",s=t=>{localStorage.setItem(n+":"+t.userUuid,JSON.stringify(t))},d={workflowState:"NEW_GROUP_SESSION",groupUuid:null,groupName:null,groupMembers:[],activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,activeSessionUuid:null,patientUuids:[],encounters:{},visits:{}},m=(t,e)=>{switch(e.type){case"INITIALIZE_WORKFLOW_STATE":{let t=localStorage.getItem(n+":"+e.userUuid),i=t?JSON.parse(t):{},a={};if(t&&i._storageVersion===u){let t=i.forms?.[e.activeFormUuid],o=t?.activePatientUuid||t?.patientUuids?.[0]||null,u=t?.activeSessionUuid||(0,r.A)();a={...i,activeFormUuid:e.activeFormUuid,forms:{...i.forms,[e.activeFormUuid]:{...d,...t,activePatientUuid:o,activeEncounterUuid:t?.encounters?.[o]||null,activeVisitUuid:t?.visits?.[o]||null,activeSessionUuid:u}}}}else a={...o.NX,_storageVersion:u,forms:{[e.activeFormUuid]:d},activeFormUuid:e.activeFormUuid,userUuid:e.userUuid};return s(a),a}case"SET_GROUP":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],groupUuid:e.group.uuid,groupName:e.group.name,patientUuids:e.group.cohortMembers?.map(t=>t?.patient?.uuid)??[],groupMembers:e.group.cohortMembers?.map(t=>t?.patient?.uuid)??[],activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,activeSessionUuid:null}}};return s(i),i}case"UNSET_GROUP":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],groupUuid:null,groupName:null,patientUuids:[],groupMembers:[],activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,activeSessionUuid:null}}};return s(e),e}case"SET_SESSION_META":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],sessionMeta:e.meta,activePatientUuid:t.forms[t.activeFormUuid].patientUuids?.[0],activeEncounterUuid:t.forms[t.activeFormUuid].encounters[t.forms[t.activeFormUuid].patientUuids?.[0]]||null,activeVisitUuid:t.forms[t.activeFormUuid].visits[t.forms[t.activeFormUuid].patientUuids?.[0]]||null,activeSessionUuid:(0,r.A)(),workflowState:"EDIT_FORM"}}};return s(i),i}case"ADD_PATIENT_UUID":{if(t.forms[t.activeFormUuid].patientUuids.includes(e.patientUuid))return t;let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],patientUuids:[...t.forms[t.activeFormUuid].patientUuids,e.patientUuid]}}};return s(i),i}case"REMOVE_PATIENT_UUID":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],patientUuids:t.forms[t.activeFormUuid].patientUuids?.filter(t=>e.patientUuid!==t)}}};return s(i),i}case"SAVE_ENCOUNTER":{let i=t.forms[t.activeFormUuid];if("SUBMIT_FOR_COMPLETE"===i.workflowState){let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return s(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),o}if("SUBMIT_FOR_NEXT"!==i.workflowState)return t;{let a=t.nextPatientUuid?t.nextPatientUuid:i.patientUuids[Math.min(i.patientUuids.indexOf(i.activePatientUuid)+1,i.patientUuids.length-1)],o={...i.encounters,[i.activePatientUuid]:e.encounterUuid},r={...t,forms:{...t.forms,[t.activeFormUuid]:{...i,encounters:o,activePatientUuid:a,activeEncounterUuid:o[a]||null,activeVisitUuid:i.visits[a]||null,activeSessionUuid:i.activeSessionUuid,workflowState:"EDIT_FORM"}}};return s(r),r}}case"EDIT_ENCOUNTER":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:t.forms[t.activeFormUuid].encounters[e.patientUuid],activeVisitUuid:t.forms[t.activeFormUuid].visits[e.patientUuid],activePatientUuid:e.patientUuid,activeSessionUuid:e.activeSessionUuid,workflowState:"EDIT_FORM"}}};return s(i),i}case"VALIDATE_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"validateForm"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"VALIDATE_FOR_NEXT"}}};case"UPDATE_VISIT_UUID":return{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],visits:{...t.forms[t.activeFormUuid].visits,[t.forms[t.activeFormUuid].activePatientUuid]:e.visitUuid},activeVisitUuid:e.visitUuid}}};case"SUBMIT_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_NEXT"}},nextPatientUuid:e.nextPatientUuid};case"SUBMIT_FOR_REVIEW":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_REVIEW"}}};case"VALIDATE_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"validateForm"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"VALIDATE_FOR_COMPLETE"}}};case"SUBMIT_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_COMPLETE"}}};case"GO_TO_REVIEW":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:null,activeVisitUuid:null,activePatientUuid:null,activeSessionUuid:null,workflowState:"REVIEW"}}};return s(e),e}case"DESTROY_SESSION":{let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return s(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),{...o,formDestroyed:!0}}case"CLOSE_SESSION":{let e={...t,activeFormUuid:null};return s(e),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),e}default:return t}}},1291(t,e,i){i.d(e,{A:()=>r});var a=i(8345),o=i(7979);let r=t=>{let[e,i]=(0,o.useState)(null);return(0,o.useEffect)(()=>{let e=!1;return i(null),t&&(0,a.fetchCurrentPatient)(t).then(t=>{e||i(t)}),()=>{e=!0}},[t]),e}},5725(t,e,i){i.d(e,{A:()=>r});var a=i(7979),o=i(8345);let r=t=>{let[e,i]=(0,a.useState)(!1),[r,u]=(0,a.useState)(null),[n,s]=(0,a.useState)(null),d=(0,a.useCallback)(t=>{i(!1),s(!1),u(t)},[]),m=(0,a.useCallback)(t=>{i(!1),u(null),s(t)},[]),c=(0,a.useCallback)(()=>{(0,o.openmrsFetch)(`${o.restBaseUrl}/systemsetting?q=${t}&v=default`).then(d).catch(m)},[m,d,t]);return(0,a.useEffect)(()=>{c()},[c]),{result:r,error:n,isSubmitting:e}}},5301(t,e,i){i.d(e,{A:()=>s});var a=i(8345),o=i(1943),r=i.n(o),u=i(7979);let n=`${a.restBaseUrl}/o3/forms`,s=(t,e)=>{let i=(0,u.useMemo)(()=>{var i;return i=t,e.filter(t=>t.forms.includes(i))},[t,e]),{data:o,error:s}=r()(i?`${n}/${t}`:null,a.openmrsFetch);return{questions:function(t,e){if(!e||t.length<=0)return[];let i=new Map(t.map(t=>[t.questionId,t])),a=new Set(i.keys()),o=e.conceptReferences;return e.pages.flatMap(t=>t.sections.flatMap(t=>t.questions.filter(t=>a.has(t.id)).map(t=>{let e=i.get(t.id)||{},a=e.answers?.map(t=>({value:t,display:o[t]?.display}))||(t.questionOptions.answers??[]).map(t=>({value:t.concept,display:t.label??o[t.concept]?.display}));return{question:{display:t.label??o[t.questionOptions.concept]?.display,id:t.id,disabled:e.disabled,defaultAnswer:e.defaultAnswer},answers:a}})))}(i,o?.data)||null,isError:s,isLoading:!o&&!s}}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["4757"],{5852(t,e,i){i.d(e,{Ay:()=>l,NX:()=>m,Z1:()=>U});var a=i(7979),o=i.n(a),r=i(3455),u=i(9943),n=i(5725),s=i(2908);let d={addPatient:t=>void 0,openPatientSearch:()=>void 0,saveEncounter:t=>void 0,editEncounter:t=>void 0,submitForNext:()=>void 0,submitForReview:()=>void 0,submitForComplete:()=>void 0,goToReview:()=>void 0,destroySession:()=>void 0,closeSession:()=>void 0},m={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{},singleSessionVisitTypeUuid:null,userUuid:null},c=o().createContext({...m,...d}),U=({children:t})=>{let{user:e}=(0,s.useSession)(),{formUuid:i}=(0,u.useParams)(),U=i.split("&")[0],{search:l}=(0,u.useLocation)(),v=new URLSearchParams(l).get("patientUuid"),[f,E]=(0,a.useReducer)(r.Ay,{...m,...d}),F=(0,n.A)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),p=F?.result?.data?.results?.[0]?.value,S=(0,a.useMemo)(()=>({initializeWorkflowState:({activeFormUuid:t,newPatientUuid:i})=>E({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:t,newPatientUuid:i,userUuid:e.uuid}),addPatient:t=>E({type:"ADD_PATIENT",patientUuid:t}),openPatientSearch:()=>E({type:"OPEN_PATIENT_SEARCH"}),saveEncounter:t=>E({type:"SAVE_ENCOUNTER",encounterUuid:t}),submitForNext:()=>E({type:"SUBMIT_FOR_NEXT"}),submitForReview:()=>E({type:"SUBMIT_FOR_REVIEW"}),submitForComplete:()=>E({type:"SUBMIT_FOR_COMPLETE"}),editEncounter:t=>E({type:"EDIT_ENCOUNTER",patientUuid:t}),goToReview:()=>E({type:"GO_TO_REVIEW"}),destroySession:()=>E({type:"DESTROY_SESSION"}),closeSession:()=>E({type:"CLOSE_SESSION"})}),[e]);return(0,a.useEffect)(()=>{f?.workflowState===null&&U&&S.initializeWorkflowState({activeFormUuid:U,newPatientUuid:v})},[U,v,f?.workflowState,S]),o().createElement(c.Provider,{value:{...f,...S,workflowState:f.forms?.[f.activeFormUuid]?.workflowState??m.workflowState,activePatientUuid:f.forms?.[f.activeFormUuid]?.activePatientUuid??m.activePatientUuid,activeEncounterUuid:f.forms?.[f.activeFormUuid]?.activeEncounterUuid??m.activeEncounterUuid,patientUuids:f.forms?.[f.activeFormUuid]?.patientUuids??m.patientUuids,encounters:f.forms?.[f.activeFormUuid]?.encounters??m.encounters,singleSessionVisitTypeUuid:p}},t)},l=c},3455(t,e,i){i.d(e,{Ay:()=>d,KA:()=>r,dd:()=>u});var a=i(2908),o=i(5852);let r="1.1.0",u="openmrs:fastDataEntryWorkflowState",n=t=>{localStorage.setItem(u+":"+t.userUuid,JSON.stringify(t))},s={workflowState:"NEW_PATIENT",activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{}},d=(t,e)=>{switch(e.type){case"INITIALIZE_WORKFLOW_STATE":{let t=localStorage.getItem(u+":"+e.userUuid),i=t?JSON.parse(t):{},a={},d=e.newPatientUuid?{activePatientUuid:e.newPatientUuid,workflowState:"EDIT_FORM"}:{};return t&&i._storageVersion===r?(a={...i,activeFormUuid:e.activeFormUuid,forms:{...i.forms,[e.activeFormUuid]:{...s,...i.forms[e.activeFormUuid],...d,patientUuids:i.forms[e.activeFormUuid]?.patientUuids||s.patientUuids}}},e.newPatientUuid&&!a.forms[e.activeFormUuid].patientUuids.includes(e.newPatientUuid)&&a.forms[e.activeFormUuid].patientUuids.push(e.newPatientUuid)):a={...o.NX,_storageVersion:r,forms:{[e.activeFormUuid]:s},activeFormUuid:e.activeFormUuid,userUuid:e.userUuid},n(a),{...a}}case"ADD_PATIENT":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],patientUuids:[...t.forms[t.activeFormUuid].patientUuids,e.patientUuid],activePatientUuid:e.patientUuid,activeEncounterUuid:null,workflowState:"EDIT_FORM"}}};return n(i),i}case"OPEN_PATIENT_SEARCH":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activePatientUuid:null,activeEncounterUuid:null,workflowState:"NEW_PATIENT"}}};return n(e),e}case"SAVE_ENCOUNTER":if("SUBMIT_FOR_COMPLETE"===t.forms[t.activeFormUuid].workflowState){let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return n(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),o}{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],encounters:{...t.forms[t.activeFormUuid].encounters,[t.forms[t.activeFormUuid].activePatientUuid]:e.encounterUuid},activePatientUuid:null,activeEncounterUuid:null,workflowState:"SUBMIT_FOR_NEXT"===t.forms[t.activeFormUuid].workflowState?"NEW_PATIENT":"SUBMIT_FOR_REVIEW"===t.forms[t.activeFormUuid].workflowState?"REVIEW":t.forms[t.activeFormUuid].workflowState}}};return n(i),i}case"EDIT_ENCOUNTER":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:t.forms[t.activeFormUuid].encounters[e.patientUuid],activePatientUuid:e.patientUuid,workflowState:"EDIT_FORM"}}};return n(i),i}case"SUBMIT_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_NEXT"}}};case"SUBMIT_FOR_REVIEW":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_REVIEW"}}};case"SUBMIT_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_COMPLETE"}}};case"GO_TO_REVIEW":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:null,activePatientUuid:null,workflowState:"REVIEW"}}};return n(e),e}case"DESTROY_SESSION":{let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return n(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),o}case"CLOSE_SESSION":{let e={...t,activeFormUuid:null};return n(e),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),e}default:return t}}},6984(t,e,i){i.d(e,{Ay:()=>m,D8:()=>u,oU:()=>n});var a=i(2908),o=i(5852),r=i(8414);let u="1.0.5",n="openmrs:fastDataEntryGroupWorkflowState",s=t=>{localStorage.setItem(n+":"+t.userUuid,JSON.stringify(t))},d={workflowState:"NEW_GROUP_SESSION",groupUuid:null,groupName:null,groupMembers:[],activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,activeSessionUuid:null,patientUuids:[],encounters:{},visits:{}},m=(t,e)=>{switch(e.type){case"INITIALIZE_WORKFLOW_STATE":{let t=localStorage.getItem(n+":"+e.userUuid),i=t?JSON.parse(t):{},a={};if(t&&i._storageVersion===u){let t=i.forms?.[e.activeFormUuid],o=t?.activePatientUuid||t?.patientUuids?.[0]||null,u=t?.activeSessionUuid||(0,r.A)();a={...i,activeFormUuid:e.activeFormUuid,forms:{...i.forms,[e.activeFormUuid]:{...d,...t,activePatientUuid:o,activeEncounterUuid:t?.encounters?.[o]||null,activeVisitUuid:t?.visits?.[o]||null,activeSessionUuid:u}}}}else a={...o.NX,_storageVersion:u,forms:{[e.activeFormUuid]:d},activeFormUuid:e.activeFormUuid,userUuid:e.userUuid};return s(a),a}case"SET_GROUP":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],groupUuid:e.group.uuid,groupName:e.group.name,patientUuids:e.group.cohortMembers?.map(t=>t?.patient?.uuid)??[],groupMembers:e.group.cohortMembers?.map(t=>t?.patient?.uuid)??[],activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,activeSessionUuid:null}}};return s(i),i}case"UNSET_GROUP":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],groupUuid:null,groupName:null,patientUuids:[],groupMembers:[],activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,activeSessionUuid:null}}};return s(e),e}case"SET_SESSION_META":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],sessionMeta:e.meta,activePatientUuid:t.forms[t.activeFormUuid].patientUuids?.[0],activeEncounterUuid:t.forms[t.activeFormUuid].encounters[t.forms[t.activeFormUuid].patientUuids?.[0]]||null,activeVisitUuid:t.forms[t.activeFormUuid].visits[t.forms[t.activeFormUuid].patientUuids?.[0]]||null,activeSessionUuid:(0,r.A)(),workflowState:"EDIT_FORM"}}};return s(i),i}case"ADD_PATIENT_UUID":{if(t.forms[t.activeFormUuid].patientUuids.includes(e.patientUuid))return t;let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],patientUuids:[...t.forms[t.activeFormUuid].patientUuids,e.patientUuid]}}};return s(i),i}case"REMOVE_PATIENT_UUID":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],patientUuids:t.forms[t.activeFormUuid].patientUuids?.filter(t=>e.patientUuid!==t)}}};return s(i),i}case"SAVE_ENCOUNTER":{let i=t.forms[t.activeFormUuid];if("SUBMIT_FOR_COMPLETE"===i.workflowState){let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return s(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),o}if("SUBMIT_FOR_NEXT"!==i.workflowState)return t;{let a=t.nextPatientUuid?t.nextPatientUuid:i.patientUuids[Math.min(i.patientUuids.indexOf(i.activePatientUuid)+1,i.patientUuids.length-1)],o={...i.encounters,[i.activePatientUuid]:e.encounterUuid},r={...t,forms:{...t.forms,[t.activeFormUuid]:{...i,encounters:o,activePatientUuid:a,activeEncounterUuid:o[a]||null,activeVisitUuid:i.visits[a]||null,activeSessionUuid:i.activeSessionUuid,workflowState:"EDIT_FORM"}}};return s(r),r}}case"EDIT_ENCOUNTER":{let i={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:t.forms[t.activeFormUuid].encounters[e.patientUuid],activeVisitUuid:t.forms[t.activeFormUuid].visits[e.patientUuid],activePatientUuid:e.patientUuid,activeSessionUuid:e.activeSessionUuid,workflowState:"EDIT_FORM"}}};return s(i),i}case"VALIDATE_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"validateForm"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"VALIDATE_FOR_NEXT"}}};case"UPDATE_VISIT_UUID":return{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],visits:{...t.forms[t.activeFormUuid].visits,[t.forms[t.activeFormUuid].activePatientUuid]:e.visitUuid},activeVisitUuid:e.visitUuid}}};case"SUBMIT_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_NEXT"}},nextPatientUuid:e.nextPatientUuid};case"SUBMIT_FOR_REVIEW":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_REVIEW"}}};case"VALIDATE_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"validateForm"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"VALIDATE_FOR_COMPLETE"}}};case"SUBMIT_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),{...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],workflowState:"SUBMIT_FOR_COMPLETE"}}};case"GO_TO_REVIEW":{let e={...t,forms:{...t.forms,[t.activeFormUuid]:{...t.forms[t.activeFormUuid],activeEncounterUuid:null,activeVisitUuid:null,activePatientUuid:null,activeSessionUuid:null,workflowState:"REVIEW"}}};return s(e),e}case"DESTROY_SESSION":{let{[t.activeFormUuid]:e,...i}=t.forms,o={...t,forms:i,activeFormUuid:null};return s(o),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),{...o,formDestroyed:!0}}case"CLOSE_SESSION":{let e={...t,activeFormUuid:null};return s(e),(0,a.navigate)({to:"${openmrsSpaBase}/forms"}),e}default:return t}}},1291(t,e,i){i.d(e,{A:()=>r});var a=i(2908),o=i(7979);let r=t=>{let[e,i]=(0,o.useState)(null);return(0,o.useEffect)(()=>{let e=!1;return i(null),t&&(0,a.fetchCurrentPatient)(t).then(t=>{e||i(t)}),()=>{e=!0}},[t]),e}},5725(t,e,i){i.d(e,{A:()=>r});var a=i(7979),o=i(2908);let r=t=>{let[e,i]=(0,a.useState)(!1),[r,u]=(0,a.useState)(null),[n,s]=(0,a.useState)(null),d=(0,a.useCallback)(t=>{i(!1),s(!1),u(t)},[]),m=(0,a.useCallback)(t=>{i(!1),u(null),s(t)},[]),c=(0,a.useCallback)(()=>{(0,o.openmrsFetch)(`${o.restBaseUrl}/systemsetting?q=${t}&v=default`).then(d).catch(m)},[m,d,t]);return(0,a.useEffect)(()=>{c()},[c]),{result:r,error:n,isSubmitting:e}}},5301(t,e,i){i.d(e,{A:()=>s});var a=i(2908),o=i(1943),r=i.n(o),u=i(7979);let n=`${a.restBaseUrl}/o3/forms`,s=(t,e)=>{let i=(0,u.useMemo)(()=>{var i;return i=t,e.filter(t=>t.forms.includes(i))},[t,e]),{data:o,error:s}=r()(i?`${n}/${t}`:null,a.openmrsFetch);return{questions:function(t,e){if(!e||t.length<=0)return[];let i=new Map(t.map(t=>[t.questionId,t])),a=new Set(i.keys()),o=e.conceptReferences;return e.pages.flatMap(t=>t.sections.flatMap(t=>t.questions.filter(t=>a.has(t.id)).map(t=>{let e=i.get(t.id)||{},a=e.answers?.map(t=>({value:t,display:o[t]?.display}))||(t.questionOptions.answers??[]).map(t=>({value:t.concept,display:t.label??o[t.concept]?.display}));return{question:{display:t.label??o[t.questionOptions.concept]?.display,id:t.id,disabled:e.disabled,defaultAnswer:e.defaultAnswer},answers:a}})))}(i,o?.data)||null,isError:s,isLoading:!o&&!s}}}}]);
|
package/dist/6107.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["6107"],{8414(e,t,a){let n;a.d(t,{A:()=>l});let s="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),i=new Uint8Array(16),r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).slice(1));let l=function(e,t,a){if(s&&!t&&!e)return s();let l=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)})();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t){a=a||0;for(let e=0;e<16;++e)t[a+e]=l[e];return t}return function(e,t=0){return r[e[t+0]]+r[e[t+1]]+r[e[t+2]]+r[e[t+3]]+"-"+r[e[t+4]]+r[e[t+5]]+"-"+r[e[t+6]]+r[e[t+7]]+"-"+r[e[t+8]]+r[e[t+9]]+"-"+r[e[t+10]]+r[e[t+11]]+r[e[t+12]]+r[e[t+13]]+r[e[t+14]]+r[e[t+15]]}(l)}},5246(e,t,a){a.d(t,{A:()=>o});var n=a(7979),s=a.n(n),i=a(8345),r=a(1291),l=a(8269);let o=({formUuid:e,patientUuid:t,visitUuid:a,visitTypeUuid:o,encounterUuid:u,handlePostResponse:c,handleEncounterCreate:d,handleOnValidate:m,hidePatientBanner:_})=>{let p=(0,r.A)(t),v=p?.id===t,{activeSessionMeta:y}=(0,n.useContext)(l.Ay);(0,n.useEffect)(()=>()=>(0,i.detach)("form-widget-slot","form-widget-slot"),[]);let[E,f]=(0,n.useState)(!0),U=E&&e&&t&&p&&v;return s().createElement("div",null,U&&s().createElement(i.ExtensionSlot,{name:"form-widget-slot",state:{view:"form",formUuid:e,visitUuid:a??"",visitTypeUuid:o??"",patientUuid:t,patient:p,encounterUuid:u??"",closeWorkspace:()=>void 0,handlePostResponse:e=>{c(e),f(!1),setTimeout(()=>{f(!0)},1)},handleEncounterCreate:d,handleOnValidate:m,showDiscardSubmitButtons:!1,preFilledQuestions:{...y,encDate:y.sessionDate},hideControls:!0,hidePatientBanner:_}}))}},8269(e,t,a){a.d(t,{Ay:()=>_,SR:()=>m});var n=a(7979),s=a.n(n),i=a(6984),r=a(9943),l=a(8345),o=a(5725);let u={setGroup:e=>void 0,unsetGroup:()=>void 0,setSessionMeta:e=>void 0,openPatientSearch:()=>void 0,saveEncounter:e=>void 0,editEncounter:e=>void 0,validateForNext:()=>void 0,validateForComplete:()=>void 0,updateVisitUuid:e=>void 0,submitForNext:(e=null)=>void 0,submitForReview:()=>void 0,submitForComplete:()=>void 0,addPatientUuid:e=>void 0,removePatientUuid:e=>void 0,goToReview:()=>void 0,destroySession:()=>void 0,closeSession:()=>void 0},c={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,activeSessionUuid:null,activeVisitUuid:null,patientUuids:[],encounters:{},visits:{},activeGroupUuid:null,activeGroupName:null,activeGroupMembers:[],activeSessionMeta:{sessionName:null,practitionerName:null,sessionDate:null,sessionNotes:null},groupVisitTypeUuid:null,userUuid:null},d=s().createContext({...c,...u}),m=({children:e})=>{let{user:t}=(0,l.useSession)(),{formUuid:a}=(0,r.useParams)(),m=a.split("&")[0],_=(0,o.A)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),p=_?.result?.data?.results?.[0]?.value,[v,y]=(0,n.useReducer)(i.Ay,{...c,...u}),E=(0,n.useMemo)(()=>({initializeWorkflowState:({activeFormUuid:e})=>y({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:e,userUuid:t.uuid}),setGroup:e=>y({type:"SET_GROUP",group:e}),unsetGroup:()=>y({type:"UNSET_GROUP"}),setSessionMeta:e=>y({type:"SET_SESSION_META",meta:e}),addPatientUuid:e=>y({type:"ADD_PATIENT_UUID",patientUuid:e}),removePatientUuid:e=>y({type:"REMOVE_PATIENT_UUID",patientUuid:e}),openPatientSearch:()=>y({type:"OPEN_PATIENT_SEARCH"}),saveEncounter:e=>y({type:"SAVE_ENCOUNTER",encounterUuid:e}),validateForNext:()=>y({type:"VALIDATE_FOR_NEXT"}),validateForComplete:()=>y({type:"VALIDATE_FOR_COMPLETE"}),updateVisitUuid:e=>y({type:"UPDATE_VISIT_UUID",visitUuid:e}),submitForNext:e=>y({type:"SUBMIT_FOR_NEXT",nextPatientUuid:e}),submitForComplete:()=>y({type:"SUBMIT_FOR_COMPLETE"}),editEncounter:e=>y({type:"EDIT_ENCOUNTER",patientUuid:e}),goToReview:()=>y({type:"GO_TO_REVIEW"}),destroySession:()=>y({type:"DESTROY_SESSION"}),closeSession:()=>y({type:"CLOSE_SESSION"})}),[t]);return(0,n.useEffect)(()=>{v?.workflowState===null&&m&&E.initializeWorkflowState({activeFormUuid:m})},[m,v?.workflowState,E]),s().createElement(d.Provider,{value:{groupVisitTypeUuid:p,...v,...E,workflowState:v.forms?.[v.activeFormUuid]?.workflowState??c.workflowState,activeSessionUuid:v.forms?.[v.activeFormUuid]?.activeSessionUuid??c.activeSessionUuid,activePatientUuid:v.forms?.[v.activeFormUuid]?.activePatientUuid??c.activePatientUuid,activeEncounterUuid:v.forms?.[v.activeFormUuid]?.activeEncounterUuid??c.activeEncounterUuid,activeVisitUuid:v.forms?.[v.activeFormUuid]?.activeVisitUuid??c.activeVisitUuid,patientUuids:v.forms?.[v.activeFormUuid]?.patientUuids??c.patientUuids,encounters:v.forms?.[v.activeFormUuid]?.encounters??c.encounters,activeGroupUuid:v.forms?.[v.activeFormUuid]?.groupUuid??c.activeGroupUuid,activeGroupName:v.forms?.[v.activeFormUuid]?.groupName??c.activeGroupName,activeGroupMembers:v.forms?.[v.activeFormUuid]?.groupMembers??c.activeGroupMembers,activeSessionMeta:v.forms?.[v.activeFormUuid]?.sessionMeta??c.activeSessionMeta}},e)},_=d},3462(e,t,a){a.r(t),a.d(t,{default:()=>P});var n=a(7979),s=a.n(n),i=a(3826),r=a(8414),l=a(3392),o=a(8345),u=a(5852),c=a(5246),d=a(6433);let m="-esm-fast-data-entry__styles__patientInfoRow___W+Ndf";var _=a(1291);let p=()=>s().createElement("div",{className:"-esm-fast-data-entry__styles__container___SoIRW"},s().createElement(l.SkeletonPlaceholder,{className:"-esm-fast-data-entry__styles__photoPlaceholder___54jNW"}),s().createElement("div",{className:"-esm-fast-data-entry__styles__patientInfoContent___E8vUq"},s().createElement("div",{className:m},s().createElement(l.SkeletonText,{width:"7rem",lineCount:1})),s().createElement("div",{className:m},s().createElement("span",null,s().createElement(l.SkeletonText,{width:"1rem",lineCount:1})),s().createElement("span",null,"\xb7"),s().createElement("span",null,s().createElement(l.SkeletonText,{width:"1rem",lineCount:1})),s().createElement("span",null,"\xb7"),s().createElement("span",null,s().createElement(l.SkeletonText,{width:"1rem",lineCount:1}))))),v=({patient:e,hideActionsOverflow:t})=>s().createElement("div",{className:"-esm-fast-data-entry__styles__patientBannerContainer___wVhFg"},s().createElement(o.ExtensionSlot,{name:"patient-header-slot",state:{patient:e,patientUuid:e.id,hideActionsOverflow:t}})),y=()=>{let{activePatientUuid:e,workflowState:t}=(0,n.useContext)(u.Ay),a=(0,_.A)(e),{t:r}=(0,i.useTranslation)(),l=`${a?.name?.[0].given?.join(" ")} ${a?.name?.[0]?.family}`;return((0,n.useMemo)(()=>({patientUuid:a?.id,patientName:l,size:"small"}),[a?.id,l]),"NEW_PATIENT"===t)?null:a?s().createElement(v,{patient:a,hideActionsOverflow:!0}):s().createElement(p,null)};var E=a(9943),f=a(2137),U=a(9184),S=a(4961);let N="-esm-fast-data-entry__styles__padded___zXmH0",C=()=>{let[e,t]=(0,n.useState)(),{hsuIdentifier:a}=(0,S.i)(e),{sessionLocation:r}=(0,o.useSession)(),{uuid:c,display:d}=r??{},{uuid:m,display:_}=a?.location??{},p=(0,o.useConfig)(),{addPatient:v,workflowState:y,activeFormUuid:C}=(0,n.useContext)(u.Ay),{t:h}=(0,i.useTranslation)(),T=(0,n.useCallback)(()=>{v(e),t(null)},[v,e]);(0,n.useEffect)(()=>{t(null)},[C]);let w=(0,n.useCallback)(e=>{t(e)},[]);if((0,n.useEffect)(()=>{if(!e||!m)return;let a=c!==m;if(p.enforcePatientListLocationMatch&&a)(0,o.showSnackbar)({kind:"error",title:h("locationMismatch","Location Mismatch"),subtitle:h("patientLocationMismatchEnforced","Cannot add patient from {{hsuLocation}} to a session at {{sessionLocation}}",{hsuLocation:_,sessionLocation:d})}),t(null);else if(p.patientLocationMismatchCheck&&a){let e=!0,a=(0,o.showModal)("fde-patient-location-mismatch-modal",{onConfirm:T,sessionLocation:{uuid:c,display:d},hsuLocation:{uuid:m,display:_}},()=>{e&&t(null)});return()=>{e=!1,a()}}else v(e),t(null)},[e,c,d,m,_,v,p.patientLocationMismatchCheck,p.enforcePatientListLocationMatch,h,T]),"NEW_PATIENT"!==y)return null;let k=encodeURIComponent(`\${openmrsSpaBase}/forms/form/${C}?patientUuid=\${patientUuid}`),g=(0,o.interpolateUrl)(`\${openmrsSpaBase}/patient-registration?afterUrl=${k}`);return s().createElement(s().Fragment,null,s().createElement("div",{className:"-esm-fast-data-entry__styles__searchHeaderContainer___TC41U"},s().createElement("span",{className:N},h("nextPatient","Next patient"),":"),s().createElement("span",{className:"-esm-fast-data-entry__styles__searchBarWrapper___DhwCd"},s().createElement(o.ExtensionSlot,{name:"patient-search-bar-slot",state:{selectPatientAction:w,buttonProps:{kind:"primary"}}})),s().createElement("span",{className:N},h("or","or")),s().createElement("span",null,s().createElement(l.Button,{onClick:()=>(0,o.navigate)({to:g})},h("createNewPatient","Create new patient")," ",s().createElement(f.OM,{size:20}))),s().createElement("span",{style:{flexGrow:1}}),s().createElement("span",null,s().createElement(E.Link,{to:"../"},s().createElement(l.Button,{kind:"ghost"},h("cancel","Cancel")," ",s().createElement(U.bm,{size:20}))))))};var h=a(5565);let T={formReviewCard:"-esm-fast-data-entry__styles__formReviewCard___d2pGC",dataField:"-esm-fast-data-entry__styles__dataField___6nD1e",displayName:"-esm-fast-data-entry__styles__displayName___UT2b0",identifier:"-esm-fast-data-entry__styles__identifier___aCyxC"},w=({patientUuid:e})=>{let{encounters:t,editEncounter:a}=(0,n.useContext)(u.Ay),r=(0,h.J0)(e),o=r?.name?.[0]?.given?.[0],c=r?.name?.[0]?.family,d=r?.identifier?.[0]?.value,m=t?.[e],{encounter:_}=(0,h.XT)(m),{t:p}=(0,i.useTranslation)();return s().createElement("div",{className:T.formReviewCard},s().createElement(l.Accordion,{align:"start"},s().createElement(l.AccordionItem,{title:s().createElement(s().Fragment,null,s().createElement("span",{className:T.identifier},d),s().createElement("span",{className:T.displayName},o," ",c)),className:T.accordionItem},_&&_?.obs&&_.obs?.length&&s().createElement("div",{className:T.dataField},s().createElement("ul",null,_.obs.map((e,t)=>s().createElement("li",{key:t},e.display)))),s().createElement(l.Button,{kind:"primary",onClick:()=>a(e)},p("goToForm","Go To Form")))))},k=()=>{let{patientUuids:e}=(0,n.useContext)(u.Ay),{t}=(0,i.useTranslation)(),a=(0,E.useNavigate)();return s().createElement("div",{className:"-esm-fast-data-entry__styles__workspaceWrapper___HTRkA"},s().createElement("div",{className:"-esm-fast-data-entry__styles__workspace___NUbti"},s().createElement("div",{className:"-esm-fast-data-entry__styles__leftPanel___6U81E"},s().createElement("h4",null,t("review","Review")),s().createElement("div",{className:"-esm-fast-data-entry__styles__navButtons___yACI6"},s().createElement(l.Button,{kind:"primary",onClick:()=>a("/")},t("save&close","Save & Close")),s().createElement(l.Button,{kind:"tertiary",onClick:()=>a("/")},t("cancel","Cancel")))),s().createElement("div",{className:"-esm-fast-data-entry__styles__formContainer___T-7kl"},e.map(e=>s().createElement(w,{patientUuid:e,key:e})))))},g=()=>{let e=(0,n.useContext)(u.Ay),{workflowState:t,destroySession:a}=e,r=(0,n.useRef)();(0,n.useEffect)(()=>()=>{r.current?.()},[e.activeFormUuid]);let{t:c}=(0,i.useTranslation)();return t?s().createElement(s().Fragment,null,s().createElement("div",{className:"-esm-fast-data-entry__styles__rightPanelActionButtons___iNYXP"},s().createElement(l.Button,{kind:"secondary",onClick:"NEW_PATIENT"===t?()=>a():()=>{r.current?.(),r.current=(0,o.showModal)("fde-complete-session-modal",{onComplete:e.submitForComplete})}},c("saveAndComplete","Save & Complete")),s().createElement(l.Button,{kind:"tertiary",onClick:()=>{r.current?.(),r.current=(0,o.showModal)("fde-cancel-session-modal",{onDiscard:e.destroySession,onSaveAndClose:e.closeSession})}},c("cancel","Cancel")))):null},A=()=>{let{patientUuids:e,activePatientUuid:t,activeEncounterUuid:a,saveEncounter:l,activeFormUuid:m,editEncounter:_,encounters:p,singleSessionVisitTypeUuid:v}=(0,n.useContext)(u.Ay),{t:y}=(0,i.useTranslation)(),[E,f]=(0,n.useState)(null),[U,S]=(0,n.useState)(null),{sessionLocation:N}=(0,o.useSession)(),{updateEncounter:C,success:h}=(({showSuccessNotification:e=!0,showErrorNotification:t=!0})=>{let{t:a}=(0,i.useTranslation)(),[s,r]=(0,n.useState)(!1),[l,u]=(0,n.useState)(null),[c,d]=(0,n.useState)(null),m=(0,n.useCallback)(t=>{r(!1),d(!1),u(t),e&&(0,o.showSnackbar)({kind:"success",subtitle:a("visitStartedSuccessfully",`${t?.data?.visitType?.display} started successfully`),title:a("visitStarted","Visit started")})},[a,e]),_=(0,n.useCallback)(e=>{r(!1),u(!1),d(e),t&&(0,o.showNotification)({title:a("startVisitError","Error starting visit"),kind:"error",critical:!0,description:e?.message})},[a,t]);return{saveVisit:(0,n.useCallback)(e=>{let t={patient:e.patientUuid,startDatetime:e.startDatetime,stopDatetime:e.stopDatetime,visitType:e.visitType,location:e.location};(0,o.openmrsFetch)(`${o.restBaseUrl}/visit`,{method:"POST",body:t,headers:{"Content-Type":"application/json"}}).then(m).catch(_)},[_,m]),updateEncounter:(0,n.useCallback)(e=>{(0,o.openmrsFetch)(`${o.restBaseUrl}/encounter/`+e.uuid,{method:"POST",body:{visit:e.visit},headers:{"Content-Type":"application/json"}})},[]),success:l,error:c,isSubmitting:s}})({showSuccessNotification:!1,showErrorNotification:!0});(0,n.useEffect)(()=>{E&&U&&C({uuid:E.uuid,visit:U.uuid})},[E,U,C]),(0,n.useEffect)(()=>{h&&S(h.data)},[h]);let T=(0,n.useCallback)(e=>{e.location=N?.uuid,e.encounterDatetime=e.encounterDatetime?e.encounterDatetime:new Date().toISOString();let a={startDatetime:new Date(e.encounterDatetime),stopDatetime:new Date(e.encounterDatetime),uuid:(0,r.A)(),patient:{uuid:t},location:{uuid:N?.uuid},visitType:{uuid:v}};e.visit=a},[t,v,N]);return s().createElement("div",{className:"-esm-fast-data-entry__styles__workspace___IqIXu"},!e.length&&s().createElement("div",{className:"-esm-fast-data-entry__styles__selectPatientMessage___JbDJX"},y("selectPatientFirst","Please select a patient first")),!!e.length&&s().createElement("div",{className:"-esm-fast-data-entry__styles__formMainContent___tX0lw"},s().createElement("div",{className:"-esm-fast-data-entry__styles__formContainer___mWOmj"},s().createElement(c.A,{patientUuid:t,encounterUuid:a,formUuid:m,handlePostResponse:e=>{e&&e.uuid&&(l(e.uuid),f(e))},handleEncounterCreate:T,hidePatientBanner:!0})),s().createElement("div",{className:"-esm-fast-data-entry__styles__rightPanel___AHxE+"},s().createElement("h4",null,y("formsFilled","Forms filled")),s().createElement("div",{className:"-esm-fast-data-entry__styles__patientCardsSection___Agw0T"},e.map(e=>s().createElement(d.A,{key:e,patientUuid:e,activePatientUuid:t,editEncounter:_,encounters:p}))),s().createElement(g,null))))},F=()=>{let{workflowState:e}=(0,n.useContext)(u.Ay);return s().createElement(s().Fragment,null,"REVIEW"===e&&s().createElement(k,null),"REVIEW"!==e&&s().createElement(s().Fragment,null,s().createElement(C,null),s().createElement(y,null),s().createElement("div",{className:"-esm-fast-data-entry__styles__workspaceWrapper___IV-DF"},s().createElement(A,null))))},P=()=>s().createElement(u.Z1,null,s().createElement(F,null))},5565(e,t,a){a.d(t,{J0:()=>d.A,XT:()=>c,mr:()=>o}),a(7979);var n=a(8345),s=a(1943),i=a.n(s);let r="(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))",l=`${n.restBaseUrl}/form?v=custom:${r}`,o=(n.restBaseUrl,function(e=!1){let t=(0,n.useSession)(),{data:a,error:s}=i()([l,e],async()=>{let e=await (0,n.openmrsFetch)(l);return e.data?.results?.filter(e=>e.published&&!/component/i.test(e.name))??[]});return{forms:a?.filter(e=>!!(0,n.userHasAccess)(e.encounterType?.editPrivilege?.display,t?.user)),isLoading:!s&&!a,error:s}}),u=`${n.restBaseUrl}/encounter/`,c=e=>{let t=`${u}${e}`,{data:a,error:s}=i()(t,async()=>(await (0,n.openmrsFetch)(t)).data||null);return{encounter:a,isLoading:!s&&a,error:s}};var d=a(1291);a(5301)},4961(e,t,a){a.d(t,{i:()=>r});var n=a(1943),s=a.n(n),i=a(8345);function r(e){let t=e?`ws/rest/v1/patient/${e}/identifier`:null,{data:a,error:n,isValidating:r}=s()(t,i.openmrsFetch);return{hsuIdentifier:a?.data?.results.length?a.data.results.find(e=>"05a29f94-c0ed-11e2-94be-8c13b969e334"==e.identifierType.uuid):void 0,isLoading:!a&&!n,isError:n,isValidating:r}}},6433(e,t,a){a.d(t,{A:()=>c});var n=a(9184),s=a(2383),i=a(3392),r=a(7979),l=a.n(r),o=a(1291);let u=({onClick:e=()=>void 0,active:t,children:a})=>l().createElement("div",{onClick:e,className:`-esm-fast-data-entry__styles__cardContainer___r35b+ ${!t&&"-esm-fast-data-entry__styles__inactiveCard___mgnR5"}`,role:"button",tabIndex:0},a),c=({patientUuid:e,activePatientUuid:t,editEncounter:a,encounters:r})=>{let c=(0,o.A)(e),d=c?.name?.[0]?.given?.[0],m=c?.name?.[0]?.family,_=c?.identifier?.[0]?.value;if(!c)return l().createElement(u,{active:!0},l().createElement(i.SkeletonText,{className:"-esm-fast-data-entry__styles__skeletonText___W2uKh"}));let p=t===e;return l().createElement(u,{onClick:p?()=>void 0:()=>a(e),active:p},l().createElement("div",{className:"-esm-fast-data-entry__styles__patientInfo___dsLIV"},l().createElement("div",{className:"-esm-fast-data-entry__styles__identifier___pA+fq"},_),l().createElement("div",{className:`-esm-fast-data-entry__styles__displayName___n+VZ8 ${p&&"-esm-fast-data-entry__styles__activeDisplayName___furnV"}`},d," ",m)),l().createElement("div",null,e in r?l().createElement(n.cR,{size:16,className:"-esm-fast-data-entry__styles__statusSuccess___1nZk2"}):l().createElement(s.Cp,{size:16,className:"-esm-fast-data-entry__styles__statusWarning___QxLWO"})))}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["6107"],{8414(e,t,a){let n;a.d(t,{A:()=>l});let s="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),i=new Uint8Array(16),r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).slice(1));let l=function(e,t,a){if(s&&!t&&!e)return s();let l=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)})();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t){a=a||0;for(let e=0;e<16;++e)t[a+e]=l[e];return t}return function(e,t=0){return r[e[t+0]]+r[e[t+1]]+r[e[t+2]]+r[e[t+3]]+"-"+r[e[t+4]]+r[e[t+5]]+"-"+r[e[t+6]]+r[e[t+7]]+"-"+r[e[t+8]]+r[e[t+9]]+"-"+r[e[t+10]]+r[e[t+11]]+r[e[t+12]]+r[e[t+13]]+r[e[t+14]]+r[e[t+15]]}(l)}},5246(e,t,a){a.d(t,{A:()=>o});var n=a(7979),s=a.n(n),i=a(2908),r=a(1291),l=a(8269);let o=({formUuid:e,patientUuid:t,visitUuid:a,visitTypeUuid:o,encounterUuid:u,handlePostResponse:c,handleEncounterCreate:d,handleOnValidate:m,hidePatientBanner:_})=>{let p=(0,r.A)(t),v=p?.id===t,{activeSessionMeta:y}=(0,n.useContext)(l.Ay);(0,n.useEffect)(()=>()=>(0,i.detach)("form-widget-slot","form-widget-slot"),[]);let[E,f]=(0,n.useState)(!0),U=E&&e&&t&&p&&v;return s().createElement("div",null,U&&s().createElement(i.ExtensionSlot,{name:"form-widget-slot",state:{view:"form",formUuid:e,visitUuid:a??"",visitTypeUuid:o??"",patientUuid:t,patient:p,encounterUuid:u??"",closeWorkspace:()=>void 0,handlePostResponse:e=>{c(e),f(!1),setTimeout(()=>{f(!0)},1)},handleEncounterCreate:d,handleOnValidate:m,showDiscardSubmitButtons:!1,preFilledQuestions:{...y,encDate:y.sessionDate},hideControls:!0,hidePatientBanner:_}}))}},8269(e,t,a){a.d(t,{Ay:()=>_,SR:()=>m});var n=a(7979),s=a.n(n),i=a(6984),r=a(9943),l=a(2908),o=a(5725);let u={setGroup:e=>void 0,unsetGroup:()=>void 0,setSessionMeta:e=>void 0,openPatientSearch:()=>void 0,saveEncounter:e=>void 0,editEncounter:e=>void 0,validateForNext:()=>void 0,validateForComplete:()=>void 0,updateVisitUuid:e=>void 0,submitForNext:(e=null)=>void 0,submitForReview:()=>void 0,submitForComplete:()=>void 0,addPatientUuid:e=>void 0,removePatientUuid:e=>void 0,goToReview:()=>void 0,destroySession:()=>void 0,closeSession:()=>void 0},c={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,activeSessionUuid:null,activeVisitUuid:null,patientUuids:[],encounters:{},visits:{},activeGroupUuid:null,activeGroupName:null,activeGroupMembers:[],activeSessionMeta:{sessionName:null,practitionerName:null,sessionDate:null,sessionNotes:null},groupVisitTypeUuid:null,userUuid:null},d=s().createContext({...c,...u}),m=({children:e})=>{let{user:t}=(0,l.useSession)(),{formUuid:a}=(0,r.useParams)(),m=a.split("&")[0],_=(0,o.A)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),p=_?.result?.data?.results?.[0]?.value,[v,y]=(0,n.useReducer)(i.Ay,{...c,...u}),E=(0,n.useMemo)(()=>({initializeWorkflowState:({activeFormUuid:e})=>y({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:e,userUuid:t.uuid}),setGroup:e=>y({type:"SET_GROUP",group:e}),unsetGroup:()=>y({type:"UNSET_GROUP"}),setSessionMeta:e=>y({type:"SET_SESSION_META",meta:e}),addPatientUuid:e=>y({type:"ADD_PATIENT_UUID",patientUuid:e}),removePatientUuid:e=>y({type:"REMOVE_PATIENT_UUID",patientUuid:e}),openPatientSearch:()=>y({type:"OPEN_PATIENT_SEARCH"}),saveEncounter:e=>y({type:"SAVE_ENCOUNTER",encounterUuid:e}),validateForNext:()=>y({type:"VALIDATE_FOR_NEXT"}),validateForComplete:()=>y({type:"VALIDATE_FOR_COMPLETE"}),updateVisitUuid:e=>y({type:"UPDATE_VISIT_UUID",visitUuid:e}),submitForNext:e=>y({type:"SUBMIT_FOR_NEXT",nextPatientUuid:e}),submitForComplete:()=>y({type:"SUBMIT_FOR_COMPLETE"}),editEncounter:e=>y({type:"EDIT_ENCOUNTER",patientUuid:e}),goToReview:()=>y({type:"GO_TO_REVIEW"}),destroySession:()=>y({type:"DESTROY_SESSION"}),closeSession:()=>y({type:"CLOSE_SESSION"})}),[t]);return(0,n.useEffect)(()=>{v?.workflowState===null&&m&&E.initializeWorkflowState({activeFormUuid:m})},[m,v?.workflowState,E]),s().createElement(d.Provider,{value:{groupVisitTypeUuid:p,...v,...E,workflowState:v.forms?.[v.activeFormUuid]?.workflowState??c.workflowState,activeSessionUuid:v.forms?.[v.activeFormUuid]?.activeSessionUuid??c.activeSessionUuid,activePatientUuid:v.forms?.[v.activeFormUuid]?.activePatientUuid??c.activePatientUuid,activeEncounterUuid:v.forms?.[v.activeFormUuid]?.activeEncounterUuid??c.activeEncounterUuid,activeVisitUuid:v.forms?.[v.activeFormUuid]?.activeVisitUuid??c.activeVisitUuid,patientUuids:v.forms?.[v.activeFormUuid]?.patientUuids??c.patientUuids,encounters:v.forms?.[v.activeFormUuid]?.encounters??c.encounters,activeGroupUuid:v.forms?.[v.activeFormUuid]?.groupUuid??c.activeGroupUuid,activeGroupName:v.forms?.[v.activeFormUuid]?.groupName??c.activeGroupName,activeGroupMembers:v.forms?.[v.activeFormUuid]?.groupMembers??c.activeGroupMembers,activeSessionMeta:v.forms?.[v.activeFormUuid]?.sessionMeta??c.activeSessionMeta}},e)},_=d},3462(e,t,a){a.r(t),a.d(t,{default:()=>P});var n=a(7979),s=a.n(n),i=a(3826),r=a(8414),l=a(3392),o=a(2908),u=a(5852),c=a(5246),d=a(6433);let m="-esm-fast-data-entry__styles__patientInfoRow___W+Ndf";var _=a(1291);let p=()=>s().createElement("div",{className:"-esm-fast-data-entry__styles__container___SoIRW"},s().createElement(l.SkeletonPlaceholder,{className:"-esm-fast-data-entry__styles__photoPlaceholder___54jNW"}),s().createElement("div",{className:"-esm-fast-data-entry__styles__patientInfoContent___E8vUq"},s().createElement("div",{className:m},s().createElement(l.SkeletonText,{width:"7rem",lineCount:1})),s().createElement("div",{className:m},s().createElement("span",null,s().createElement(l.SkeletonText,{width:"1rem",lineCount:1})),s().createElement("span",null,"\xb7"),s().createElement("span",null,s().createElement(l.SkeletonText,{width:"1rem",lineCount:1})),s().createElement("span",null,"\xb7"),s().createElement("span",null,s().createElement(l.SkeletonText,{width:"1rem",lineCount:1}))))),v=({patient:e,hideActionsOverflow:t})=>s().createElement("div",{className:"-esm-fast-data-entry__styles__patientBannerContainer___wVhFg"},s().createElement(o.ExtensionSlot,{name:"patient-header-slot",state:{patient:e,patientUuid:e.id,hideActionsOverflow:t}})),y=()=>{let{activePatientUuid:e,workflowState:t}=(0,n.useContext)(u.Ay),a=(0,_.A)(e),{t:r}=(0,i.useTranslation)(),l=`${a?.name?.[0].given?.join(" ")} ${a?.name?.[0]?.family}`;return((0,n.useMemo)(()=>({patientUuid:a?.id,patientName:l,size:"small"}),[a?.id,l]),"NEW_PATIENT"===t)?null:a?s().createElement(v,{patient:a,hideActionsOverflow:!0}):s().createElement(p,null)};var E=a(9943),f=a(2137),U=a(9184),S=a(4961);let N="-esm-fast-data-entry__styles__padded___zXmH0",C=()=>{let[e,t]=(0,n.useState)(),{hsuIdentifier:a}=(0,S.i)(e),{sessionLocation:r}=(0,o.useSession)(),{uuid:c,display:d}=r??{},{uuid:m,display:_}=a?.location??{},p=(0,o.useConfig)(),{addPatient:v,workflowState:y,activeFormUuid:C}=(0,n.useContext)(u.Ay),{t:h}=(0,i.useTranslation)(),T=(0,n.useCallback)(()=>{v(e),t(null)},[v,e]);(0,n.useEffect)(()=>{t(null)},[C]);let w=(0,n.useCallback)(e=>{t(e)},[]);if((0,n.useEffect)(()=>{if(!e||!m)return;let a=c!==m;if(p.enforcePatientListLocationMatch&&a)(0,o.showSnackbar)({kind:"error",title:h("locationMismatch","Location Mismatch"),subtitle:h("patientLocationMismatchEnforced","Cannot add patient from {{hsuLocation}} to a session at {{sessionLocation}}",{hsuLocation:_,sessionLocation:d})}),t(null);else if(p.patientLocationMismatchCheck&&a){let e=!0,a=(0,o.showModal)("fde-patient-location-mismatch-modal",{onConfirm:T,sessionLocation:{uuid:c,display:d},hsuLocation:{uuid:m,display:_}},()=>{e&&t(null)});return()=>{e=!1,a()}}else v(e),t(null)},[e,c,d,m,_,v,p.patientLocationMismatchCheck,p.enforcePatientListLocationMatch,h,T]),"NEW_PATIENT"!==y)return null;let k=encodeURIComponent(`\${openmrsSpaBase}/forms/form/${C}?patientUuid=\${patientUuid}`),g=(0,o.interpolateUrl)(`\${openmrsSpaBase}/patient-registration?afterUrl=${k}`);return s().createElement(s().Fragment,null,s().createElement("div",{className:"-esm-fast-data-entry__styles__searchHeaderContainer___TC41U"},s().createElement("span",{className:N},h("nextPatient","Next patient"),":"),s().createElement("span",{className:"-esm-fast-data-entry__styles__searchBarWrapper___DhwCd"},s().createElement(o.ExtensionSlot,{name:"patient-search-bar-slot",state:{selectPatientAction:w,buttonProps:{kind:"primary"}}})),s().createElement("span",{className:N},h("or","or")),s().createElement("span",null,s().createElement(l.Button,{onClick:()=>(0,o.navigate)({to:g})},h("createNewPatient","Create new patient")," ",s().createElement(f.OM,{size:20}))),s().createElement("span",{style:{flexGrow:1}}),s().createElement("span",null,s().createElement(E.Link,{to:"../"},s().createElement(l.Button,{kind:"ghost"},h("cancel","Cancel")," ",s().createElement(U.bm,{size:20}))))))};var h=a(5565);let T={formReviewCard:"-esm-fast-data-entry__styles__formReviewCard___d2pGC",dataField:"-esm-fast-data-entry__styles__dataField___6nD1e",displayName:"-esm-fast-data-entry__styles__displayName___UT2b0",identifier:"-esm-fast-data-entry__styles__identifier___aCyxC"},w=({patientUuid:e})=>{let{encounters:t,editEncounter:a}=(0,n.useContext)(u.Ay),r=(0,h.J0)(e),o=r?.name?.[0]?.given?.[0],c=r?.name?.[0]?.family,d=r?.identifier?.[0]?.value,m=t?.[e],{encounter:_}=(0,h.XT)(m),{t:p}=(0,i.useTranslation)();return s().createElement("div",{className:T.formReviewCard},s().createElement(l.Accordion,{align:"start"},s().createElement(l.AccordionItem,{title:s().createElement(s().Fragment,null,s().createElement("span",{className:T.identifier},d),s().createElement("span",{className:T.displayName},o," ",c)),className:T.accordionItem},_&&_?.obs&&_.obs?.length&&s().createElement("div",{className:T.dataField},s().createElement("ul",null,_.obs.map((e,t)=>s().createElement("li",{key:t},e.display)))),s().createElement(l.Button,{kind:"primary",onClick:()=>a(e)},p("goToForm","Go To Form")))))},k=()=>{let{patientUuids:e}=(0,n.useContext)(u.Ay),{t}=(0,i.useTranslation)(),a=(0,E.useNavigate)();return s().createElement("div",{className:"-esm-fast-data-entry__styles__workspaceWrapper___HTRkA"},s().createElement("div",{className:"-esm-fast-data-entry__styles__workspace___NUbti"},s().createElement("div",{className:"-esm-fast-data-entry__styles__leftPanel___6U81E"},s().createElement("h4",null,t("review","Review")),s().createElement("div",{className:"-esm-fast-data-entry__styles__navButtons___yACI6"},s().createElement(l.Button,{kind:"primary",onClick:()=>a("/")},t("save&close","Save & Close")),s().createElement(l.Button,{kind:"tertiary",onClick:()=>a("/")},t("cancel","Cancel")))),s().createElement("div",{className:"-esm-fast-data-entry__styles__formContainer___T-7kl"},e.map(e=>s().createElement(w,{patientUuid:e,key:e})))))},g=()=>{let e=(0,n.useContext)(u.Ay),{workflowState:t,destroySession:a}=e,r=(0,n.useRef)();(0,n.useEffect)(()=>()=>{r.current?.()},[e.activeFormUuid]);let{t:c}=(0,i.useTranslation)();return t?s().createElement(s().Fragment,null,s().createElement("div",{className:"-esm-fast-data-entry__styles__rightPanelActionButtons___iNYXP"},s().createElement(l.Button,{kind:"secondary",onClick:"NEW_PATIENT"===t?()=>a():()=>{r.current?.(),r.current=(0,o.showModal)("fde-complete-session-modal",{onComplete:e.submitForComplete})}},c("saveAndComplete","Save & Complete")),s().createElement(l.Button,{kind:"tertiary",onClick:()=>{r.current?.(),r.current=(0,o.showModal)("fde-cancel-session-modal",{onDiscard:e.destroySession,onSaveAndClose:e.closeSession})}},c("cancel","Cancel")))):null},A=()=>{let{patientUuids:e,activePatientUuid:t,activeEncounterUuid:a,saveEncounter:l,activeFormUuid:m,editEncounter:_,encounters:p,singleSessionVisitTypeUuid:v}=(0,n.useContext)(u.Ay),{t:y}=(0,i.useTranslation)(),[E,f]=(0,n.useState)(null),[U,S]=(0,n.useState)(null),{sessionLocation:N}=(0,o.useSession)(),{updateEncounter:C,success:h}=(({showSuccessNotification:e=!0,showErrorNotification:t=!0})=>{let{t:a}=(0,i.useTranslation)(),[s,r]=(0,n.useState)(!1),[l,u]=(0,n.useState)(null),[c,d]=(0,n.useState)(null),m=(0,n.useCallback)(t=>{r(!1),d(!1),u(t),e&&(0,o.showSnackbar)({kind:"success",subtitle:a("visitStartedSuccessfully",`${t?.data?.visitType?.display} started successfully`),title:a("visitStarted","Visit started")})},[a,e]),_=(0,n.useCallback)(e=>{r(!1),u(!1),d(e),t&&(0,o.showNotification)({title:a("startVisitError","Error starting visit"),kind:"error",critical:!0,description:e?.message})},[a,t]);return{saveVisit:(0,n.useCallback)(e=>{let t={patient:e.patientUuid,startDatetime:e.startDatetime,stopDatetime:e.stopDatetime,visitType:e.visitType,location:e.location};(0,o.openmrsFetch)(`${o.restBaseUrl}/visit`,{method:"POST",body:t,headers:{"Content-Type":"application/json"}}).then(m).catch(_)},[_,m]),updateEncounter:(0,n.useCallback)(e=>{(0,o.openmrsFetch)(`${o.restBaseUrl}/encounter/`+e.uuid,{method:"POST",body:{visit:e.visit},headers:{"Content-Type":"application/json"}})},[]),success:l,error:c,isSubmitting:s}})({showSuccessNotification:!1,showErrorNotification:!0});(0,n.useEffect)(()=>{E&&U&&C({uuid:E.uuid,visit:U.uuid})},[E,U,C]),(0,n.useEffect)(()=>{h&&S(h.data)},[h]);let T=(0,n.useCallback)(e=>{e.location=N?.uuid,e.encounterDatetime=e.encounterDatetime?e.encounterDatetime:new Date().toISOString();let a={startDatetime:new Date(e.encounterDatetime),stopDatetime:new Date(e.encounterDatetime),uuid:(0,r.A)(),patient:{uuid:t},location:{uuid:N?.uuid},visitType:{uuid:v}};e.visit=a},[t,v,N]);return s().createElement("div",{className:"-esm-fast-data-entry__styles__workspace___IqIXu"},!e.length&&s().createElement("div",{className:"-esm-fast-data-entry__styles__selectPatientMessage___JbDJX"},y("selectPatientFirst","Please select a patient first")),!!e.length&&s().createElement("div",{className:"-esm-fast-data-entry__styles__formMainContent___tX0lw"},s().createElement("div",{className:"-esm-fast-data-entry__styles__formContainer___mWOmj"},s().createElement(c.A,{patientUuid:t,encounterUuid:a,formUuid:m,handlePostResponse:e=>{e&&e.uuid&&(l(e.uuid),f(e))},handleEncounterCreate:T,hidePatientBanner:!0})),s().createElement("div",{className:"-esm-fast-data-entry__styles__rightPanel___AHxE+"},s().createElement("h4",null,y("formsFilled","Forms filled")),s().createElement("div",{className:"-esm-fast-data-entry__styles__patientCardsSection___Agw0T"},e.map(e=>s().createElement(d.A,{key:e,patientUuid:e,activePatientUuid:t,editEncounter:_,encounters:p}))),s().createElement(g,null))))},F=()=>{let{workflowState:e}=(0,n.useContext)(u.Ay);return s().createElement(s().Fragment,null,"REVIEW"===e&&s().createElement(k,null),"REVIEW"!==e&&s().createElement(s().Fragment,null,s().createElement(C,null),s().createElement(y,null),s().createElement("div",{className:"-esm-fast-data-entry__styles__workspaceWrapper___IV-DF"},s().createElement(A,null))))},P=()=>s().createElement(u.Z1,null,s().createElement(F,null))},5565(e,t,a){a.d(t,{J0:()=>d.A,XT:()=>c,mr:()=>o}),a(7979);var n=a(2908),s=a(1943),i=a.n(s);let r="(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))",l=`${n.restBaseUrl}/form?v=custom:${r}`,o=(n.restBaseUrl,function(e=!1){let t=(0,n.useSession)(),{data:a,error:s}=i()([l,e],async()=>{let e=await (0,n.openmrsFetch)(l);return e.data?.results?.filter(e=>e.published&&!/component/i.test(e.name))??[]});return{forms:a?.filter(e=>!!(0,n.userHasAccess)(e.encounterType?.editPrivilege?.display,t?.user)),isLoading:!s&&!a,error:s}}),u=`${n.restBaseUrl}/encounter/`,c=e=>{let t=`${u}${e}`,{data:a,error:s}=i()(t,async()=>(await (0,n.openmrsFetch)(t)).data||null);return{encounter:a,isLoading:!s&&a,error:s}};var d=a(1291);a(5301)},4961(e,t,a){a.d(t,{i:()=>r});var n=a(1943),s=a.n(n),i=a(2908);function r(e){let t=e?`ws/rest/v1/patient/${e}/identifier`:null,{data:a,error:n,isValidating:r}=s()(t,i.openmrsFetch);return{hsuIdentifier:a?.data?.results.length?a.data.results.find(e=>"05a29f94-c0ed-11e2-94be-8c13b969e334"==e.identifierType.uuid):void 0,isLoading:!a&&!n,isError:n,isValidating:r}}},6433(e,t,a){a.d(t,{A:()=>c});var n=a(9184),s=a(2383),i=a(3392),r=a(7979),l=a.n(r),o=a(1291);let u=({onClick:e=()=>void 0,active:t,children:a})=>l().createElement("div",{onClick:e,className:`-esm-fast-data-entry__styles__cardContainer___r35b+ ${!t&&"-esm-fast-data-entry__styles__inactiveCard___mgnR5"}`,role:"button",tabIndex:0},a),c=({patientUuid:e,activePatientUuid:t,editEncounter:a,encounters:r})=>{let c=(0,o.A)(e),d=c?.name?.[0]?.given?.[0],m=c?.name?.[0]?.family,_=c?.identifier?.[0]?.value;if(!c)return l().createElement(u,{active:!0},l().createElement(i.SkeletonText,{className:"-esm-fast-data-entry__styles__skeletonText___W2uKh"}));let p=t===e;return l().createElement(u,{onClick:p?()=>void 0:()=>a(e),active:p},l().createElement("div",{className:"-esm-fast-data-entry__styles__patientInfo___dsLIV"},l().createElement("div",{className:"-esm-fast-data-entry__styles__identifier___pA+fq"},_),l().createElement("div",{className:`-esm-fast-data-entry__styles__displayName___n+VZ8 ${p&&"-esm-fast-data-entry__styles__activeDisplayName___furnV"}`},d," ",m)),l().createElement("div",null,e in r?l().createElement(n.cR,{size:16,className:"-esm-fast-data-entry__styles__statusSuccess___1nZk2"}):l().createElement(s.Cp,{size:16,className:"-esm-fast-data-entry__styles__statusWarning___QxLWO"})))}}}]);
|
package/dist/6606.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["6606"],{5246(e,t,a){a.d(t,{A:()=>o});var n=a(7979),l=a.n(n),s=a(8345),r=a(1291),i=a(8269);let o=({formUuid:e,patientUuid:t,visitUuid:a,visitTypeUuid:o,encounterUuid:c,handlePostResponse:u,handleEncounterCreate:m,handleOnValidate:d,hidePatientBanner:_})=>{let p=(0,r.A)(t),E=p?.id===t,{activeSessionMeta:f}=(0,n.useContext)(i.Ay);(0,n.useEffect)(()=>()=>(0,s.detach)("form-widget-slot","form-widget-slot"),[]);let[y,v]=(0,n.useState)(!0),h=y&&e&&t&&p&&E;return l().createElement("div",null,h&&l().createElement(s.ExtensionSlot,{name:"form-widget-slot",state:{view:"form",formUuid:e,visitUuid:a??"",visitTypeUuid:o??"",patientUuid:t,patient:p,encounterUuid:c??"",closeWorkspace:()=>void 0,handlePostResponse:e=>{u(e),v(!1),setTimeout(()=>{v(!0)},1)},handleEncounterCreate:m,handleOnValidate:d,showDiscardSubmitButtons:!1,preFilledQuestions:{...f,encDate:f.sessionDate},hideControls:!0,hidePatientBanner:_}}))}},8269(e,t,a){a.d(t,{Ay:()=>_,SR:()=>d});var n=a(7979),l=a.n(n),s=a(6984),r=a(9943),i=a(8345),o=a(5725);let c={setGroup:e=>void 0,unsetGroup:()=>void 0,setSessionMeta:e=>void 0,openPatientSearch:()=>void 0,saveEncounter:e=>void 0,editEncounter:e=>void 0,validateForNext:()=>void 0,validateForComplete:()=>void 0,updateVisitUuid:e=>void 0,submitForNext:(e=null)=>void 0,submitForReview:()=>void 0,submitForComplete:()=>void 0,addPatientUuid:e=>void 0,removePatientUuid:e=>void 0,goToReview:()=>void 0,destroySession:()=>void 0,closeSession:()=>void 0},u={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,activeSessionUuid:null,activeVisitUuid:null,patientUuids:[],encounters:{},visits:{},activeGroupUuid:null,activeGroupName:null,activeGroupMembers:[],activeSessionMeta:{sessionName:null,practitionerName:null,sessionDate:null,sessionNotes:null},groupVisitTypeUuid:null,userUuid:null},m=l().createContext({...u,...c}),d=({children:e})=>{let{user:t}=(0,i.useSession)(),{formUuid:a}=(0,r.useParams)(),d=a.split("&")[0],_=(0,o.A)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),p=_?.result?.data?.results?.[0]?.value,[E,f]=(0,n.useReducer)(s.Ay,{...u,...c}),y=(0,n.useMemo)(()=>({initializeWorkflowState:({activeFormUuid:e})=>f({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:e,userUuid:t.uuid}),setGroup:e=>f({type:"SET_GROUP",group:e}),unsetGroup:()=>f({type:"UNSET_GROUP"}),setSessionMeta:e=>f({type:"SET_SESSION_META",meta:e}),addPatientUuid:e=>f({type:"ADD_PATIENT_UUID",patientUuid:e}),removePatientUuid:e=>f({type:"REMOVE_PATIENT_UUID",patientUuid:e}),openPatientSearch:()=>f({type:"OPEN_PATIENT_SEARCH"}),saveEncounter:e=>f({type:"SAVE_ENCOUNTER",encounterUuid:e}),validateForNext:()=>f({type:"VALIDATE_FOR_NEXT"}),validateForComplete:()=>f({type:"VALIDATE_FOR_COMPLETE"}),updateVisitUuid:e=>f({type:"UPDATE_VISIT_UUID",visitUuid:e}),submitForNext:e=>f({type:"SUBMIT_FOR_NEXT",nextPatientUuid:e}),submitForComplete:()=>f({type:"SUBMIT_FOR_COMPLETE"}),editEncounter:e=>f({type:"EDIT_ENCOUNTER",patientUuid:e}),goToReview:()=>f({type:"GO_TO_REVIEW"}),destroySession:()=>f({type:"DESTROY_SESSION"}),closeSession:()=>f({type:"CLOSE_SESSION"})}),[t]);return(0,n.useEffect)(()=>{E?.workflowState===null&&d&&y.initializeWorkflowState({activeFormUuid:d})},[d,E?.workflowState,y]),l().createElement(m.Provider,{value:{groupVisitTypeUuid:p,...E,...y,workflowState:E.forms?.[E.activeFormUuid]?.workflowState??u.workflowState,activeSessionUuid:E.forms?.[E.activeFormUuid]?.activeSessionUuid??u.activeSessionUuid,activePatientUuid:E.forms?.[E.activeFormUuid]?.activePatientUuid??u.activePatientUuid,activeEncounterUuid:E.forms?.[E.activeFormUuid]?.activeEncounterUuid??u.activeEncounterUuid,activeVisitUuid:E.forms?.[E.activeFormUuid]?.activeVisitUuid??u.activeVisitUuid,patientUuids:E.forms?.[E.activeFormUuid]?.patientUuids??u.patientUuids,encounters:E.forms?.[E.activeFormUuid]?.encounters??u.encounters,activeGroupUuid:E.forms?.[E.activeFormUuid]?.groupUuid??u.activeGroupUuid,activeGroupName:E.forms?.[E.activeFormUuid]?.groupName??u.activeGroupName,activeGroupMembers:E.forms?.[E.activeFormUuid]?.groupMembers??u.activeGroupMembers,activeSessionMeta:E.forms?.[E.activeFormUuid]?.sessionMeta??u.activeSessionMeta}},e)},_=m},1369(e,t,a){a.d(t,{K:()=>s});var n=a(7979),l=a.n(n);let s=({width:e="64",height:t="64"})=>l().createElement("svg",{width:e,height:t,viewBox:"0 0 64 64"},l().createElement("title",null,"Empty data illustration"),l().createElement("g",{fill:"none",fillRule:"evenodd"},l().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),l().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),l().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),l().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),l().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),l().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),l().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),l().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),l().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),l().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},125(e,t,a){a.r(t),a.d(t,{default:()=>el});var n=a(7979),l=a.n(n),s=a(3392),r=a(771),i=a(9184);let o={container:"-esm-fast-data-entry__styles__container___wo4Op",photoPlaceholder:"-esm-fast-data-entry__styles__photoPlaceholder___d7h7b",groupAvatar:"-esm-fast-data-entry__styles__groupAvatar___C4sOM",groupName:"-esm-fast-data-entry__styles__groupName___AYYrA",groupInfoContent:"-esm-fast-data-entry__styles__groupInfoContent___TQDIY",groupInfoRow:"-esm-fast-data-entry__styles__groupInfoRow___pRcS2",sessionNotesLabel:"-esm-fast-data-entry__styles__sessionNotesLabel___bxDoq",groupEditBtn:"-esm-fast-data-entry__styles__groupEditBtn___zEDCG",groupMetaContent:"-esm-fast-data-entry__styles__groupMetaContent___9Nq-t"};var c=a(3826),u=a(8269);let m=()=>{let{activeGroupName:e,activeGroupUuid:t,patientUuids:a,activeSessionMeta:m,unsetGroup:d,destroySession:_}=(0,n.useContext)(u.Ay),{t:p}=(0,c.useTranslation)();return t?l().createElement("div",{className:o.container},l().createElement("div",{className:o.groupAvatar,role:"img"},l().createElement(r.sV,{size:48})),l().createElement("div",{className:o.groupInfoContent},l().createElement("div",{className:o.groupInfoRow},l().createElement("span",{className:o.groupName},e)),l().createElement("div",{className:o.groupInfoRow},l().createElement("span",null,a.length," ",p("members","members")))),m?.sessionNotes&&l().createElement("div",{className:o.groupMeataContent},l().createElement("div",{className:`${o.groupInfoRow} ${o.sessionNotesLabel}`},p("sessionNotes","Session Notes")),l().createElement("div",{className:o.groupInfoRow},m.sessionNotes)),l().createElement("span",{style:{flexGrow:1}}),l().createElement("span",null,l().createElement(s.Button,{kind:"ghost",onClick:()=>d()},p("changeGroup","Choose a different group")," ",l().createElement(i.bm,{size:20}))),l().createElement("span",null,l().createElement(s.Button,{kind:"ghost",onClick:()=>_()},p("cancel","Cancel")," ",l().createElement(i.bm,{size:20})))):null},d="-esm-fast-data-entry__styles__workspace___w1msl",_="-esm-fast-data-entry__styles__formMainContent___V0wb6",p="-esm-fast-data-entry__styles__formContainer___Dr0vH",E="-esm-fast-data-entry__styles__rightPanel___Cli99",f="-esm-fast-data-entry__styles__rightPanelActionButtons___mLqO-",y="-esm-fast-data-entry__styles__formSectionTile___EKij4";var v=a(2137),h=a(8345),g=a(1881);let N="-esm-fast-data-entry__group-search__searchResultsContainer___Abg8g",S="-esm-fast-data-entry__group-search__searchResults___FkkhX",C="-esm-fast-data-entry__group-search__emptySearchResultsTile___FQ9YZ";var T=a(1369);let b="-esm-fast-data-entry__compact-group-result__patientSearchResult___jRxdh",w="-esm-fast-data-entry__compact-group-result__patientName___jewR5",x="-esm-fast-data-entry__compact-group-result__patientAvatar___Cy+O8",U="-esm-fast-data-entry__compact-group-result__demographics___9-0Bw",k="-esm-fast-data-entry__compact-group-result__middot___C1wiJ",I=e=>{let[t,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let t=({key:t})=>{t===e&&a(!0)},n=({key:t})=>{t===e&&a(!1)};return window.addEventListener("keydown",t),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",n)}},[e]),t},F=(e,t)=>{switch(t.type){case"arrowUp":return{selectedIndex:Math.max(e.selectedIndex-1,0)};case"arrowDown":return{selectedIndex:Math.min(e.selectedIndex+1,t.listLength-1)};case"select":return{selectedIndex:t.payload};default:return e}},R={behavior:"smooth",block:"nearest"},A=({index:e,selectGroupAction:t,group:a,dispatch:s,state:i,totalGroups:o,lastRef:u})=>{let m=(0,n.useRef)(null),{t:d}=(0,c.useTranslation)();return(0,n.useEffect)(()=>{i.selectedIndex===o-1?u.current.scrollIntoView(R):i.selectedIndex===e&&m.current.scrollIntoView(R)},[i,e,o,u]),l().createElement("div",{onClick:()=>{s({type:"select",payload:e}),t(a)},className:`${b} ${e===i.selectedIndex&&"-esm-fast-data-entry__compact-group-result__patientSearchResultSelected___FQx0p"}`,role:"button","aria-pressed":e===i.selectedIndex,tabIndex:0,ref:m},l().createElement("div",{className:x,role:"img"},l().createElement(r.sV,{size:24})),l().createElement("div",null,l().createElement("h2",{className:w},a.name),l().createElement("p",{className:U},a.cohortMembers?.length??0," ",d("members","members"),l().createElement("span",{className:k},"\xb7")," ",a.description)))},D=()=>l().createElement("div",{className:b},l().createElement("div",{className:x,role:"img"},l().createElement(s.SkeletonIcon,{className:"-esm-fast-data-entry__compact-group-result__skeletonIcon___HC9if"})),l().createElement("div",null,l().createElement("h2",{className:w},l().createElement(s.SkeletonText,null)),l().createElement("span",{className:U},l().createElement(s.SkeletonIcon,null)," ",l().createElement("span",{className:k},"\xb7")," ",l().createElement(s.SkeletonIcon,null)," ",l().createElement("span",{className:k},"\xb7")," ",l().createElement(s.SkeletonIcon,null)))),M=({groups:e,selectGroupAction:t,lastRef:a})=>{let s=I("ArrowUp"),r=I("ArrowDown"),i=I("Enter"),[o,c]=(0,n.useReducer)(F,{selectedIndex:0});return(0,n.useEffect)(()=>{s&&c({type:"arrowUp"})},[s]),(0,n.useEffect)(()=>{r&&c({type:"arrowDown",listLength:e.length})},[r,e.length]),(0,n.useEffect)(()=>{i&&e.length&&t(e[o.selectedIndex])},[i,t,e,o.selectedIndex]),l().createElement(l().Fragment,null,e.map((n,s)=>l().createElement(A,{key:s,totalGroups:e.length,lastRef:a,index:s,selectGroupAction:t,group:n,dispatch:c,state:o})))};var P=a(2398),L=a.n(P);let O=({query:e="",selectGroupAction:t})=>{let{t:a}=(0,c.useTranslation)(),{isLoading:r,data:i,error:o,loadingNewData:u,setPage:m,hasMore:d,totalResults:_}=(({...e})=>(e=>{let{baseUrl:t,searchTerm:a,parameters:l,searching:s=!0,resultsToFetch:r=10}=e,i=(0,n.useCallback)((e,n)=>{if(n&&!n?.data?.links.some(e=>"next"===e.rel))return null;let s=`${t}?q=${a}`;return Object.entries({totalCount:!0,limit:r,...l}).forEach(([e,t])=>{null!=t&&(s+=`&${e}=${t}`)}),e&&(s+=`&startIndex=${e*r}`),s},[t,a,l,r]),{data:o,isValidating:c,setSize:u,error:m,size:d}=L()(s?i:null,h.openmrsFetch);return(0,n.useMemo)(()=>({data:o?[].concat(...o?.map(e=>e?.data?.results)??[]):null,isLoading:!o&&!m,error:m,hasMore:!!o?.length&&!!o[o.length-1].data?.links?.some(e=>"next"===e.rel),loadingNewData:c,setPage:u,currentPage:d,totalResults:o?.[0]?.data?.totalCount}),[o,c,m,u,d])})({baseUrl:`${h.restBaseUrl}/cohortm/cohort`,resultsToFetch:10,...e}))({searchTerm:e,searching:!!e,parameters:{v:"full"}}),p=(0,n.useRef)(null),E=(0,n.useRef)(null),f=(0,n.useCallback)(e=>{!u&&(E.current&&E.current.disconnect(),E.current=new IntersectionObserver(e=>{e[0].isIntersecting&&d&&m(e=>e+1)},{threshold:.75}),e&&E.current.observe(e))},[u,d,m]);return o?l().createElement("div",{className:S},l().createElement(s.Layer,null,l().createElement(s.Tile,{className:C},l().createElement(T.K,null),l().createElement("div",null,l().createElement("p",{className:"-esm-fast-data-entry__group-search__errorMessage___fImrp"},a("error","Error")),l().createElement("p",{className:"-esm-fast-data-entry__group-search__errorCopy___yW+XA"},a("errorCopy","Sorry, there was an error. You can try to reload this page, or contact the site administrator and quote the error code above.")))))):r?l().createElement("div",{className:N},l().createElement(D,null),l().createElement(D,null),l().createElement(D,null),l().createElement(D,null),l().createElement(D,null)):i?.length===0?l().createElement("div",{className:S},l().createElement(s.Layer,null,l().createElement(s.Tile,{className:C},l().createElement(T.K,null),l().createElement("p",{className:"-esm-fast-data-entry__group-search__emptyResultText___F13T3"},a("noGroupsFoundMessage","Sorry, no groups have been found")),l().createElement("p",{className:"-esm-fast-data-entry__group-search__actionText___ywnJA"},l().createElement("span",null,a("trySearchWithPatientUniqueID","Try searching with the cohort's description")),l().createElement("br",null),l().createElement("span",null,a("orLabelName","OR label name")))))):l().createElement("div",{className:N},l().createElement("div",{className:S,style:{maxHeight:"22rem"}},l().createElement("p",{className:"-esm-fast-data-entry__group-search__resultsText___OyN4E"},_," ",a("searchResultsText","search result(s)")),l().createElement(M,{groups:i,selectGroupAction:t,lastRef:p}),l().createElement("div",{ref:p},l().createElement("div",{className:"-esm-fast-data-entry__group-search__lastItem___8tqJD",ref:f},d&&l().createElement(s.Loading,{withOverlay:!1,small:!0}),!d&&l().createElement("p",null,a("noMoreResults","End of search results"))))))},G=({selectGroupAction:e})=>{let{t}=(0,c.useTranslation)(),[a,r]=(0,n.useState)(""),[i,o]=(0,n.useState)(!1);return l().createElement("div",{className:"-esm-fast-data-entry__compact-group-search__patientSearchBar___8LgpM"},l().createElement("div",{className:"-esm-fast-data-entry__compact-group-search__searchArea___fO5cR"},l().createElement(s.Search,{className:"-esm-fast-data-entry__compact-group-search__patientSearchInput___Wj09s",closeButtonLabelText:t("clearSearch","Clear"),labelText:"",onChange:e=>{var t;t=e.target.value,(0,g.debounce)(e=>{o(!!t.length),r(e)},300),r(t),t.length?o(!0):o(!1)},onClear:()=>void 0,placeholder:t("searchForGroup","Search for a group by name"),size:"sm",value:a}),l().createElement(s.Button,{kind:"secondary",size:"sm"},t("search","Search"))),i&&l().createElement("div",{className:"-esm-fast-data-entry__compact-group-search__floatingSearchResultsContainer___zgPGp"},l().createElement(O,{query:a,selectGroupAction:t=>{e(t),o(!1),r("")}})))},q="-esm-fast-data-entry__styles__padded___ldQWR",V=()=>{let{t:e}=(0,c.useTranslation)(),t=(0,h.useConfig)(),{sessionLocation:a}=(0,h.useSession)(),{activeFormUuid:r,activeGroupUuid:o,setGroup:m,destroySession:d}=(0,n.useContext)(u.Ay),_=(0,n.useRef)(),p=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{p.current+=1,_.current?.()},[r,o]);let E=(0,n.useCallback)(n=>{t.enforcePatientListLocationMatch&&n.location&&a.uuid!==n.location.uuid?(0,h.showSnackbar)({kind:"error",title:e("locationMismatch","Location Mismatch"),subtitle:e("groupLocationMismatchEnforced","Cannot select group from {{groupLocation}} for a session at {{sessionLocation}}",{groupLocation:n.location?.display,sessionLocation:a?.display})}):(n.cohortMembers&&n.cohortMembers.sort((e,t)=>{let a=e?.patient?.person?.names?.[0]?.display,n=t?.patient?.person?.names?.[0]?.display;return a.localeCompare(n,void 0,{sensitivity:"base"})}),m(n))},[t.enforcePatientListLocationMatch,a,m,e]);return o?null:l().createElement("div",{className:"-esm-fast-data-entry__styles__searchHeaderContainer___TKyB8"},l().createElement("span",{className:q},e("findGroup","Find group"),":"),l().createElement("span",{className:"-esm-fast-data-entry__styles__searchBarWrapper___Ijfpg"},l().createElement(G,{selectGroupAction:E})),l().createElement("span",{className:q},e("or","or")),l().createElement("span",null,l().createElement(s.Button,{onClick:()=>{let e=++p.current;_.current?.(),_.current=(0,h.showModal)("fde-add-group-modal",{isCreate:!0,onSave:t=>{e===p.current&&m(t)}})},renderIcon:v.OM,iconDescription:"Add"},e("createNewGroup","Create New Group"))),l().createElement("span",{style:{flexGrow:1}}),l().createElement("span",null,l().createElement(s.Button,{kind:"ghost",onClick:()=>{d()}},e("cancel","Cancel")," ",l().createElement(i.bm,{size:20}))))};var B=a(9785),z=a(9943);let W=({patient:e})=>{let{patientUuids:t,addPatientUuid:a,removePatientUuid:r}=(0,n.useContext)(u.Ay),i=e?.name?.[0]?.given?.[0],o=e?.name?.[0]?.family,c=e?.identifier?.[0]?.value;return e?l().createElement(s.TableRow,null,l().createElement(s.TableCell,null,e.display||e.displayName||[i,o].join(" ")),l().createElement(s.TableCell,null,c),l().createElement(s.TableCell,null,l().createElement(s.Checkbox,{checked:t.includes(e.id),labelText:e.id,hideLabel:!0,id:`${c}-attendance-checkbox`,onChange:(t,{checked:n})=>{n?a(e.id):r(e.id)}}))):l().createElement(s.TableRow,null,l().createElement(s.TableCell,null,l().createElement(s.SkeletonText,null)),l().createElement(s.TableCell,null,l().createElement(s.SkeletonText,null)),l().createElement(s.TableCell,null,l().createElement(s.CheckboxSkeleton,null)))},H=({patients:e})=>{let{t}=(0,c.useTranslation)(),{activeFormUuid:a,activeGroupUuid:i,activeGroupName:o,activeGroupMembers:m,setGroup:d}=(0,n.useContext)(u.Ay),_=(0,n.useRef)(),p=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{p.current+=1,_.current?.()},[a]);let E=[t("name","Name"),t("identifier","Patient ID"),t("patientIsPresent","Patient is present")],f=(0,n.useMemo)(()=>m.map(function(t){let a=e.find(e=>e.id===t);return{uuid:t,...a}}),[m,e]);return i?l().createElement("div",null,l().createElement("span",{style:{flexGrow:1}}),l().createElement(s.Button,{kind:"ghost",onClick:()=>{let e=p.current;_.current?.(),_.current=(0,h.showModal)("fde-add-group-modal",{cohortUuid:i,patients:f,isCreate:!1,groupName:o,onSave:t=>{e===p.current&&d(t)}})}},t("editGroup","Edit Group"),"\xa0",l().createElement(r.ff,{size:20})),l().createElement(s.Table,null,l().createElement(s.TableHead,null,l().createElement(s.TableRow,null,E.map((e,t)=>l().createElement(s.TableHeader,{key:t},e)))),l().createElement(s.TableBody,null,m.map((t,a)=>{let n=e.find(e=>e.id===t);return l().createElement(W,{patient:n,key:a})})))):l().createElement("div",null,t("selectGroupFirst","Please select a group first"))},$=({register:e,specificQuestions:t})=>l().createElement(l().Fragment,null,t?.map(t=>l().createElement("div",{key:t.question.id},t?.answers?.length>0?l().createElement(s.Select,{...e(t.question.id,{required:!1}),id:t.question.id,labelText:t.question.display,readOnly:!!t.question.disabled,defaultValue:t.question.defaultAnswer},l().createElement(s.SelectItem,{value:"",text:""}),t.answers.map(e=>l().createElement(s.SelectItem,{key:e.value,value:e.value,text:e.display}))):l().createElement(s.TextInput,{id:t.question.id,...e(t.question.id,{required:!1}),type:"text",labelText:t.question.display,readOnly:!!t.question.disabled,defaultValue:t.question.defaultAnswer}))));var j=a(5301);let K=()=>{let{specificQuestions:e}=(0,h.useConfig)(),{formUuid:t}=(0,z.useParams)(),{questions:a}=(0,j.A)(t,e),{t:r}=(0,c.useTranslation)(),{register:i,formState:{errors:o},control:m}=(0,B.xW)(),{activeGroupMembers:d}=(0,n.useContext)(u.Ay),{patients:_,isLoading:p}=(e=>{let[t,a]=(0,n.useState)([]),[l,s]=(0,n.useState)(!0);(0,n.useEffect)(()=>{e&&0!==e.length?r(e):(a([]),s(!1))},[e]);let r=async e=>{try{s(!0);let t=await Promise.all(e.map(async e=>await (0,h.fetchCurrentPatient)(e)));a(t),s(!1)}catch(e){console.error("Error fetching patients:",e),s(!1)}};return{patients:t,isLoading:l}})(d);return l().createElement("div",null,!p&&l().createElement("div",{className:"-esm-fast-data-entry__styles__formSection___CL7ru"},l().createElement("h4",null,r("sessionDetails","1. Session details")),l().createElement("div",null,l().createElement("p",null,r("allFieldsRequired","All fields are required unless marked optional"))),l().createElement(s.Layer,null,l().createElement(s.Tile,{className:y},l().createElement(s.Layer,null,l().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},l().createElement(s.TextInput,{id:"text",type:"text",labelText:r("sessionName","Session Name"),...i("sessionName",{required:!0}),invalid:!!o.sessionName,invalidText:r("requiredField","This field is required")}),l().createElement(s.TextInput,{id:"text",type:"text",labelText:r("practitionerName","Practitioner Name"),...i("practitionerName",{required:!0}),invalid:!!o.practitionerName,invalidText:r("requiredField","This field is required")}),l().createElement(B.xI,{name:"sessionDate",control:m,rules:{required:!0},render:({field:e})=>l().createElement(s.DatePicker,{datePickerType:"single",maxDate:new Date,...e},l().createElement(s.DatePickerInput,{id:"session-date",labelText:r("sessionDate","Session Date"),placeholder:"mm/dd/yyyy",size:"md",invalid:!!o.sessionDate,invalidText:r("requiredField","This field is required")}))}),l().createElement(s.TextArea,{id:"text",type:"text",labelText:r("sessionNotes","Session Notes"),...i("sessionNotes",{required:!0}),invalid:!!o.sessionNotes,invalidText:r("requiredField","This field is required")}))))),l().createElement("h4",null,r("sessionParticipants","2. Session participants")),l().createElement("div",null,l().createElement("p",null,r("markAbsentPatients","The patients in this group. Patients that are not present in the session should be marked as absent."))),l().createElement(s.Layer,null,l().createElement(s.Tile,{className:y},l().createElement(s.Layer,null,l().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},l().createElement(H,{patients:_}))))),a?.length>0?l().createElement(l().Fragment,null,l().createElement("h4",null,r("sessionSpecificDetails","3. Specific details")),l().createElement("div",null,l().createElement("p",null,r("sessionSpecificDetailsDescription","They will be mapped to form responses for all patients as pre-filled data."))),l().createElement(s.Layer,null,l().createElement(s.Tile,{className:y},l().createElement(s.Layer,null,l().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},l().createElement($,{register:i,specificQuestions:a})))))):null))},Q=()=>{let{t:e}=(0,c.useTranslation)(),t=(0,n.useContext)(u.Ay),{workflowState:a,patientUuids:r}=t,i=(0,n.useRef)();return((0,n.useEffect)(()=>()=>{i.current?.()},[t.activeFormUuid]),"NEW_GROUP_SESSION"!==a)?null:l().createElement(l().Fragment,null,l().createElement("div",{className:f},l().createElement(s.Button,{kind:"secondary",type:"submit",disabled:!r.length},e("createNewSession","Create New Session")),l().createElement(s.Button,{kind:"tertiary",onClick:()=>{i.current?.(),i.current=(0,h.showModal)("fde-cancel-session-modal",{onDiscard:t.destroySession,onSaveAndClose:t.closeSession})}},e("cancel","Cancel"))))},Y=()=>{let{t:e}=(0,c.useTranslation)(),{register:t,formState:{errors:a},setValue:s}=(0,B.xW)(),{activeGroupUuid:r}=(0,n.useContext)(u.Ay);return(0,n.useEffect)(()=>{r&&s("groupUuid",r)},[r,s]),l().createElement(l().Fragment,null,l().createElement("input",{hidden:!0,...t("groupUuid",{value:r,required:e("chooseGroupError","Please choose a group.")})}),a.groupUuid&&!r&&l().createElement("div",{className:"-esm-fast-data-entry__styles__formError___UKorH"},a.groupUuid.message))},X=()=>{let{t:e}=(0,c.useTranslation)(),{setSessionMeta:t,workflowState:a}=(0,n.useContext)(u.Ay),s=(0,B.mN)();return"NEW_GROUP_SESSION"!==a?null:l().createElement(B.Op,s,l().createElement("form",{onSubmit:s.handleSubmit(e=>{let{sessionDate:a,...n}=e;t({...n,sessionDate:a[0]})})},l().createElement("div",{className:d},l().createElement("div",{className:_},l().createElement("div",{className:p},l().createElement(K,null)),l().createElement("div",{className:E},l().createElement("h4",null,e("newGroupSession","New Group Session")),l().createElement(Y,null),l().createElement("hr",{style:{width:"100%"}}),l().createElement(Q,null))))))};var Z=a(8414),J=a(5246),ee=a(6433);let et=(0,h.getGlobalStore)("ampath-form-state"),ea=()=>{let e=(0,n.useContext)(u.Ay),{activeFormUuid:t,submitForNext:a,patientUuids:r,activePatientUuid:i,workflowState:o}=e,m=(0,h.useStore)(et)[t],d=(0,n.useRef)();(0,n.useEffect)(()=>()=>{d.current?.()},[e.activeFormUuid]);let{t:_}=(0,c.useTranslation)(),p=(0,n.useMemo)(()=>!!m&&("ready"!==m||"EDIT_FORM"!==o)&&"readyWithValidationErrors"!==m,[m,o]),E=i===r[r.length-1];return l().createElement(l().Fragment,null,l().createElement("div",{className:f},l().createElement(s.Button,{kind:"primary",onClick:()=>{("EDIT_FORM"===o||"readyWithValidationErrors"===m)&&a()},disabled:p},E?_("saveForm","Save Form"):_("nextPatient","Next patient")),l().createElement(s.Button,{kind:"secondary",onClick:()=>{d.current?.(),d.current=(0,h.showModal)("fde-complete-session-modal",{onComplete:e.submitForComplete})}},_("saveAndComplete","Save & Complete")),l().createElement(s.Button,{kind:"tertiary",onClick:()=>{d.current?.(),d.current=(0,h.showModal)("fde-cancel-session-modal",{onDiscard:e.destroySession,onSaveAndClose:e.closeSession})}},_("cancel","Cancel"))))},en=()=>{let{groupSessionConcepts:e}=(0,h.useConfig)(),{t}=(0,c.useTranslation)(),{patientUuids:a,activePatientUuid:s,encounters:r,activeEncounterUuid:i,activeVisitUuid:o,activeFormUuid:m,activeGroupUuid:f,activeGroupName:y,activeSessionUuid:v,saveEncounter:g,activeSessionMeta:N,groupVisitTypeUuid:S,updateVisitUuid:C,submitForNext:T,workflowState:b}=(0,n.useContext)(u.Ay),{sessionLocation:w}=(0,h.useSession)();(0,n.useEffect)(()=>{o&&C(o)},[C,o,s]);let x=(0,n.useCallback)(t=>{let a=new Date(N.sessionDate);t.obs.forEach((e,n)=>{t.obs[n]={...e,groupMembers:e.groupMembers?.map(e=>({...e,obsDatetime:a.toISOString()})),obsDatetime:a.toISOString()}});let n=o||(0,Z.A)();if(!o){Object.entries(e).forEach(([e,a])=>{N?.[e]==null||t.obs.some(e=>e.concept===a)||t.obs.push({concept:a,value:N[e]})});let a=[{concept:e.cohortId,value:f},{concept:e.cohortName,value:y},{concept:e.sessionUuid,value:v}];t.obs.push(...a),t.visit={startDatetime:N.sessionDate,stopDatetime:N.sessionDate,uuid:n,patient:{uuid:s},location:{uuid:w?.uuid},visitType:{uuid:S}},C(n)}t.location=w?.uuid,t.encounterDatetime=a.toISOString()},[N,o,w?.uuid,e,f,y,v,s,S,C]),U=(0,n.useCallback)(e=>{e&&e.uuid&&g(e.uuid)},[g]),k=(0,n.useCallback)(e=>{T(e)},[T]);return"NEW_GROUP_SESSION"===b?null:l().createElement("div",{className:d},l().createElement("div",{className:_},l().createElement("div",{className:p},l().createElement(J.A,{patientUuid:s,encounterUuid:i,formUuid:m,handlePostResponse:U,handleEncounterCreate:x,hidePatientBanner:!1})),l().createElement("div",{className:E},l().createElement("h4",null,t("formsFilled","Forms filled")),l().createElement("div",{className:"-esm-fast-data-entry__styles__patientCardsSection___M41-h"},a?.map(e=>l().createElement(ee.A,{key:e,patientUuid:e,activePatientUuid:s,editEncounter:k,encounters:r}))),l().createElement(ea,null))))},el=()=>l().createElement(u.SR,null,l().createElement(V,null),l().createElement(m,null),l().createElement("div",{className:"-esm-fast-data-entry__styles__workspaceWrapper___CDnUs"},l().createElement(X,null),l().createElement(en,null)))},6433(e,t,a){a.d(t,{A:()=>u});var n=a(9184),l=a(2383),s=a(3392),r=a(7979),i=a.n(r),o=a(1291);let c=({onClick:e=()=>void 0,active:t,children:a})=>i().createElement("div",{onClick:e,className:`-esm-fast-data-entry__styles__cardContainer___r35b+ ${!t&&"-esm-fast-data-entry__styles__inactiveCard___mgnR5"}`,role:"button",tabIndex:0},a),u=({patientUuid:e,activePatientUuid:t,editEncounter:a,encounters:r})=>{let u=(0,o.A)(e),m=u?.name?.[0]?.given?.[0],d=u?.name?.[0]?.family,_=u?.identifier?.[0]?.value;if(!u)return i().createElement(c,{active:!0},i().createElement(s.SkeletonText,{className:"-esm-fast-data-entry__styles__skeletonText___W2uKh"}));let p=t===e;return i().createElement(c,{onClick:p?()=>void 0:()=>a(e),active:p},i().createElement("div",{className:"-esm-fast-data-entry__styles__patientInfo___dsLIV"},i().createElement("div",{className:"-esm-fast-data-entry__styles__identifier___pA+fq"},_),i().createElement("div",{className:`-esm-fast-data-entry__styles__displayName___n+VZ8 ${p&&"-esm-fast-data-entry__styles__activeDisplayName___furnV"}`},m," ",d)),i().createElement("div",null,e in r?i().createElement(n.cR,{size:16,className:"-esm-fast-data-entry__styles__statusSuccess___1nZk2"}):i().createElement(l.Cp,{size:16,className:"-esm-fast-data-entry__styles__statusWarning___QxLWO"})))}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["6606"],{5246(e,t,a){a.d(t,{A:()=>o});var n=a(7979),l=a.n(n),s=a(2908),r=a(1291),i=a(8269);let o=({formUuid:e,patientUuid:t,visitUuid:a,visitTypeUuid:o,encounterUuid:c,handlePostResponse:u,handleEncounterCreate:m,handleOnValidate:d,hidePatientBanner:_})=>{let p=(0,r.A)(t),E=p?.id===t,{activeSessionMeta:f}=(0,n.useContext)(i.Ay);(0,n.useEffect)(()=>()=>(0,s.detach)("form-widget-slot","form-widget-slot"),[]);let[y,v]=(0,n.useState)(!0),h=y&&e&&t&&p&&E;return l().createElement("div",null,h&&l().createElement(s.ExtensionSlot,{name:"form-widget-slot",state:{view:"form",formUuid:e,visitUuid:a??"",visitTypeUuid:o??"",patientUuid:t,patient:p,encounterUuid:c??"",closeWorkspace:()=>void 0,handlePostResponse:e=>{u(e),v(!1),setTimeout(()=>{v(!0)},1)},handleEncounterCreate:m,handleOnValidate:d,showDiscardSubmitButtons:!1,preFilledQuestions:{...f,encDate:f.sessionDate},hideControls:!0,hidePatientBanner:_}}))}},8269(e,t,a){a.d(t,{Ay:()=>_,SR:()=>d});var n=a(7979),l=a.n(n),s=a(6984),r=a(9943),i=a(2908),o=a(5725);let c={setGroup:e=>void 0,unsetGroup:()=>void 0,setSessionMeta:e=>void 0,openPatientSearch:()=>void 0,saveEncounter:e=>void 0,editEncounter:e=>void 0,validateForNext:()=>void 0,validateForComplete:()=>void 0,updateVisitUuid:e=>void 0,submitForNext:(e=null)=>void 0,submitForReview:()=>void 0,submitForComplete:()=>void 0,addPatientUuid:e=>void 0,removePatientUuid:e=>void 0,goToReview:()=>void 0,destroySession:()=>void 0,closeSession:()=>void 0},u={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,activeSessionUuid:null,activeVisitUuid:null,patientUuids:[],encounters:{},visits:{},activeGroupUuid:null,activeGroupName:null,activeGroupMembers:[],activeSessionMeta:{sessionName:null,practitionerName:null,sessionDate:null,sessionNotes:null},groupVisitTypeUuid:null,userUuid:null},m=l().createContext({...u,...c}),d=({children:e})=>{let{user:t}=(0,i.useSession)(),{formUuid:a}=(0,r.useParams)(),d=a.split("&")[0],_=(0,o.A)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),p=_?.result?.data?.results?.[0]?.value,[E,f]=(0,n.useReducer)(s.Ay,{...u,...c}),y=(0,n.useMemo)(()=>({initializeWorkflowState:({activeFormUuid:e})=>f({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:e,userUuid:t.uuid}),setGroup:e=>f({type:"SET_GROUP",group:e}),unsetGroup:()=>f({type:"UNSET_GROUP"}),setSessionMeta:e=>f({type:"SET_SESSION_META",meta:e}),addPatientUuid:e=>f({type:"ADD_PATIENT_UUID",patientUuid:e}),removePatientUuid:e=>f({type:"REMOVE_PATIENT_UUID",patientUuid:e}),openPatientSearch:()=>f({type:"OPEN_PATIENT_SEARCH"}),saveEncounter:e=>f({type:"SAVE_ENCOUNTER",encounterUuid:e}),validateForNext:()=>f({type:"VALIDATE_FOR_NEXT"}),validateForComplete:()=>f({type:"VALIDATE_FOR_COMPLETE"}),updateVisitUuid:e=>f({type:"UPDATE_VISIT_UUID",visitUuid:e}),submitForNext:e=>f({type:"SUBMIT_FOR_NEXT",nextPatientUuid:e}),submitForComplete:()=>f({type:"SUBMIT_FOR_COMPLETE"}),editEncounter:e=>f({type:"EDIT_ENCOUNTER",patientUuid:e}),goToReview:()=>f({type:"GO_TO_REVIEW"}),destroySession:()=>f({type:"DESTROY_SESSION"}),closeSession:()=>f({type:"CLOSE_SESSION"})}),[t]);return(0,n.useEffect)(()=>{E?.workflowState===null&&d&&y.initializeWorkflowState({activeFormUuid:d})},[d,E?.workflowState,y]),l().createElement(m.Provider,{value:{groupVisitTypeUuid:p,...E,...y,workflowState:E.forms?.[E.activeFormUuid]?.workflowState??u.workflowState,activeSessionUuid:E.forms?.[E.activeFormUuid]?.activeSessionUuid??u.activeSessionUuid,activePatientUuid:E.forms?.[E.activeFormUuid]?.activePatientUuid??u.activePatientUuid,activeEncounterUuid:E.forms?.[E.activeFormUuid]?.activeEncounterUuid??u.activeEncounterUuid,activeVisitUuid:E.forms?.[E.activeFormUuid]?.activeVisitUuid??u.activeVisitUuid,patientUuids:E.forms?.[E.activeFormUuid]?.patientUuids??u.patientUuids,encounters:E.forms?.[E.activeFormUuid]?.encounters??u.encounters,activeGroupUuid:E.forms?.[E.activeFormUuid]?.groupUuid??u.activeGroupUuid,activeGroupName:E.forms?.[E.activeFormUuid]?.groupName??u.activeGroupName,activeGroupMembers:E.forms?.[E.activeFormUuid]?.groupMembers??u.activeGroupMembers,activeSessionMeta:E.forms?.[E.activeFormUuid]?.sessionMeta??u.activeSessionMeta}},e)},_=m},1369(e,t,a){a.d(t,{K:()=>s});var n=a(7979),l=a.n(n);let s=({width:e="64",height:t="64"})=>l().createElement("svg",{width:e,height:t,viewBox:"0 0 64 64"},l().createElement("title",null,"Empty data illustration"),l().createElement("g",{fill:"none",fillRule:"evenodd"},l().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),l().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),l().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),l().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),l().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),l().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),l().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),l().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),l().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),l().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},125(e,t,a){a.r(t),a.d(t,{default:()=>el});var n=a(7979),l=a.n(n),s=a(3392),r=a(771),i=a(9184);let o={container:"-esm-fast-data-entry__styles__container___wo4Op",photoPlaceholder:"-esm-fast-data-entry__styles__photoPlaceholder___d7h7b",groupAvatar:"-esm-fast-data-entry__styles__groupAvatar___C4sOM",groupName:"-esm-fast-data-entry__styles__groupName___AYYrA",groupInfoContent:"-esm-fast-data-entry__styles__groupInfoContent___TQDIY",groupInfoRow:"-esm-fast-data-entry__styles__groupInfoRow___pRcS2",sessionNotesLabel:"-esm-fast-data-entry__styles__sessionNotesLabel___bxDoq",groupEditBtn:"-esm-fast-data-entry__styles__groupEditBtn___zEDCG",groupMetaContent:"-esm-fast-data-entry__styles__groupMetaContent___9Nq-t"};var c=a(3826),u=a(8269);let m=()=>{let{activeGroupName:e,activeGroupUuid:t,patientUuids:a,activeSessionMeta:m,unsetGroup:d,destroySession:_}=(0,n.useContext)(u.Ay),{t:p}=(0,c.useTranslation)();return t?l().createElement("div",{className:o.container},l().createElement("div",{className:o.groupAvatar,role:"img"},l().createElement(r.sV,{size:48})),l().createElement("div",{className:o.groupInfoContent},l().createElement("div",{className:o.groupInfoRow},l().createElement("span",{className:o.groupName},e)),l().createElement("div",{className:o.groupInfoRow},l().createElement("span",null,a.length," ",p("members","members")))),m?.sessionNotes&&l().createElement("div",{className:o.groupMeataContent},l().createElement("div",{className:`${o.groupInfoRow} ${o.sessionNotesLabel}`},p("sessionNotes","Session Notes")),l().createElement("div",{className:o.groupInfoRow},m.sessionNotes)),l().createElement("span",{style:{flexGrow:1}}),l().createElement("span",null,l().createElement(s.Button,{kind:"ghost",onClick:()=>d()},p("changeGroup","Choose a different group")," ",l().createElement(i.bm,{size:20}))),l().createElement("span",null,l().createElement(s.Button,{kind:"ghost",onClick:()=>_()},p("cancel","Cancel")," ",l().createElement(i.bm,{size:20})))):null},d="-esm-fast-data-entry__styles__workspace___w1msl",_="-esm-fast-data-entry__styles__formMainContent___V0wb6",p="-esm-fast-data-entry__styles__formContainer___Dr0vH",E="-esm-fast-data-entry__styles__rightPanel___Cli99",f="-esm-fast-data-entry__styles__rightPanelActionButtons___mLqO-",y="-esm-fast-data-entry__styles__formSectionTile___EKij4";var v=a(2137),h=a(2908),g=a(1881);let N="-esm-fast-data-entry__group-search__searchResultsContainer___Abg8g",S="-esm-fast-data-entry__group-search__searchResults___FkkhX",C="-esm-fast-data-entry__group-search__emptySearchResultsTile___FQ9YZ";var T=a(1369);let b="-esm-fast-data-entry__compact-group-result__patientSearchResult___jRxdh",w="-esm-fast-data-entry__compact-group-result__patientName___jewR5",x="-esm-fast-data-entry__compact-group-result__patientAvatar___Cy+O8",U="-esm-fast-data-entry__compact-group-result__demographics___9-0Bw",k="-esm-fast-data-entry__compact-group-result__middot___C1wiJ",I=e=>{let[t,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let t=({key:t})=>{t===e&&a(!0)},n=({key:t})=>{t===e&&a(!1)};return window.addEventListener("keydown",t),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",n)}},[e]),t},F=(e,t)=>{switch(t.type){case"arrowUp":return{selectedIndex:Math.max(e.selectedIndex-1,0)};case"arrowDown":return{selectedIndex:Math.min(e.selectedIndex+1,t.listLength-1)};case"select":return{selectedIndex:t.payload};default:return e}},R={behavior:"smooth",block:"nearest"},A=({index:e,selectGroupAction:t,group:a,dispatch:s,state:i,totalGroups:o,lastRef:u})=>{let m=(0,n.useRef)(null),{t:d}=(0,c.useTranslation)();return(0,n.useEffect)(()=>{i.selectedIndex===o-1?u.current.scrollIntoView(R):i.selectedIndex===e&&m.current.scrollIntoView(R)},[i,e,o,u]),l().createElement("div",{onClick:()=>{s({type:"select",payload:e}),t(a)},className:`${b} ${e===i.selectedIndex&&"-esm-fast-data-entry__compact-group-result__patientSearchResultSelected___FQx0p"}`,role:"button","aria-pressed":e===i.selectedIndex,tabIndex:0,ref:m},l().createElement("div",{className:x,role:"img"},l().createElement(r.sV,{size:24})),l().createElement("div",null,l().createElement("h2",{className:w},a.name),l().createElement("p",{className:U},a.cohortMembers?.length??0," ",d("members","members"),l().createElement("span",{className:k},"\xb7")," ",a.description)))},D=()=>l().createElement("div",{className:b},l().createElement("div",{className:x,role:"img"},l().createElement(s.SkeletonIcon,{className:"-esm-fast-data-entry__compact-group-result__skeletonIcon___HC9if"})),l().createElement("div",null,l().createElement("h2",{className:w},l().createElement(s.SkeletonText,null)),l().createElement("span",{className:U},l().createElement(s.SkeletonIcon,null)," ",l().createElement("span",{className:k},"\xb7")," ",l().createElement(s.SkeletonIcon,null)," ",l().createElement("span",{className:k},"\xb7")," ",l().createElement(s.SkeletonIcon,null)))),M=({groups:e,selectGroupAction:t,lastRef:a})=>{let s=I("ArrowUp"),r=I("ArrowDown"),i=I("Enter"),[o,c]=(0,n.useReducer)(F,{selectedIndex:0});return(0,n.useEffect)(()=>{s&&c({type:"arrowUp"})},[s]),(0,n.useEffect)(()=>{r&&c({type:"arrowDown",listLength:e.length})},[r,e.length]),(0,n.useEffect)(()=>{i&&e.length&&t(e[o.selectedIndex])},[i,t,e,o.selectedIndex]),l().createElement(l().Fragment,null,e.map((n,s)=>l().createElement(A,{key:s,totalGroups:e.length,lastRef:a,index:s,selectGroupAction:t,group:n,dispatch:c,state:o})))};var P=a(2398),L=a.n(P);let O=({query:e="",selectGroupAction:t})=>{let{t:a}=(0,c.useTranslation)(),{isLoading:r,data:i,error:o,loadingNewData:u,setPage:m,hasMore:d,totalResults:_}=(({...e})=>(e=>{let{baseUrl:t,searchTerm:a,parameters:l,searching:s=!0,resultsToFetch:r=10}=e,i=(0,n.useCallback)((e,n)=>{if(n&&!n?.data?.links.some(e=>"next"===e.rel))return null;let s=`${t}?q=${a}`;return Object.entries({totalCount:!0,limit:r,...l}).forEach(([e,t])=>{null!=t&&(s+=`&${e}=${t}`)}),e&&(s+=`&startIndex=${e*r}`),s},[t,a,l,r]),{data:o,isValidating:c,setSize:u,error:m,size:d}=L()(s?i:null,h.openmrsFetch);return(0,n.useMemo)(()=>({data:o?[].concat(...o?.map(e=>e?.data?.results)??[]):null,isLoading:!o&&!m,error:m,hasMore:!!o?.length&&!!o[o.length-1].data?.links?.some(e=>"next"===e.rel),loadingNewData:c,setPage:u,currentPage:d,totalResults:o?.[0]?.data?.totalCount}),[o,c,m,u,d])})({baseUrl:`${h.restBaseUrl}/cohortm/cohort`,resultsToFetch:10,...e}))({searchTerm:e,searching:!!e,parameters:{v:"full"}}),p=(0,n.useRef)(null),E=(0,n.useRef)(null),f=(0,n.useCallback)(e=>{!u&&(E.current&&E.current.disconnect(),E.current=new IntersectionObserver(e=>{e[0].isIntersecting&&d&&m(e=>e+1)},{threshold:.75}),e&&E.current.observe(e))},[u,d,m]);return o?l().createElement("div",{className:S},l().createElement(s.Layer,null,l().createElement(s.Tile,{className:C},l().createElement(T.K,null),l().createElement("div",null,l().createElement("p",{className:"-esm-fast-data-entry__group-search__errorMessage___fImrp"},a("error","Error")),l().createElement("p",{className:"-esm-fast-data-entry__group-search__errorCopy___yW+XA"},a("errorCopy","Sorry, there was an error. You can try to reload this page, or contact the site administrator and quote the error code above.")))))):r?l().createElement("div",{className:N},l().createElement(D,null),l().createElement(D,null),l().createElement(D,null),l().createElement(D,null),l().createElement(D,null)):i?.length===0?l().createElement("div",{className:S},l().createElement(s.Layer,null,l().createElement(s.Tile,{className:C},l().createElement(T.K,null),l().createElement("p",{className:"-esm-fast-data-entry__group-search__emptyResultText___F13T3"},a("noGroupsFoundMessage","Sorry, no groups have been found")),l().createElement("p",{className:"-esm-fast-data-entry__group-search__actionText___ywnJA"},l().createElement("span",null,a("trySearchWithPatientUniqueID","Try searching with the cohort's description")),l().createElement("br",null),l().createElement("span",null,a("orLabelName","OR label name")))))):l().createElement("div",{className:N},l().createElement("div",{className:S,style:{maxHeight:"22rem"}},l().createElement("p",{className:"-esm-fast-data-entry__group-search__resultsText___OyN4E"},_," ",a("searchResultsText","search result(s)")),l().createElement(M,{groups:i,selectGroupAction:t,lastRef:p}),l().createElement("div",{ref:p},l().createElement("div",{className:"-esm-fast-data-entry__group-search__lastItem___8tqJD",ref:f},d&&l().createElement(s.Loading,{withOverlay:!1,small:!0}),!d&&l().createElement("p",null,a("noMoreResults","End of search results"))))))},G=({selectGroupAction:e})=>{let{t}=(0,c.useTranslation)(),[a,r]=(0,n.useState)(""),[i,o]=(0,n.useState)(!1);return l().createElement("div",{className:"-esm-fast-data-entry__compact-group-search__patientSearchBar___8LgpM"},l().createElement("div",{className:"-esm-fast-data-entry__compact-group-search__searchArea___fO5cR"},l().createElement(s.Search,{className:"-esm-fast-data-entry__compact-group-search__patientSearchInput___Wj09s",closeButtonLabelText:t("clearSearch","Clear"),labelText:"",onChange:e=>{var t;t=e.target.value,(0,g.debounce)(e=>{o(!!t.length),r(e)},300),r(t),t.length?o(!0):o(!1)},onClear:()=>void 0,placeholder:t("searchForGroup","Search for a group by name"),size:"sm",value:a}),l().createElement(s.Button,{kind:"secondary",size:"sm"},t("search","Search"))),i&&l().createElement("div",{className:"-esm-fast-data-entry__compact-group-search__floatingSearchResultsContainer___zgPGp"},l().createElement(O,{query:a,selectGroupAction:t=>{e(t),o(!1),r("")}})))},q="-esm-fast-data-entry__styles__padded___ldQWR",V=()=>{let{t:e}=(0,c.useTranslation)(),t=(0,h.useConfig)(),{sessionLocation:a}=(0,h.useSession)(),{activeFormUuid:r,activeGroupUuid:o,setGroup:m,destroySession:d}=(0,n.useContext)(u.Ay),_=(0,n.useRef)(),p=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{p.current+=1,_.current?.()},[r,o]);let E=(0,n.useCallback)(n=>{t.enforcePatientListLocationMatch&&n.location&&a.uuid!==n.location.uuid?(0,h.showSnackbar)({kind:"error",title:e("locationMismatch","Location Mismatch"),subtitle:e("groupLocationMismatchEnforced","Cannot select group from {{groupLocation}} for a session at {{sessionLocation}}",{groupLocation:n.location?.display,sessionLocation:a?.display})}):(n.cohortMembers&&n.cohortMembers.sort((e,t)=>{let a=e?.patient?.person?.names?.[0]?.display,n=t?.patient?.person?.names?.[0]?.display;return a.localeCompare(n,void 0,{sensitivity:"base"})}),m(n))},[t.enforcePatientListLocationMatch,a,m,e]);return o?null:l().createElement("div",{className:"-esm-fast-data-entry__styles__searchHeaderContainer___TKyB8"},l().createElement("span",{className:q},e("findGroup","Find group"),":"),l().createElement("span",{className:"-esm-fast-data-entry__styles__searchBarWrapper___Ijfpg"},l().createElement(G,{selectGroupAction:E})),l().createElement("span",{className:q},e("or","or")),l().createElement("span",null,l().createElement(s.Button,{onClick:()=>{let e=++p.current;_.current?.(),_.current=(0,h.showModal)("fde-add-group-modal",{isCreate:!0,onSave:t=>{e===p.current&&m(t)}})},renderIcon:v.OM,iconDescription:"Add"},e("createNewGroup","Create New Group"))),l().createElement("span",{style:{flexGrow:1}}),l().createElement("span",null,l().createElement(s.Button,{kind:"ghost",onClick:()=>{d()}},e("cancel","Cancel")," ",l().createElement(i.bm,{size:20}))))};var B=a(9785),z=a(9943);let W=({patient:e})=>{let{patientUuids:t,addPatientUuid:a,removePatientUuid:r}=(0,n.useContext)(u.Ay),i=e?.name?.[0]?.given?.[0],o=e?.name?.[0]?.family,c=e?.identifier?.[0]?.value;return e?l().createElement(s.TableRow,null,l().createElement(s.TableCell,null,e.display||e.displayName||[i,o].join(" ")),l().createElement(s.TableCell,null,c),l().createElement(s.TableCell,null,l().createElement(s.Checkbox,{checked:t.includes(e.id),labelText:e.id,hideLabel:!0,id:`${c}-attendance-checkbox`,onChange:(t,{checked:n})=>{n?a(e.id):r(e.id)}}))):l().createElement(s.TableRow,null,l().createElement(s.TableCell,null,l().createElement(s.SkeletonText,null)),l().createElement(s.TableCell,null,l().createElement(s.SkeletonText,null)),l().createElement(s.TableCell,null,l().createElement(s.CheckboxSkeleton,null)))},H=({patients:e})=>{let{t}=(0,c.useTranslation)(),{activeFormUuid:a,activeGroupUuid:i,activeGroupName:o,activeGroupMembers:m,setGroup:d}=(0,n.useContext)(u.Ay),_=(0,n.useRef)(),p=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{p.current+=1,_.current?.()},[a]);let E=[t("name","Name"),t("identifier","Patient ID"),t("patientIsPresent","Patient is present")],f=(0,n.useMemo)(()=>m.map(function(t){let a=e.find(e=>e.id===t);return{uuid:t,...a}}),[m,e]);return i?l().createElement("div",null,l().createElement("span",{style:{flexGrow:1}}),l().createElement(s.Button,{kind:"ghost",onClick:()=>{let e=p.current;_.current?.(),_.current=(0,h.showModal)("fde-add-group-modal",{cohortUuid:i,patients:f,isCreate:!1,groupName:o,onSave:t=>{e===p.current&&d(t)}})}},t("editGroup","Edit Group"),"\xa0",l().createElement(r.ff,{size:20})),l().createElement(s.Table,null,l().createElement(s.TableHead,null,l().createElement(s.TableRow,null,E.map((e,t)=>l().createElement(s.TableHeader,{key:t},e)))),l().createElement(s.TableBody,null,m.map((t,a)=>{let n=e.find(e=>e.id===t);return l().createElement(W,{patient:n,key:a})})))):l().createElement("div",null,t("selectGroupFirst","Please select a group first"))},$=({register:e,specificQuestions:t})=>l().createElement(l().Fragment,null,t?.map(t=>l().createElement("div",{key:t.question.id},t?.answers?.length>0?l().createElement(s.Select,{...e(t.question.id,{required:!1}),id:t.question.id,labelText:t.question.display,readOnly:!!t.question.disabled,defaultValue:t.question.defaultAnswer},l().createElement(s.SelectItem,{value:"",text:""}),t.answers.map(e=>l().createElement(s.SelectItem,{key:e.value,value:e.value,text:e.display}))):l().createElement(s.TextInput,{id:t.question.id,...e(t.question.id,{required:!1}),type:"text",labelText:t.question.display,readOnly:!!t.question.disabled,defaultValue:t.question.defaultAnswer}))));var j=a(5301);let K=()=>{let{specificQuestions:e}=(0,h.useConfig)(),{formUuid:t}=(0,z.useParams)(),{questions:a}=(0,j.A)(t,e),{t:r}=(0,c.useTranslation)(),{register:i,formState:{errors:o},control:m}=(0,B.xW)(),{activeGroupMembers:d}=(0,n.useContext)(u.Ay),{patients:_,isLoading:p}=(e=>{let[t,a]=(0,n.useState)([]),[l,s]=(0,n.useState)(!0);(0,n.useEffect)(()=>{e&&0!==e.length?r(e):(a([]),s(!1))},[e]);let r=async e=>{try{s(!0);let t=await Promise.all(e.map(async e=>await (0,h.fetchCurrentPatient)(e)));a(t),s(!1)}catch(e){console.error("Error fetching patients:",e),s(!1)}};return{patients:t,isLoading:l}})(d);return l().createElement("div",null,!p&&l().createElement("div",{className:"-esm-fast-data-entry__styles__formSection___CL7ru"},l().createElement("h4",null,r("sessionDetails","1. Session details")),l().createElement("div",null,l().createElement("p",null,r("allFieldsRequired","All fields are required unless marked optional"))),l().createElement(s.Layer,null,l().createElement(s.Tile,{className:y},l().createElement(s.Layer,null,l().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},l().createElement(s.TextInput,{id:"text",type:"text",labelText:r("sessionName","Session Name"),...i("sessionName",{required:!0}),invalid:!!o.sessionName,invalidText:r("requiredField","This field is required")}),l().createElement(s.TextInput,{id:"text",type:"text",labelText:r("practitionerName","Practitioner Name"),...i("practitionerName",{required:!0}),invalid:!!o.practitionerName,invalidText:r("requiredField","This field is required")}),l().createElement(B.xI,{name:"sessionDate",control:m,rules:{required:!0},render:({field:e})=>l().createElement(s.DatePicker,{datePickerType:"single",maxDate:new Date,...e},l().createElement(s.DatePickerInput,{id:"session-date",labelText:r("sessionDate","Session Date"),placeholder:"mm/dd/yyyy",size:"md",invalid:!!o.sessionDate,invalidText:r("requiredField","This field is required")}))}),l().createElement(s.TextArea,{id:"text",type:"text",labelText:r("sessionNotes","Session Notes"),...i("sessionNotes",{required:!0}),invalid:!!o.sessionNotes,invalidText:r("requiredField","This field is required")}))))),l().createElement("h4",null,r("sessionParticipants","2. Session participants")),l().createElement("div",null,l().createElement("p",null,r("markAbsentPatients","The patients in this group. Patients that are not present in the session should be marked as absent."))),l().createElement(s.Layer,null,l().createElement(s.Tile,{className:y},l().createElement(s.Layer,null,l().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},l().createElement(H,{patients:_}))))),a?.length>0?l().createElement(l().Fragment,null,l().createElement("h4",null,r("sessionSpecificDetails","3. Specific details")),l().createElement("div",null,l().createElement("p",null,r("sessionSpecificDetailsDescription","They will be mapped to form responses for all patients as pre-filled data."))),l().createElement(s.Layer,null,l().createElement(s.Tile,{className:y},l().createElement(s.Layer,null,l().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},l().createElement($,{register:i,specificQuestions:a})))))):null))},Q=()=>{let{t:e}=(0,c.useTranslation)(),t=(0,n.useContext)(u.Ay),{workflowState:a,patientUuids:r}=t,i=(0,n.useRef)();return((0,n.useEffect)(()=>()=>{i.current?.()},[t.activeFormUuid]),"NEW_GROUP_SESSION"!==a)?null:l().createElement(l().Fragment,null,l().createElement("div",{className:f},l().createElement(s.Button,{kind:"secondary",type:"submit",disabled:!r.length},e("createNewSession","Create New Session")),l().createElement(s.Button,{kind:"tertiary",onClick:()=>{i.current?.(),i.current=(0,h.showModal)("fde-cancel-session-modal",{onDiscard:t.destroySession,onSaveAndClose:t.closeSession})}},e("cancel","Cancel"))))},Y=()=>{let{t:e}=(0,c.useTranslation)(),{register:t,formState:{errors:a},setValue:s}=(0,B.xW)(),{activeGroupUuid:r}=(0,n.useContext)(u.Ay);return(0,n.useEffect)(()=>{r&&s("groupUuid",r)},[r,s]),l().createElement(l().Fragment,null,l().createElement("input",{hidden:!0,...t("groupUuid",{value:r,required:e("chooseGroupError","Please choose a group.")})}),a.groupUuid&&!r&&l().createElement("div",{className:"-esm-fast-data-entry__styles__formError___UKorH"},a.groupUuid.message))},X=()=>{let{t:e}=(0,c.useTranslation)(),{setSessionMeta:t,workflowState:a}=(0,n.useContext)(u.Ay),s=(0,B.mN)();return"NEW_GROUP_SESSION"!==a?null:l().createElement(B.Op,s,l().createElement("form",{onSubmit:s.handleSubmit(e=>{let{sessionDate:a,...n}=e;t({...n,sessionDate:a[0]})})},l().createElement("div",{className:d},l().createElement("div",{className:_},l().createElement("div",{className:p},l().createElement(K,null)),l().createElement("div",{className:E},l().createElement("h4",null,e("newGroupSession","New Group Session")),l().createElement(Y,null),l().createElement("hr",{style:{width:"100%"}}),l().createElement(Q,null))))))};var Z=a(8414),J=a(5246),ee=a(6433);let et=(0,h.getGlobalStore)("ampath-form-state"),ea=()=>{let e=(0,n.useContext)(u.Ay),{activeFormUuid:t,submitForNext:a,patientUuids:r,activePatientUuid:i,workflowState:o}=e,m=(0,h.useStore)(et)[t],d=(0,n.useRef)();(0,n.useEffect)(()=>()=>{d.current?.()},[e.activeFormUuid]);let{t:_}=(0,c.useTranslation)(),p=(0,n.useMemo)(()=>!!m&&("ready"!==m||"EDIT_FORM"!==o)&&"readyWithValidationErrors"!==m,[m,o]),E=i===r[r.length-1];return l().createElement(l().Fragment,null,l().createElement("div",{className:f},l().createElement(s.Button,{kind:"primary",onClick:()=>{("EDIT_FORM"===o||"readyWithValidationErrors"===m)&&a()},disabled:p},E?_("saveForm","Save Form"):_("nextPatient","Next patient")),l().createElement(s.Button,{kind:"secondary",onClick:()=>{d.current?.(),d.current=(0,h.showModal)("fde-complete-session-modal",{onComplete:e.submitForComplete})}},_("saveAndComplete","Save & Complete")),l().createElement(s.Button,{kind:"tertiary",onClick:()=>{d.current?.(),d.current=(0,h.showModal)("fde-cancel-session-modal",{onDiscard:e.destroySession,onSaveAndClose:e.closeSession})}},_("cancel","Cancel"))))},en=()=>{let{groupSessionConcepts:e}=(0,h.useConfig)(),{t}=(0,c.useTranslation)(),{patientUuids:a,activePatientUuid:s,encounters:r,activeEncounterUuid:i,activeVisitUuid:o,activeFormUuid:m,activeGroupUuid:f,activeGroupName:y,activeSessionUuid:v,saveEncounter:g,activeSessionMeta:N,groupVisitTypeUuid:S,updateVisitUuid:C,submitForNext:T,workflowState:b}=(0,n.useContext)(u.Ay),{sessionLocation:w}=(0,h.useSession)();(0,n.useEffect)(()=>{o&&C(o)},[C,o,s]);let x=(0,n.useCallback)(t=>{let a=new Date(N.sessionDate);t.obs.forEach((e,n)=>{t.obs[n]={...e,groupMembers:e.groupMembers?.map(e=>({...e,obsDatetime:a.toISOString()})),obsDatetime:a.toISOString()}});let n=o||(0,Z.A)();if(!o){Object.entries(e).forEach(([e,a])=>{N?.[e]==null||t.obs.some(e=>e.concept===a)||t.obs.push({concept:a,value:N[e]})});let a=[{concept:e.cohortId,value:f},{concept:e.cohortName,value:y},{concept:e.sessionUuid,value:v}];t.obs.push(...a),t.visit={startDatetime:N.sessionDate,stopDatetime:N.sessionDate,uuid:n,patient:{uuid:s},location:{uuid:w?.uuid},visitType:{uuid:S}},C(n)}t.location=w?.uuid,t.encounterDatetime=a.toISOString()},[N,o,w?.uuid,e,f,y,v,s,S,C]),U=(0,n.useCallback)(e=>{e&&e.uuid&&g(e.uuid)},[g]),k=(0,n.useCallback)(e=>{T(e)},[T]);return"NEW_GROUP_SESSION"===b?null:l().createElement("div",{className:d},l().createElement("div",{className:_},l().createElement("div",{className:p},l().createElement(J.A,{patientUuid:s,encounterUuid:i,formUuid:m,handlePostResponse:U,handleEncounterCreate:x,hidePatientBanner:!1})),l().createElement("div",{className:E},l().createElement("h4",null,t("formsFilled","Forms filled")),l().createElement("div",{className:"-esm-fast-data-entry__styles__patientCardsSection___M41-h"},a?.map(e=>l().createElement(ee.A,{key:e,patientUuid:e,activePatientUuid:s,editEncounter:k,encounters:r}))),l().createElement(ea,null))))},el=()=>l().createElement(u.SR,null,l().createElement(V,null),l().createElement(m,null),l().createElement("div",{className:"-esm-fast-data-entry__styles__workspaceWrapper___CDnUs"},l().createElement(X,null),l().createElement(en,null)))},6433(e,t,a){a.d(t,{A:()=>u});var n=a(9184),l=a(2383),s=a(3392),r=a(7979),i=a.n(r),o=a(1291);let c=({onClick:e=()=>void 0,active:t,children:a})=>i().createElement("div",{onClick:e,className:`-esm-fast-data-entry__styles__cardContainer___r35b+ ${!t&&"-esm-fast-data-entry__styles__inactiveCard___mgnR5"}`,role:"button",tabIndex:0},a),u=({patientUuid:e,activePatientUuid:t,editEncounter:a,encounters:r})=>{let u=(0,o.A)(e),m=u?.name?.[0]?.given?.[0],d=u?.name?.[0]?.family,_=u?.identifier?.[0]?.value;if(!u)return i().createElement(c,{active:!0},i().createElement(s.SkeletonText,{className:"-esm-fast-data-entry__styles__skeletonText___W2uKh"}));let p=t===e;return i().createElement(c,{onClick:p?()=>void 0:()=>a(e),active:p},i().createElement("div",{className:"-esm-fast-data-entry__styles__patientInfo___dsLIV"},i().createElement("div",{className:"-esm-fast-data-entry__styles__identifier___pA+fq"},_),i().createElement("div",{className:`-esm-fast-data-entry__styles__displayName___n+VZ8 ${p&&"-esm-fast-data-entry__styles__activeDisplayName___furnV"}`},m," ",d)),i().createElement("div",null,e in r?i().createElement(n.cR,{size:16,className:"-esm-fast-data-entry__styles__statusSuccess___1nZk2"}):i().createElement(l.Cp,{size:16,className:"-esm-fast-data-entry__styles__statusWarning___QxLWO"})))}}}]);
|
package/dist/6977.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["6977"],{1154(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){var n,a;n=t,a=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}r.d(t,{A:()=>d});var o=["width","height","viewBox"],s=["tabindex"],l={focusable:"false",preserveAspectRatio:"xMidYMid meet"},u=r(5556),c=r.n(u),p=r(7979),m=r.n(p);let d=m().forwardRef(function({className:e,children:t,tabIndex:r,xmlns:n="http://www.w3.org/2000/svg",preserveAspectRatio:u="xMidYMid meet",...c},p){let{tabindex:d,...f}=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height,n=e.viewBox,u=void 0===n?"0 0 ".concat(t," ").concat(r):n,c=i(e,o),p=c.tabindex,m=i(c,s),d=a(a(a({},l),m),{},{width:t,height:r,viewBox:u});return d["aria-label"]||d["aria-labelledby"]||d.title?(d.role="img",null!=p&&(d.focusable="true",d.tabindex=p)):d["aria-hidden"]=!0,d}({...c,tabindex:r});return e&&(f.className=e),null!=d&&("number"==typeof d?f.tabIndex=d:f.tabIndex=Number(r)),p&&(f.ref=p),n&&(f.xmlns=n),u&&(f.preserveAspectRatio=u),m().createElement("svg",f,t)});d.displayName="Icon",d.propTypes={"aria-hidden":c().oneOfType([c().bool,c().oneOf(["true","false"])]),"aria-label":c().string,"aria-labelledby":c().string,children:c().node,className:c().string,height:c().oneOfType([c().number,c().string]),preserveAspectRatio:c().string,tabIndex:c().oneOfType([c().number,c().string]),viewBox:c().string,width:c().oneOfType([c().number,c().string]),xmlns:c().string}},2694(e,t,r){"use strict";var n=r(6925);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,i,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},5556(e,t,r){e.exports=r(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2263(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>f});var n=r(7979),a=r.n(n),i=r(3826),o=r(3392),s=r(5576),l=r(
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([["6977"],{1154(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){var n,a;n=t,a=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}r.d(t,{A:()=>d});var o=["width","height","viewBox"],s=["tabindex"],l={focusable:"false",preserveAspectRatio:"xMidYMid meet"},u=r(5556),c=r.n(u),p=r(7979),m=r.n(p);let d=m().forwardRef(function({className:e,children:t,tabIndex:r,xmlns:n="http://www.w3.org/2000/svg",preserveAspectRatio:u="xMidYMid meet",...c},p){let{tabindex:d,...f}=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height,n=e.viewBox,u=void 0===n?"0 0 ".concat(t," ").concat(r):n,c=i(e,o),p=c.tabindex,m=i(c,s),d=a(a(a({},l),m),{},{width:t,height:r,viewBox:u});return d["aria-label"]||d["aria-labelledby"]||d.title?(d.role="img",null!=p&&(d.focusable="true",d.tabindex=p)):d["aria-hidden"]=!0,d}({...c,tabindex:r});return e&&(f.className=e),null!=d&&("number"==typeof d?f.tabIndex=d:f.tabIndex=Number(r)),p&&(f.ref=p),n&&(f.xmlns=n),u&&(f.preserveAspectRatio=u),m().createElement("svg",f,t)});d.displayName="Icon",d.propTypes={"aria-hidden":c().oneOfType([c().bool,c().oneOf(["true","false"])]),"aria-label":c().string,"aria-labelledby":c().string,children:c().node,className:c().string,height:c().oneOfType([c().number,c().string]),preserveAspectRatio:c().string,tabIndex:c().oneOfType([c().number,c().string]),viewBox:c().string,width:c().oneOfType([c().number,c().string]),xmlns:c().string}},2694(e,t,r){"use strict";var n=r(6925);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,i,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},5556(e,t,r){e.exports=r(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2263(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>f});var n=r(7979),a=r.n(n),i=r(3826),o=r(3392),s=r(5576),l=r(2908),u=r(4961);async function c(e){let t=`${l.restBaseUrl}/cohortm/cohort${e.uuid?`/${e.uuid}`:""}`,{data:r}=await (0,l.openmrsFetch)(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e});return r}let p={searchBar:"-esm-fast-data-entry__styles__searchBar___wo5xM",formError:"-esm-fast-data-entry__styles__formError___d-72S",patientRow:"-esm-fast-data-entry__styles__patientRow___a+mZz",patientName:"-esm-fast-data-entry__styles__patientName___U6z0i",loading:"-esm-fast-data-entry__styles__loading___sm3Fx"},m=({patient:e,removePatient:t})=>{let{t:r}=(0,i.useTranslation)(),{patient:u,error:c,isLoading:m}=(0,l.usePatient)(e?.uuid),d=(0,n.useCallback)(()=>t(e?.uuid),[e,t]),f=(0,n.useMemo)(()=>{if(m||c||!u)return"";let{identifier:e,name:t}=u,r=e?.[0]?.value||"",n=`${(t?.[0]?.given||[]).join(" ")} ${t?.[0]?.family||""}`;return`${r?`${r} -`:""}${n?` ${n}`:""}`.trim()},[m,c,u]);return a().createElement("li",{className:p.patientRow},a().createElement("span",null,a().createElement(o.Button,{kind:"tertiary",size:"sm",hasIconOnly:!0,onClick:d,renderIcon:s.zH,tooltipAlignment:"start",tooltipPosition:"top",iconDescription:r("remove","Remove")})),a().createElement("span",{className:p.patientName},f))},d=e=>{let{name:t,setName:r,patientList:s,updatePatientList:u,errors:c,validate:d,removePatient:f}=e,{t:y}=(0,i.useTranslation)(),b=(0,n.useMemo)(()=>({selectPatientAction:u,buttonProps:{kind:"secondary"}}),[u]);return a().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1rem"}},a().createElement(o.TextInput,{id:"newGroupName",labelText:y("newGroupName","New Group Name"),value:t,onChange:e=>r(e.target.value),onBlur:()=>d("name")}),c?.name&&a().createElement("p",{className:p.formError},"required"===c.name?y("groupNameError","Please enter a group name."):c.name),a().createElement(o.FormLabel,null,s.length," ",y("patientsInGroup","Patients in group")),c?.patientList&&a().createElement("p",{className:p.formError},y("noPatientError","Please enter at least one patient.")),!c?.patientList&&a().createElement("ul",{className:p.patientList},s?.map((e,t)=>a().createElement(m,{patient:e,removePatient:f,key:e.uuid}))),a().createElement(o.FormLabel,null,y("searchForPatientsToAddToGroup","Search for patients to add to group")),a().createElement("div",{className:p.searchBar},a().createElement(l.ExtensionSlot,{name:"patient-search-bar-slot",state:b})))},f=({patients:e,isCreate:t,groupName:r="",cohortUuid:s,close:p,onSave:m})=>{let{t:f}=(0,i.useTranslation)(),[y,b]=(0,n.useState)({}),[h,g]=(0,n.useState)(r),[_,v]=(0,n.useState)(e||[]),[E,w]=(0,n.useState)(!1),O=(0,l.useConfig)(),[P,T]=(0,n.useState)(),{hsuIdentifier:k}=(0,u.i)(P),{sessionLocation:x}=(0,l.useSession)(),{uuid:S,display:C}=x??{},{uuid:L,display:j}=k?.location??{},N=(0,n.useCallback)(e=>v(t=>t.filter(t=>t.uuid!==e)),[v]),M=(0,n.useCallback)(e=>{let t=!0;return e?(t="name"===e?!!h:!!_.length,b(r=>({...r,[e]:t?null:"required"}))):(h?b(e=>({...e,name:null})):(b(e=>({...e,name:"required"})),t=!1),_.length?b(e=>({...e,patientList:null})):(b(e=>({...e,patientList:"required"})),t=!1)),t},[h,_.length]),B=(0,n.useCallback)(()=>{function e(e){return[e?.name?.[0]?.given,e?.name?.[0]?.family].join(" ")}_.find(e=>e.uuid===P)||(0,l.fetchCurrentPatient)(P).then(t=>{v([..._,{uuid:P,...t}].sort((t,r)=>e(t).localeCompare(e(r),void 0,{sensitivity:"base"})))}),b(e=>({...e,patientList:null})),T(null)},[P,_,v]);(0,n.useEffect)(()=>{if(!P||!L)return;let e=S!==L;if(e&&O.enforcePatientListLocationMatch)(0,l.showSnackbar)({kind:"error",title:f("locationMismatch","Location Mismatch"),subtitle:f("patientLocationMismatchEnforced","Cannot add patient from {{hsuLocation}} to a session at {{sessionLocation}}",{hsuLocation:j,sessionLocation:C})}),T(null);else if(O.patientLocationMismatchCheck&&e){let e=!0,t=(0,l.showModal)("fde-patient-location-mismatch-modal",{onConfirm:B,sessionLocation:{uuid:S,display:C},hsuLocation:{uuid:L,display:j}},()=>{e&&T(null)});return()=>{e=!1,t()}}else B()},[P,S,C,L,j,B,O.patientLocationMismatchCheck,O.enforcePatientListLocationMatch,f]);let I=async()=>{let e;if(!M())return;w(!0);let t=_.map(e=>({patient:{uuid:e.uuid}}));try{e=await c({uuid:s,name:h,cohortType:O?.groupSessionConcepts?.cohortTypeId,location:x?.uuid,cohortMembers:_.map(e=>({patient:e.uuid,startDate:new Date().toISOString()}))})}catch(t){let e=t?.responseBody?.error??t?.responseBody??t;(0,l.showSnackbar)({kind:"error",title:f("postError","POST Error"),subtitle:e?.message??f("unknownPostError","An unknown error occurred while saving data")}),e?.fieldErrors&&b(Object.fromEntries(Object.entries(e.fieldErrors).map(([e,t])=>[e,t?.[0]?.message])));return}finally{w(!1)}m({...e,cohortMembers:t}),p()};return a().createElement(a().Fragment,null,a().createElement(o.ModalHeader,{closeModal:p},t?f("createNewGroup","Create New Group"):f("editGroup","Edit Group")),a().createElement(o.ModalBody,null,a().createElement(d,{name:h,setName:g,patientList:_,updatePatientList:e=>{T(e)},errors:y,validate:M,removePatient:N})),a().createElement(o.ModalFooter,null,a().createElement(o.Button,{kind:"secondary",onClick:p},f("cancel","Cancel")),a().createElement(o.Button,{kind:"primary",onClick:I,disabled:E},t?f("createGroup","Create Group"):f("save","Save"))))}},4961(e,t,r){"use strict";r.d(t,{i:()=>o});var n=r(1943),a=r.n(n),i=r(2908);function o(e){let t=e?`ws/rest/v1/patient/${e}/identifier`:null,{data:r,error:n,isValidating:o}=a()(t,i.openmrsFetch);return{hsuIdentifier:r?.data?.results.length?r.data.results.find(e=>"05a29f94-c0ed-11e2-94be-8c13b969e334"==e.identifierType.uuid):void 0,isLoading:!r&&!n,isError:n,isValidating:o}}}}]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var _openmrs_esm_fast_data_entry_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-fast-data-entry-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-fast-data-entry-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,a={7408(e,t,r){"use strict";var n,o,a,i,s,l,u,p,c,d,f,h,m=r(7032),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!=(a=null==(p=r.initializeSharingData)?void 0:p.scopeToSharingDataMapping)?a:{},M=null!=(i=null==(c=r.consumesLoadingData)?void 0:c.chunkMapping)?i:{},O=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(O))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-fast-data-entry-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:a,eager:i,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(i)&&(p.eager=i),c(u)&&(p.strictVersion=u);let d={version:o,scope:[t],shareConfig:p,get:a};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:M,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})}},1176(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},9369(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(i(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,l=a(t),u=0,p=l.length;u<p;u++)i=l[u],s.call(e,i)||void 0===i||n(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(r=o(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},1222(e,t,r){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r(9369);let n=r(1146),o=r(3054),a={...o.helpers.global,getGlobalFederationInstance:n.getGlobalFederationInstance},i=o.helpers.share,s=o.helpers.utils;t.default={global:a,share:i,utils:s},t.global=a,t.share=i,t.utils=s},7201(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),r(9369);let n=r(1146),o=r(3054),a=r(9170);function i(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=i,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=i(r)},t.loadRemote=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.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,a.RUNTIME_009,a.runtimeDescMap),s.loadShare.apply(s,e)},t.loadShareSync=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.runtimeDescMap),s.loadShareSync.apply(s,e)},t.preloadRemote=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.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,a.RUNTIME_009,a.runtimeDescMap),s.registerPlugins.apply(s,e)},t.registerRemotes=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.runtimeDescMap),s.registerRemotes.apply(s,e)},t.registerShared=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.runtimeDescMap),s.registerShared.apply(s,e)}},1146(e,t,r){r(9369);let n=r(3054);t.getGlobalFederationInstance=function(e,t){let r="@openmrs/esm-fast-data-entry-app:1.5.1-pre.982";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)}},1326(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(i(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,l=a(t),u=0,p=l.length;u<p;u++)i=l[u],s.call(e,i)||void 0===i||n(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(r=o(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},3026(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)}},9592(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.FEDERATION_SUPPORTED_TYPES=["script"]},5769(e,t,r){let n=r(3026),o=r(9671),a=r(9864),i=r(9296),s=r(2742);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=a.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(i.RUNTIME_012,{[i.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)}})}},9296(e,t){t.RUNTIME_012="RUNTIME-012"},2742(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_fast_data_entry_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-fast-data-entry-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-fast-data-entry-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,a={7408(e,t,r){"use strict";var n,o,a,i,s,l,u,p,c,d,f,h,m=r(7032),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!=(a=null==(p=r.initializeSharingData)?void 0:p.scopeToSharingDataMapping)?a:{},M=null!=(i=null==(c=r.consumesLoadingData)?void 0:c.chunkMapping)?i:{},O=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(O))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-fast-data-entry-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:a,eager:i,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(i)&&(p.eager=i),c(u)&&(p.strictVersion=u);let d={version:o,scope:[t],shareConfig:p,get:a};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:M,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})}},1176(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},9369(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(i(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,l=a(t),u=0,p=l.length;u<p;u++)i=l[u],s.call(e,i)||void 0===i||n(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(r=o(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},1222(e,t,r){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r(9369);let n=r(1146),o=r(3054),a={...o.helpers.global,getGlobalFederationInstance:n.getGlobalFederationInstance},i=o.helpers.share,s=o.helpers.utils;t.default={global:a,share:i,utils:s},t.global=a,t.share=i,t.utils=s},7201(e,t,r){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),r(9369);let n=r(1146),o=r(3054),a=r(9170);function i(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=i,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=i(r)},t.loadRemote=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.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,a.RUNTIME_009,a.runtimeDescMap),s.loadShare.apply(s,e)},t.loadShareSync=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.runtimeDescMap),s.loadShareSync.apply(s,e)},t.preloadRemote=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.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,a.RUNTIME_009,a.runtimeDescMap),s.registerPlugins.apply(s,e)},t.registerRemotes=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.runtimeDescMap),s.registerRemotes.apply(s,e)},t.registerShared=function(...e){return(0,o.assert)(s,a.RUNTIME_009,a.runtimeDescMap),s.registerShared.apply(s,e)}},1146(e,t,r){r(9369);let n=r(3054);t.getGlobalFederationInstance=function(e,t){let r="@openmrs/esm-fast-data-entry-app:1.5.1-pre.986";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)}},1326(e,t){var r=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;t.__toESM=(e,t,l)=>(l=null!=e?r(i(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,l=a(t),u=0,p=l.length;u<p;u++)i=l[u],s.call(e,i)||void 0===i||n(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(r=o(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e))},3026(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)}},9592(e,t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.FEDERATION_SUPPORTED_TYPES=["script"]},5769(e,t,r){let n=r(3026),o=r(9671),a=r(9864),i=r(9296),s=r(2742);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=a.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(i.RUNTIME_012,{[i.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)}})}},9296(e,t){t.RUNTIME_012="RUNTIME-012"},2742(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")}},2176(e,t){t.getSharedFallbackGetter=({shareKey:e,factory:t,version:r,webpackRequire:n,libraryType:o="global"})=>{let{runtime:a,instance:i,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()=>a.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())})}},9864(e,t){t.getUsedExports=function(e,t){let r=e.federation.usedExports;if(r)return r[t]}},7032(e,t,r){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let n=r(1326),o=r(3026),a=r(5313),i=r(5769),s=r(2614),l=r(8066),u=r(8593),p=r(6554),c=r(2176),d=r(7201);d=n.__toESM(d);let f={remotes:a.remotes,consumes:i.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}})},6554(e,t,r){let n=r(1326),o=r(7201),a=r(1222);a=n.__toESM(a),t.init=function({webpackRequire:e}){let{initOptions:t,runtime:n,sharedFallback:i,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(!i)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=a.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:a}=t;if(!a)return;let{secondarySharedTreeShakingName:i,secondarySharedTreeShakingEntry:s,treeShakingStatus:p}=n;a.status!==p&&(a.status=p,s&&l&&i&&(a.get=async()=>{let e=await (0,o.getRemoteEntry)({origin:u,remoteInfo:{name:i,entry:s,type:l,entryGlobalName:i,shareScope:"default"}});return await e.init(u,r.federation.bundlerRuntime),e.get()}))})(e,t)})),t}}),n.init(t)}},8593(e,t){t.initContainerEntry=function(e){let{webpackRequire:t,shareScope:r,initScope:n,shareScopeKey:o,remoteEntryInitOptions:a}=e;if(!t.S||!t.federation||!t.federation.instance||!t.federation.initOptions)return;let i=t.federation.instance;i.initOptions({name:t.federation.initOptions.name,remotes:[],...a});let s=a?.shareScopeKeys,l=a?.shareScopeMap;if(o&&"string"!=typeof o)o.forEach(e=>{if(!s||!l)return void i.initShareScopeMap(e,r,{hostShareScopeMap:a?.shareScopeMap||{}});l[e]||(l[e]={});let t=l[e];i.initShareScopeMap(e,t,{hostShareScopeMap:a?.shareScopeMap||{}})});else{let e=o||"default";Array.isArray(s)?s.forEach(e=>{l[e]||(l[e]={});let t=l[e];i.initShareScopeMap(e,t,{hostShareScopeMap:a?.shareScopeMap||{}})}):i.initShareScopeMap(e,r,{hostShareScopeMap:a?.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)}},2614(e,t,r){let n=r(3026),o=r(9592);t.initializeSharing=function({shareScopeName:e,webpackRequire:t,initPromises:r,initTokens:a,initScope:i}){let s=Array.isArray(e)?e:[e];var l=[],u=function(s){i||(i=[]);let l=t.federation.instance;var u=a[s];if(u||(u=a[s]={from:l.name}),i.indexOf(u)>=0)return;i.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 a=r=>r&&r.init&&r.init(t.S[s],i,{shareScopeMap:t.S||{},shareScopeKeys:e});if(o.then)return d.push(o.then(a,n));var l=a(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:i,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)}},8066(e,t,r){let n=r(9671),o=r(9864);t.installInitialConsumes=function(e){n.updateConsumeOptions(e);let{moduleToHandlerMapping:t,webpackRequire:r,installedModules:a,initialConsumes:i,asyncLoad:s}=e,l=[];i.forEach(e=>{l.push([e,()=>(function(e){let{moduleId:t,moduleToHandlerMapping:r,webpackRequire:n,asyncLoad:a}=e,i=n.federation.instance;if(!i)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:[i.options.name]}),a)return i.loadShare(s,{customShareInfo:t});return i.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=>{a[e]=0,delete r.c[e];let i=n();if("function"!=typeof i)throw Error(`Shared module is not available for eager consumption: ${e}`);let s=i(),{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)})}},5313(e,t,r){r(1326);let n=r(3026),o=r(9592),a=r(9671),i=r(1853);t.remotes=function(e){a.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],a=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,a,i,s)=>{try{let u=e(t,o);if(!u||!u.then)return i(u,a,s);{let e=u.then(e=>i(e,a),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===a.length&&o.FEDERATION_SUPPORTED_TYPES.includes(a[0].externalType)&&a[0].name?c(()=>{try{let e=(0,i.decodeName)(a[0].name,i.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)})}},9671(e,t){t.updateConsumeOptions=function(e){let{webpackRequire:t,moduleToHandlerMapping:r}=e,{consumesLoadingData:n,initializeSharingData:o}=t,{sharedFallback:a,bundlerRuntime:i,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:a?i?.getSharedFallbackGetter({shareKey:n.shareKey,factory:n.fallback,webpackRequire:t,libraryType:s}):n.fallback,treeShakingGetter:a?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:a?{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:a,eager:i,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(i)&&(p.eager=i),c(u)&&(p.strictVersion=u);let d={version:o,scope:[e],shareConfig:p,get:a};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:a}=t,i=t.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!a||a._updated||!i)return;let{chunkMapping:s,moduleIdToRemoteDataMapping:l}=a;if(s&&l){for(let[e,t]of Object.entries(l))if(r[e]||(r[e]=[t.shareScope,t.name,t.externalModuleId]),!n[e]&&i[t.remoteName]){let r=i[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)})}),a._updated=1}}}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e].call(r.exports,r,r.exports,s),r.exports}s.m=a,s.c=i,s.x=()=>s(1176),s.federation||(s.federation={chunkMatcher:function(e){return!/^(9(177|384|823)|2044|3080|4811|6028|7584)$/.test(e)},rootOutputDir:""}),s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},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),l={},s.l=function(e,t,r,n){if(l[e])return void l[e].push(t);if(void 0!==r)for(var o,a,i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var p=i[u];if(p.getAttribute("src")==e||p.getAttribute("data-rspack")=="@openmrs/esm-fast-data-entry-app:"+r){o=p;break}}o||(a=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@openmrs/esm-fast-data-entry-app:"+r),o.src=e),l[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(d);var n=l[e];if(delete l[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),a&&document.head.appendChild(o)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.rv=()=>"1.7.9",s.S={},s.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@carbon/react",version:"1.92.1",factory:()=>Promise.all([s.e("6323"),s.e("4480"),s.e("9632"),s.e("1617"),s.e("4493"),s.e("3080"),s.e("9384")]).then(()=>()=>s(1020)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"@openmrs/esm-framework",version:"10.0.1-pre.5753",factory:()=>Promise.all([s.e("4480"),s.e("9632"),s.e("6685"),s.e("3080"),s.e("9823"),s.e("9177"),s.e("6028"),s.e("9384"),s.e("4811"),s.e("2044"),s.e("7584")]).then(()=>()=>s(8165)),eager:0,singleton:1,requiredVersion:"10.x",strictVersion:0},{name:"lodash-es",version:"4.17.21",factory:()=>s.e("540").then(()=>()=>s(5959)),eager:0,singleton:1,requiredVersion:"4.x",strictVersion:0},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([s.e("5098"),s.e("3080")]).then(()=>()=>s(961)),eager:0,singleton:1,requiredVersion:"18.x",strictVersion:0},{name:"react-i18next",version:"11.18.6",factory:()=>Promise.all([s.e("820"),s.e("3080")]).then(()=>()=>s(4127)),eager:0,singleton:1,requiredVersion:"11.x",strictVersion:0},{name:"react-router-dom",version:"6.22.3",factory:()=>Promise.all([s.e("749"),s.e("3080"),s.e("9384")]).then(()=>()=>s(6204)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"react",version:"18.3.1",factory:()=>s.e("6237").then(()=>()=>s(6540)),eager:0,singleton:1,requiredVersion:"18.x",strictVersion:0},{name:"swr/_internal",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("3080")]).then(()=>()=>s(4993)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/immutable",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3080"),s.e("5898")]).then(()=>()=>s(4225)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/infinite",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3080"),s.e("1578")]).then(()=>()=>s(3041)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3080"),s.e("8410")]).then(()=>()=>s(2177)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0}]},uniqueName:"@openmrs/esm-fast-data-entry-app"},s.I=s.I||function(){throw Error("should have __webpack_require__.I")},s.g.importScripts&&(u=s.g.location+"");var l,u,p=s.g.document;if(!u&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(u=p.currentScript.src),!u)){var c=p.getElementsByTagName("script");if(c.length)for(var d=c.length-1;d>-1&&(!u||!/^http(s?):/.test(u));)u=c[d--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");if(s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.consumesLoadingData={chunkMapping:{2044:["9943"],3080:["7979"],9384:["539"],6028:["1943"],9823:["3826"],9177:["3392"],4811:["1881","2398"],7584:["6088","7956"],3378:["8345"]},moduleIdToConsumeDataMapping:{6088:{shareScope:"default",shareKey:"swr/immutable",import:"swr/immutable",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3517")]).then(()=>()=>s(4225))},3826:{shareScope:"default",shareKey:"react-i18next",import:"react-i18next",requiredVersion:"11.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("820").then(()=>()=>s(4127))},7979:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("6237").then(()=>()=>s(6540))},3392:{shareScope:"default",shareKey:"@carbon/react",import:"@carbon/react",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6323"),s.e("4480"),s.e("9632"),s.e("1617"),s.e("4493"),s.e("9384")]).then(()=>()=>s(1020))},539:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("5098").then(()=>()=>s(961))},8345:{shareScope:"default",shareKey:"@openmrs/esm-framework",import:"@openmrs/esm-framework",requiredVersion:"10.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("4480"),s.e("9632"),s.e("6685"),s.e("3080"),s.e("9823"),s.e("9177"),s.e("6028"),s.e("9384"),s.e("4811"),s.e("2044"),s.e("7584")]).then(()=>()=>s(8165))},1881:{shareScope:"default",shareKey:"lodash-es",import:"lodash-es",requiredVersion:"4.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("540").then(()=>()=>s(5959))},2398:{shareScope:"default",shareKey:"swr/infinite",import:"swr/infinite",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("9197")]).then(()=>()=>s(3041))},9943:{shareScope:"default",shareKey:"react-router-dom",import:"react-router-dom",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("749"),s.e("9384")]).then(()=>()=>s(6204))},7956:{shareScope:"default",shareKey:"swr/_internal",import:"swr/_internal",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("6362").then(()=>()=>s(4993))},1943:{shareScope:"default",shareKey:"swr",import:"swr",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("6029")]).then(()=>()=>s(2177))}},initialConsumes:[]},s.f.consumes=s.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},"u">typeof document){var f=function(e,t,r,n,o){var a=document.createElement("link");return a.rel="stylesheet",a.type="text/css",s.nc&&(a.nonce=s.nc),a.href=t,a.onerror=a.onload=function(r){if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=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=i,l.request=s,a.parentNode&&a.parentNode.removeChild(a),o(l)}},r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a),a},h=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],a=o.getAttribute("data-href")||o.getAttribute("href");if(a&&(a=a.split("?")[0]),"stylesheet"===o.rel&&(a===e||a===t))return o}for(var i=document.getElementsByTagName("style"),n=0;n<i.length;n++){var o=i[n],a=o.getAttribute("data-href");if(a===e||a===t)return o}},m={2707:0};s.f.miniCss=function(e,t){if(m[e])t.push(m[e]);else 0!==m[e]&&({1519:1,6107:1,6606:1,6685:1,6977:1})[e]&&t.push(m[e]=new Promise(function(t,r){var n=s.miniCssF(e),o=s.p+n;if(h(n,o))return t();f(e,o,null,t,r)}).then(function(){m[e]=0},function(t){throw delete m[e],t}))}}s.initializeExposesData={moduleMap:{"./start":()=>s.e("3378").then(()=>()=>s(7481))},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={2707: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(/^(9(177|384|823)|2044|3080|4811|6028|7584)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var a=s.p+s.u(t),i=Error();s.l(a,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),a=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}},"chunk-"+t,t)}},t=(t,r)=>{var n,o,[a,i,l]=r,u=0;if(a.some(t=>0!==e[t])){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);l&&l(s)}for(t&&t(r);u<a.length;u++)o=a[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},(r=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_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(7408)),"function"==typeof n)return n();console.warn("[MF] Invalid prevStartup")},_openmrs_esm_fast_data_entry_app=s.x()})();
|
|
3
|
+
while loading "${n[1]}" from ${n[2]}`),s.m[e]=()=>{throw t},n.p=0},c=(e,t,o,a,i,s)=>{try{let u=e(t,o);if(!u||!u.then)return i(u,a,s);{let e=u.then(e=>i(e,a),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===a.length&&o.FEDERATION_SUPPORTED_TYPES.includes(a[0].externalType)&&a[0].name?c(()=>{try{let e=(0,i.decodeName)(a[0].name,i.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)})}},9671(e,t){t.updateConsumeOptions=function(e){let{webpackRequire:t,moduleToHandlerMapping:r}=e,{consumesLoadingData:n,initializeSharingData:o}=t,{sharedFallback:a,bundlerRuntime:i,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:a?i?.getSharedFallbackGetter({shareKey:n.shareKey,factory:n.fallback,webpackRequire:t,libraryType:s}):n.fallback,treeShakingGetter:a?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:a?{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:a,eager:i,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(i)&&(p.eager=i),c(u)&&(p.strictVersion=u);let d={version:o,scope:[e],shareConfig:p,get:a};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:a}=t,i=t.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!a||a._updated||!i)return;let{chunkMapping:s,moduleIdToRemoteDataMapping:l}=a;if(s&&l){for(let[e,t]of Object.entries(l))if(r[e]||(r[e]=[t.shareScope,t.name,t.externalModuleId]),!n[e]&&i[t.remoteName]){let r=i[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)})}),a._updated=1}}}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e].call(r.exports,r,r.exports,s),r.exports}s.m=a,s.c=i,s.x=()=>s(1176),s.federation||(s.federation={chunkMatcher:function(e){return!/^(9(177|384|823)|2044|3080|4811|6028|7584)$/.test(e)},rootOutputDir:""}),s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},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),l={},s.l=function(e,t,r,n){if(l[e])return void l[e].push(t);if(void 0!==r)for(var o,a,i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var p=i[u];if(p.getAttribute("src")==e||p.getAttribute("data-rspack")=="@openmrs/esm-fast-data-entry-app:"+r){o=p;break}}o||(a=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@openmrs/esm-fast-data-entry-app:"+r),o.src=e),l[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(d);var n=l[e];if(delete l[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),a&&document.head.appendChild(o)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.rv=()=>"1.7.9",s.S={},s.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@carbon/react",version:"1.92.1",factory:()=>Promise.all([s.e("6323"),s.e("4480"),s.e("9632"),s.e("1617"),s.e("4493"),s.e("3080"),s.e("9384")]).then(()=>()=>s(1020)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"@openmrs/esm-framework",version:"11.0.1-pre.5762",factory:()=>Promise.all([s.e("4480"),s.e("9632"),s.e("6685"),s.e("3080"),s.e("9823"),s.e("9177"),s.e("6028"),s.e("9384"),s.e("4811"),s.e("2044"),s.e("7584")]).then(()=>()=>s(8165)),eager:0,singleton:1,requiredVersion:"11.x",strictVersion:0},{name:"lodash-es",version:"4.17.21",factory:()=>s.e("540").then(()=>()=>s(5959)),eager:0,singleton:1,requiredVersion:"4.x",strictVersion:0},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([s.e("5098"),s.e("3080")]).then(()=>()=>s(961)),eager:0,singleton:1,requiredVersion:"18.x",strictVersion:0},{name:"react-i18next",version:"11.18.6",factory:()=>Promise.all([s.e("820"),s.e("3080")]).then(()=>()=>s(4127)),eager:0,singleton:1,requiredVersion:"11.x",strictVersion:0},{name:"react-router-dom",version:"6.22.3",factory:()=>Promise.all([s.e("749"),s.e("3080"),s.e("9384")]).then(()=>()=>s(6204)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"react",version:"18.3.1",factory:()=>s.e("6237").then(()=>()=>s(6540)),eager:0,singleton:1,requiredVersion:"18.x",strictVersion:0},{name:"swr/_internal",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("3080")]).then(()=>()=>s(4993)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/immutable",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3080"),s.e("5898")]).then(()=>()=>s(4225)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/infinite",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3080"),s.e("1578")]).then(()=>()=>s(3041)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr",version:"2.5.1",factory:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3080"),s.e("8410")]).then(()=>()=>s(2177)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0}]},uniqueName:"@openmrs/esm-fast-data-entry-app"},s.I=s.I||function(){throw Error("should have __webpack_require__.I")},s.g.importScripts&&(u=s.g.location+"");var l,u,p=s.g.document;if(!u&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(u=p.currentScript.src),!u)){var c=p.getElementsByTagName("script");if(c.length)for(var d=c.length-1;d>-1&&(!u||!/^http(s?):/.test(u));)u=c[d--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");if(s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.consumesLoadingData={chunkMapping:{2044:["9943"],3080:["7979"],9384:["539"],6028:["1943"],9823:["3826"],9177:["3392"],4811:["1881","2398"],7584:["6088","7956"],3378:["2908"]},moduleIdToConsumeDataMapping:{6088:{shareScope:"default",shareKey:"swr/immutable",import:"swr/immutable",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("3517")]).then(()=>()=>s(4225))},3826:{shareScope:"default",shareKey:"react-i18next",import:"react-i18next",requiredVersion:"11.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("820").then(()=>()=>s(4127))},7979:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("6237").then(()=>()=>s(6540))},3392:{shareScope:"default",shareKey:"@carbon/react",import:"@carbon/react",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6323"),s.e("4480"),s.e("9632"),s.e("1617"),s.e("4493"),s.e("9384")]).then(()=>()=>s(1020))},539:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("5098").then(()=>()=>s(961))},2908:{shareScope:"default",shareKey:"@openmrs/esm-framework",import:"@openmrs/esm-framework",requiredVersion:"11.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("4480"),s.e("9632"),s.e("6685"),s.e("3080"),s.e("9823"),s.e("9177"),s.e("6028"),s.e("9384"),s.e("4811"),s.e("2044"),s.e("7584")]).then(()=>()=>s(8165))},1881:{shareScope:"default",shareKey:"lodash-es",import:"lodash-es",requiredVersion:"4.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("540").then(()=>()=>s(5959))},2398:{shareScope:"default",shareKey:"swr/infinite",import:"swr/infinite",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("9197")]).then(()=>()=>s(3041))},9943:{shareScope:"default",shareKey:"react-router-dom",import:"react-router-dom",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("749"),s.e("9384")]).then(()=>()=>s(6204))},7956:{shareScope:"default",shareKey:"swr/_internal",import:"swr/_internal",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>s.e("6362").then(()=>()=>s(4993))},1943:{shareScope:"default",shareKey:"swr",import:"swr",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([s.e("6362"),s.e("7977"),s.e("6029")]).then(()=>()=>s(2177))}},initialConsumes:[]},s.f.consumes=s.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},"u">typeof document){var f=function(e,t,r,n,o){var a=document.createElement("link");return a.rel="stylesheet",a.type="text/css",s.nc&&(a.nonce=s.nc),a.href=t,a.onerror=a.onload=function(r){if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=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=i,l.request=s,a.parentNode&&a.parentNode.removeChild(a),o(l)}},r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a),a},h=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],a=o.getAttribute("data-href")||o.getAttribute("href");if(a&&(a=a.split("?")[0]),"stylesheet"===o.rel&&(a===e||a===t))return o}for(var i=document.getElementsByTagName("style"),n=0;n<i.length;n++){var o=i[n],a=o.getAttribute("data-href");if(a===e||a===t)return o}},m={2707:0};s.f.miniCss=function(e,t){if(m[e])t.push(m[e]);else 0!==m[e]&&({1519:1,6107:1,6606:1,6685:1,6977:1})[e]&&t.push(m[e]=new Promise(function(t,r){var n=s.miniCssF(e),o=s.p+n;if(h(n,o))return t();f(e,o,null,t,r)}).then(function(){m[e]=0},function(t){throw delete m[e],t}))}}s.initializeExposesData={moduleMap:{"./start":()=>s.e("3378").then(()=>()=>s(7481))},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={2707: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(/^(9(177|384|823)|2044|3080|4811|6028|7584)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var a=s.p+s.u(t),i=Error();s.l(a,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),a=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}},"chunk-"+t,t)}},t=(t,r)=>{var n,o,[a,i,l]=r,u=0;if(a.some(t=>0!==e[t])){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);l&&l(s)}for(t&&t(r);u<a.length;u++)o=a[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},(r=globalThis.webpackChunk_openmrs_esm_fast_data_entry_app=globalThis.webpackChunk_openmrs_esm_fast_data_entry_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(7408)),"function"==typeof n)return n();console.warn("[MF] Invalid prevStartup")},_openmrs_esm_fast_data_entry_app=s.x()})();
|
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"},"pages":[{"component":"root","routeRegex":"forms","online":true,"offline":true}],"extensions":[{"name":"forms-app-link","slot":"app-menu-slot","component":"formsAppMenuLink","online":true,"offline":true}],"modals":[{"name":"fde-cancel-session-modal","component":"cancelSessionModal"},{"name":"fde-complete-session-modal","component":"completeSessionModal"},{"name":"fde-add-group-modal","component":"addGroupModal"},{"name":"fde-patient-location-mismatch-modal","component":"patientLocationMismatchModal"}],"version":"1.5.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"pages":[{"component":"root","routeRegex":"forms","online":true,"offline":true}],"extensions":[{"name":"forms-app-link","slot":"app-menu-slot","component":"formsAppMenuLink","online":true,"offline":true}],"modals":[{"name":"fde-cancel-session-modal","component":"cancelSessionModal"},{"name":"fde-complete-session-modal","component":"completeSessionModal"},{"name":"fde-add-group-modal","component":"addGroupModal"},{"name":"fde-patient-location-mismatch-modal","component":"patientLocationMismatchModal"}],"version":"1.5.1-pre.986"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-fast-data-entry-app",
|
|
3
|
-
"version": "1.5.1-pre.
|
|
3
|
+
"version": "1.5.1-pre.986",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "O3 frontend module for fast data entry using the OpenMRS Angular Form Engine",
|
|
6
6
|
"browser": "dist/openmrs-esm-fast-data-entry-app.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@carbon/react": "1.x",
|
|
46
|
-
"@openmrs/esm-framework": "
|
|
46
|
+
"@openmrs/esm-framework": "11.x",
|
|
47
47
|
"lodash-es": "4.x",
|
|
48
48
|
"react": "18.x",
|
|
49
49
|
"react-dom": "18.x",
|