@openmrs/esm-appointments-app 11.1.1-pre.9708 → 11.1.1-pre.9712

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.
@@ -5,4 +5,4 @@
5
5
  │ 1407.js (308.763 KiB)
6
6
  
7
7
 
8
- Rspack compiled with 1 warning in 33.80 s
8
+ Rspack compiled with 1 warning in 22.21 s
package/dist/1442.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["1442"],{9876(e,a,t){t.r(a),t.d(a,{default:()=>s,immutable:()=>p});var l=t(4675),n=t(2372);let p=e=>(a,t,l)=>(l.revalidateOnFocus=!1,l.revalidateIfStale=!1,l.revalidateOnReconnect=!1,l.refreshInterval=0,e(a,t,l)),s=(0,n.withMiddleware)(l.u,p)}}]);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1442.js","sources":["webpack://@openmrs/esm-appointments-app/../../node_modules/swr/dist/immutable/index.mjs"],"names":[],"mappings":"+NAGA,IAAM,EAAY,AAAC,GAAa,CAAC,EAAK,EAAS,KAEvC,EAAO,iBAAiB,CAAG,GAC3B,EAAO,iBAAiB,CAAG,GAC3B,EAAO,qBAAqB,CAAG,GAC/B,EAAO,eAAe,CAAG,EAClB,EAAW,EAAK,EAAS,IAElC,EAAkB,qBAAe,GAAM,CAAE,E"}
package/dist/1465.js CHANGED
@@ -1 +1 @@
1
- (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["1465"],{5602(t){t.exports=function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}},9648(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>c});var a=n(7125),s=n.n(a),i=n(5921),r=n(411),o=n(2895),l=n(2845),p=n(5370);let c=({patientUuid:t,appointmentUuid:e,closeModal:n})=>{let{t:c}=(0,i.useTranslation)(),{activeVisit:d,mutate:m}=(0,o.useVisit)(t),{mutateAppointments:u}=(0,p.q)(),h=(0,a.useCallback)(()=>{(0,l.yI)("Completed",e).then(()=>{if(u(),d){let t=new AbortController,e={stopDatetime:new Date};return(0,o.updateVisit)(d.uuid,e,t).then(()=>{(0,o.showSnackbar)({title:c("appointmentEnded","Appointment ended"),subtitle:c("appointmentEndedAndVisitClosedSuccessfully","Appointment successfully ended and visit successfully closed"),isLowContrast:!0,kind:"success"}),m()}).catch(t=>{(0,o.showSnackbar)({title:c("appointmentEndedButVisitNotClosedError","Appointment ended successfully, but there was an error closing the visit."),subtitle:t?.message,kind:"error",isLowContrast:!0})})}(0,o.showSnackbar)({title:c("appointmentEnded","Appointment ended"),subtitle:c("appointmentEndedSuccessfully","Appointment successfully ended."),isLowContrast:!0,kind:"success"})}).catch(t=>{(0,o.showSnackbar)({title:c("appointmentEndError","Error ending appointment"),subtitle:t?.message,kind:"error",isLowContrast:!0})}).finally(()=>{n()})},[d,e,n,m,u,c]);return s().createElement(s().Fragment,null,s().createElement(r.rQ0,{closeModal:n,title:c("endAppointmentConfirmation","Are you sure you want to check the patient out for this appointment?")}),s().createElement(r.cwr,null,s().createElement("p",null,d?c("endAppointmentAndVisitConfirmationMessage","Checking the patient out will mark the appointment as complete and close out the active visit for this patient."):c("endAppointmentConfirmationMessage","Checking the patient out will mark the appointment as complete."))),s().createElement(r.jlY,null,s().createElement(r.$nd,{kind:"secondary",onClick:n},c("cancel","Cancel")),s().createElement(r.$nd,{kind:"danger",onClick:h},c("checkOut","Check out"))))}},5370(t,e,n){"use strict";n.d(e,{q:()=>o});var a=n(7125),s=n(7364),i=n(2895);let r=`${i.restBaseUrl}/appointment`;function o(){let{mutate:t}=(0,s.useSWRConfig)();return{mutateAppointments:(0,a.useCallback)(()=>t(t=>"string"==typeof t&&t.startsWith(r)||Array.isArray(t)&&t[0].startsWith(r)),[t])}}},2845(t,e,n){"use strict";n.d(e,{DM:()=>d,oo:()=>u,yI:()=>m});var a=n(3464),s=n.n(a),i=n(7364),r=n.n(i),o=n(2895),l=n(5602),p=n.n(l);s().extend(p());let c=`${o.restBaseUrl}/appointments/search`;function d(t,e,n){let{data:a,error:i,isLoading:l,isValidating:p,mutate:d}=r()(t?[c,t,e]:null,()=>(0,o.openmrsFetch)(c,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:t,startDate:e}})),m=a?.data?.length?a.data:null,u=m?.sort((t,e)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:t})=>"Cancelled"!==t)?.filter(({startDateTime:t})=>s()(new Date(t).toISOString()).isBefore(new Date().setHours(0,0,0,0))),h=m?.sort((t,e)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:t})=>"Cancelled"!==t)?.filter(({startDateTime:t})=>s()(new Date(t).toISOString()).isAfter(s()().endOf("day"))),f=m?.sort((t,e)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:t})=>"Cancelled"!==t)?.filter(({startDateTime:t})=>s()(new Date(t).toISOString()).isToday());return{data:a?{pastAppointments:u,upcomingAppointments:h,todaysAppointments:f}:null,error:i,isLoading:l,isValidating:p,mutate:d}}let m=async(t,e)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=s()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),i=`${o.restBaseUrl}/appointments/${e}/status-change`;return await (0,o.openmrsFetch)(i,{body:{toStatus:t,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},u=async t=>{let e=`${o.restBaseUrl}/appointment?uuid=${t}`,{data:n}=await (0,o.openmrsFetch)(e);return n?.status}}}]);
1
+ (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["1465"],{5602(t){t.exports=function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}},9648(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>c});var a=n(7125),s=n.n(a),i=n(5921),r=n(411),o=n(2895),l=n(2845),p=n(5370);let c=({patientUuid:t,appointmentUuid:e,closeModal:n})=>{let{t:c}=(0,i.useTranslation)(),{activeVisit:d,mutate:m}=(0,o.useVisit)(t),{mutateAppointments:u}=(0,p.q)(),h=(0,a.useCallback)(()=>{(0,l.yI)("Completed",e).then(()=>{if(u(),d){let t=new AbortController,e={stopDatetime:new Date};return(0,o.updateVisit)(d.uuid,e,t).then(()=>{(0,o.showSnackbar)({title:c("appointmentEnded","Appointment ended"),subtitle:c("appointmentEndedAndVisitClosedSuccessfully","Appointment successfully ended and visit successfully closed"),isLowContrast:!0,kind:"success"}),m()}).catch(t=>{(0,o.showSnackbar)({title:c("appointmentEndedButVisitNotClosedError","Appointment ended successfully, but there was an error closing the visit."),subtitle:t?.message,kind:"error",isLowContrast:!0})})}(0,o.showSnackbar)({title:c("appointmentEnded","Appointment ended"),subtitle:c("appointmentEndedSuccessfully","Appointment successfully ended."),isLowContrast:!0,kind:"success"})}).catch(t=>{(0,o.showSnackbar)({title:c("appointmentEndError","Error ending appointment"),subtitle:t?.message,kind:"error",isLowContrast:!0})}).finally(()=>{n()})},[d,e,n,m,u,c]);return s().createElement(s().Fragment,null,s().createElement(r.rQ0,{closeModal:n,title:c("endAppointmentConfirmation","Are you sure you want to check the patient out for this appointment?")}),s().createElement(r.cwr,null,s().createElement("p",null,d?c("endAppointmentAndVisitConfirmationMessage","Checking the patient out will mark the appointment as complete and close out the active visit for this patient."):c("endAppointmentConfirmationMessage","Checking the patient out will mark the appointment as complete."))),s().createElement(r.jlY,null,s().createElement(r.$nd,{kind:"secondary",onClick:n},c("cancel","Cancel")),s().createElement(r.$nd,{kind:"danger",onClick:h},c("checkOut","Check out"))))}},5370(t,e,n){"use strict";n.d(e,{q:()=>o});var a=n(7125),s=n(8909),i=n(2895);let r=`${i.restBaseUrl}/appointment`;function o(){let{mutate:t}=(0,s.useSWRConfig)();return{mutateAppointments:(0,a.useCallback)(()=>t(t=>"string"==typeof t&&t.startsWith(r)||Array.isArray(t)&&t[0].startsWith(r)),[t])}}},2845(t,e,n){"use strict";n.d(e,{DM:()=>d,oo:()=>u,yI:()=>m});var a=n(3464),s=n.n(a),i=n(8909),r=n.n(i),o=n(2895),l=n(5602),p=n.n(l);s().extend(p());let c=`${o.restBaseUrl}/appointments/search`;function d(t,e,n){let{data:a,error:i,isLoading:l,isValidating:p,mutate:d}=r()(t?[c,t,e]:null,()=>(0,o.openmrsFetch)(c,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:t,startDate:e}})),m=a?.data?.length?a.data:null,u=m?.sort((t,e)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:t})=>"Cancelled"!==t)?.filter(({startDateTime:t})=>s()(new Date(t).toISOString()).isBefore(new Date().setHours(0,0,0,0))),h=m?.sort((t,e)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:t})=>"Cancelled"!==t)?.filter(({startDateTime:t})=>s()(new Date(t).toISOString()).isAfter(s()().endOf("day"))),f=m?.sort((t,e)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:t})=>"Cancelled"!==t)?.filter(({startDateTime:t})=>s()(new Date(t).toISOString()).isToday());return{data:a?{pastAppointments:u,upcomingAppointments:h,todaysAppointments:f}:null,error:i,isLoading:l,isValidating:p,mutate:d}}let m=async(t,e)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=s()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),i=`${o.restBaseUrl}/appointments/${e}/status-change`;return await (0,o.openmrsFetch)(i,{body:{toStatus:t,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},u=async t=>{let e=`${o.restBaseUrl}/appointment?uuid=${t}`,{data:n}=await (0,o.openmrsFetch)(e);return n?.status}}}]);
package/dist/2152.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["2152"],{2470(e,t,a){a.r(t),a.d(t,{default:()=>d,infinite:()=>_,unstable_serialize:()=>c});var r=a(7125),l=a(4675),i=a(4079),n=a(2372),u=a(8139);let s=e=>(0,i.s)(e?e(0,null):null)[0],c=e=>"$inf$"+s(e),o=Promise.resolve(),_=e=>(t,a,l)=>{let n,c=(0,r.useRef)(!1),{cache:_,initialSize:d=1,revalidateAll:f=!1,persistSize:p=!1,revalidateFirstPage:b=!0,revalidateOnMount:m=!1,parallel:g=!1}=l,[,,,h]=i.a.get(i.o);try{(n=s(t))&&(n="$inf$"+n)}catch(e){}let[k,w,y]=(0,i.c)(_,n),v=(0,r.useCallback)(()=>(0,i.i)(k()._l)?d:k()._l,[_,n,d]);(0,u.useSyncExternalStore)((0,r.useCallback)(e=>n?y(n,()=>{e()}):()=>{},[_,n]),v,v);let C=(0,r.useCallback)(()=>{let e=k()._l;return(0,i.i)(e)?d:e},[n,d]),$=(0,r.useRef)(C());(0,i.u)(()=>{if(!c.current){c.current=!0;return}n&&w({_l:p?$.current:C()})},[n,_]);let U=m&&!c.current,z=e(n,async e=>{let r=k()._i,n=k()._r,u=i.a.get(_),s=u[8],c=()=>u[8]!==s;w({_r:i.U});let o=[],d=C(),[p]=(0,i.c)(_,e),m=p().data,y=[],v=null;for(let e=0;e<d;++e){let[u,s]=(0,i.s)(t(e,g?null:v));if(!u)break;let[d,p]=(0,i.c)(_,u),k=d().data,w=f||r||(0,i.i)(k)||b&&!e&&!(0,i.i)(m)||U||m&&!(0,i.i)(m[e])&&!l.compare(m[e],k);if(a&&("function"==typeof n?n(k,s):w)){let t=async()=>{if(u in h){let e=h[u];delete h[u],k=await e}else k=await a(s);c()||p({data:k,_k:s}),o[e]=k};g?y.push(t):await t()}else o[e]=k;g||(v=k)}return g&&await Promise.all(y.map(e=>e())),c()||w({_i:i.U}),o},l),L=(0,r.useCallback)(function(e,t){let a="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==a.revalidate;return n?(r&&((0,i.i)(e)?w({_i:!0,_r:a.revalidate}):w({_i:!1,_r:a.revalidate})),arguments.length?z.mutate(e,{...a,revalidate:r}):z.mutate()):o},[n,_]),P=(0,r.useCallback)(e=>{let a;if(!n)return o;let[,r]=(0,i.c)(_,n);if((0,i.e)(e)?a=e(C()):"number"==typeof e&&(a=e),"number"!=typeof a)return o;r({_l:a}),$.current=a;let l=[],[u]=(0,i.c)(_,n),s=null;for(let e=0;e<a;++e){let[a]=(0,i.s)(t(e,s)),[r]=(0,i.c)(_,a),n=a?r().data:i.U;if((0,i.i)(n))return L(u().data);l.push(n),s=n}return L(l)},[n,_,L,C]);return{size:C(),setSize:P,mutate:L,get data(){return z.data},get error(){return z.error},get isValidating(){return z.isValidating},get isLoading(){return z.isLoading}}},d=(0,n.withMiddleware)(l.u,_)}}]);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2152.js","sources":["webpack://@openmrs/esm-appointments-app/../../node_modules/swr/dist/infinite/index.mjs"],"names":["Promise","p","e","i","u","arguments"],"mappings":"qRAOA,IAAM,EAAkB,AAAC,GACd,QAAU,EAAS,EAAO,EAAG,MAAQ,KAAK,CAAC,EAAE,CAElD,EAAqB,AAAC,GACjB,QAAkB,EAAgB,GAKvC,EAAgBA,QAAQ,OAAO,GAC/B,EAAW,AAAC,GAAa,CAAC,EAAQ,EAAI,KACpC,IAKI,EALE,EAAc,aAAO,IACrB,CAAE,MAAO,CAAO,CAAE,cAAc,CAAC,CAAE,gBAAgB,EAAK,CAAEC,YAAAA,EAAc,EAAK,CAAE,sBAAsB,EAAI,CAAE,oBAAoB,EAAK,CAAE,WAAW,EAAK,CAAE,CAAG,EAC3J,IAAO,EAAQ,CAAG,OAAkB,CAAC,GAAK,EAIhD,GAAI,CAEI,AADJ,GAAc,EAAgB,EAAM,GACnB,GAAc,QAAkB,CAAU,CAC/D,CAAE,MAAOC,EAAK,CAEd,CACA,GAAM,CAAC,EAAK,EAAK,EAAe,CAAG,QAAkB,EAAS,GAC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I,CAAC,EAAa,OAAO,EACzB,GAAM,EAAG,EAAW,CAAG,QAAkB,EAAS,GAOlD,GALI,GAAAF,EAAA,GAAW,GACX,EAAO,EAAI,KACJ,AAAc,UAAd,OAAO,GACd,GAAO,CAAE,EAET,AAAe,UAAf,OAAO,EAAkB,OAAO,EACpC,EAAW,CACP,GAAI,CACR,GACA,EAAgB,OAAO,CAAG,EAE1B,IAAM,EAAO,EAAE,CACT,CAAC,EAAiB,CAAG,QAAkB,EAAS,GAClD,EAAmB,KACvB,IAAI,IAAI,EAAI,EAAG,EAAI,EAAM,EAAE,EAAE,CACzB,GAAM,CAAC,EAAQ,CAAG,QAAU,EAAO,EAAG,IAChC,CAAC,EAAS,CAAG,QAAkB,EAAS,GAExC,EAAW,EAAU,IAAW,IAAI,CAAG,GAAS,CAEtD,GAAI,GAAAA,EAAA,GAAY,GACZ,OAAO,EAAO,IAAmB,IAAI,EAEzC,EAAK,IAAI,CAAC,GACV,EAAmB,CACvB,CACA,OAAO,EAAO,EAClB,EAEA,CACI,EACA,EACA,EACA,EACH,EAGD,MAAO,CACH,KAAM,IACN,UACA,SACA,IAAI,MAAQ,CACR,OAAO,EAAI,IAAI,AACnB,EACA,IAAI,OAAS,CACT,OAAO,EAAI,KAAK,AACpB,EACA,IAAI,cAAgB,CAChB,OAAO,EAAI,YAAY,AAC3B,EACA,IAAI,WAAa,CACb,OAAO,EAAI,SAAS,AACxB,CACJ,CACJ,EACE,EAAiB,qBAAe,GAAM,CAAE,E"}
package/dist/2620.js CHANGED
@@ -1 +1 @@
1
- (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["2620"],{5602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},7657(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(a,s,i){var r=s.prototype;i.utc=function(e){var t={date:e,utc:!0,args:arguments};return new s(t)},r.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},r.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var o=r.parse;r.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var l=r.init;r.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var m=r.utcOffset;r.utcOffset=function(a,s){var i=this.$utils().u;if(i(a))return this.$u?0:i(this.$offset)?m.call(this):this.$offset;if("string"==typeof a&&null===(a=function(e){void 0===e&&(e="");var a=e.match(t);if(!a)return null;var s=(""+a[0]).match(n)||["-",0,0],i=s[0],r=60*s[1]+ +s[2];return 0===r?0:"+"===i?r:-r}(a)))return this;var r=16>=Math.abs(a)?60*a:a,o=this;if(s)return o.$offset=r,o.$u=0===a,o;if(0!==a){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(r+l,e)).$offset=r,o.$x.$localOffset=l}else o=this.utc();return o};var p=r.format;r.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,t)},r.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var c=r.toDate;r.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=r.diff;r.diff=function(e,t,n){if(e&&this.$u===e.$u)return u.call(this,e,t,n);var a=this.local(),s=i(e).local();return u.call(a,s,t,n)}}}()},7(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>T});var a=n(7125),s=n.n(a),i=n(3464),r=n.n(i),o=n(5921),l=n(411),m=n(2895),p=n(2845),c=n(3373),u=n.n(c),d=n(7657),h=n.n(d);let f="-esm-appointments__patient-appointments-action-menu__menuItem___rJ8Ol",_=({appointment:e,patientUuid:t,launchAppointmentForm:n})=>{let{t:a}=(0,o.useTranslation)(),i="tablet"===(0,m.useLayoutType)();return s().createElement(l.Wdr,{className:"-esm-appointments__patient-appointments-action-menu__layer___QvdWM"},s().createElement(l.obU,{"aria-label":"Edit or delete appointment",size:i?"lg":"sm",flipped:!0,align:"left"},s().createElement(l.XSD,{className:f,id:"editAppointment",itemText:a("edit","Edit"),onClick:()=>{n?n(t,e):(0,m.launchWorkspace2)("appointments-form-workspace",{appointment:e,patientUuid:t})}}),s().createElement(l.XSD,{className:f,hasDivider:!0,id:"cancelAppointment",isDelete:!0,itemText:a("cancel","Cancel"),onClick:()=>{let n=(0,m.showModal)("cancel-appointment-modal",{closeCancelModal:()=>n(),appointmentUuid:e.uuid,patientUuid:t})}})))},g={layer:"-esm-appointments__patient-appointments-table__layer___3XHUe",menuItem:"-esm-appointments__patient-appointments-table__menuItem___lt5oF",text02:"-esm-appointments__patient-appointments-table__text02___YEBCA",table:"-esm-appointments__patient-appointments-table__table___6grQU"};r().extend(h());let y=({patientAppointments:e,patientUuid:t,switchedView:n,setSwitchedView:i,launchAppointmentForm:r})=>{let{t:p}=(0,o.useTranslation)(),{results:c,currentPage:d,goTo:h}=(0,m.usePagination)(e,10),f="tablet"===(0,m.useLayoutType)();(0,a.useEffect)(()=>{n&&1!==d&&h(1)},[n,h,d]);let y=(0,a.useMemo)(()=>[{key:"date",header:p("date","Date")},{key:"location",header:p("location","Location")},{key:"service",header:p("service","Service")},{key:"status",header:p("status","Status")},{key:"type",header:p("type","Type")},{key:"notes",header:p("notes","Notes")}],[p]),E=(0,a.useMemo)(()=>c?.map(e=>({id:e.uuid,date:e.startDateTime?(0,m.formatDatetime)(new Date(e.startDateTime),{mode:"wide"}):"——",location:e?.location?.name?e?.location?.name:"——",service:e.service.name,status:e.status,type:e.appointmentKind?e.appointmentKind:"——",notes:e.comments?e.comments:"——"})),[c]);return s().createElement("div",null,s().createElement(l.bQt,{rows:E,headers:y,isSortable:!0,size:f?"lg":"sm",useZebraStyles:!0},({rows:e,headers:n,getHeaderProps:a,getTableProps:i})=>s().createElement(l.K3K,null,s().createElement(l.XIK,{className:g.table,...i()},s().createElement(l.ndF,null,s().createElement(l.Hjg,null,n.map(e=>s().createElement(l.A0N,{className:u()(g.productiveHeading01,g.text02),...a({header:e})},e.header)),s().createElement(l.A0N,null))),s().createElement(l.BFY,null,e.map((e,n)=>s().createElement(l.Hjg,{key:e.id},e.cells.map(e=>s().createElement(l.nA6,{key:e.id},e.value?.content??e.value)),s().createElement(l.nA6,{className:"cds--table-column-menu"},s().createElement(_,{appointment:c[n],patientUuid:t,launchAppointmentForm:r})))))))),s().createElement(m.Pagination,{currentItems:c.length,totalItems:e.length,onPageNumberChange:({page:e})=>{i(!1),h(e)},pageNumber:d,pageSize:10}))},E="-esm-appointments__patient-appointments-detailed-summary__content___UXb5t",D="-esm-appointments__patient-appointments-detailed-summary__tile___1k6FD",T=({patientUuid:e,launchAppointmentForm:t})=>{let{t:n}=(0,o.useTranslation)(),i=n("appointments","Appointments"),c="tablet"===(0,m.useLayoutType)(),[u,d]=(0,a.useState)(!1),h=t||((e,t)=>{(0,m.launchWorkspace2)("appointments-form-workspace",{patientUuid:e,appointment:t})}),[f,_]=(0,a.useState)(0),g=(0,a.useMemo)(()=>r()().subtract(6,"month").toISOString(),[]),{data:T,error:$,isLoading:v,isValidating:S}=(0,p.DM)(e,g,(0,a.useMemo)(()=>new AbortController,[]));return v?s().createElement(l.OOb,{role:"progressbar",compact:!c,zebra:!0}):$?s().createElement(m.ErrorCard,{headerTitle:i,error:$}):T&&Object.keys(T)?.length?s().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__widgetCard___NRC+0"},s().createElement(m.CardHeader,{title:i},S?s().createElement("span",null,s().createElement(l.OuH,null)):null,s().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__contentSwitcherWrapper___kUL1Q"},s().createElement(l.Tps,{size:c?"md":"sm",selectedIndex:f,onChange:({index:e})=>{_(e),d(!0)}},s().createElement(l.dOG,{name:"upcoming"},n("upcoming","Upcoming")),s().createElement(l.dOG,{name:"today"},n("today","Today")),s().createElement(l.dOG,{name:"past"},n("past","Past"))),s().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__divider___t1P0L"},"|"),s().createElement(l.$nd,{kind:"ghost",renderIcon:e=>s().createElement(m.AddIcon,{size:16,...e}),iconDescription:n("addAppointments","Add Appointments"),onClick:()=>h(e)},n("add","Add")))),0===f?T.upcomingAppointments?.length?s().createElement(y,{patientAppointments:T?.upcomingAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:h}):s().createElement(l.Wdr,null,s().createElement(l.FAs,{className:D},s().createElement(m.EmptyCardIllustration,null),s().createElement("p",{className:E},n("noUpcomingAppointmentsForPatient","There are no upcoming appointments to display for this patient")))):1===f?T.todaysAppointments?.length?s().createElement(y,{patientAppointments:T?.todaysAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:h}):s().createElement(l.Wdr,null,s().createElement(l.FAs,{className:D},s().createElement(m.EmptyCardIllustration,null),s().createElement("p",{className:E},n("noCurrentAppointments","There are no appointments scheduled for today to display for this patient")))):2===f?T.pastAppointments?.length?s().createElement(y,{patientAppointments:T?.pastAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:h}):s().createElement(l.Wdr,null,s().createElement(l.FAs,{className:D},s().createElement(m.EmptyCardIllustration,null),s().createElement("p",{className:E},n("noPastAppointments","There are no past appointments to display for this patient")))):void 0):void 0}},2845(e,t,n){"use strict";n.d(t,{DM:()=>c,oo:()=>d,yI:()=>u});var a=n(3464),s=n.n(a),i=n(7364),r=n.n(i),o=n(2895),l=n(5602),m=n.n(l);s().extend(m());let p=`${o.restBaseUrl}/appointments/search`;function c(e,t,n){let{data:a,error:i,isLoading:l,isValidating:m,mutate:c}=r()(e?[p,e,t]:null,()=>(0,o.openmrsFetch)(p,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),u=a?.data?.length?a.data:null,d=u?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),h=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isAfter(s()().endOf("day"))),f=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isToday());return{data:a?{pastAppointments:d,upcomingAppointments:h,todaysAppointments:f}:null,error:i,isLoading:l,isValidating:m,mutate:c}}let u=async(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=s()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),i=`${o.restBaseUrl}/appointments/${t}/status-change`;return await (0,o.openmrsFetch)(i,{body:{toStatus:e,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},d=async e=>{let t=`${o.restBaseUrl}/appointment?uuid=${e}`,{data:n}=await (0,o.openmrsFetch)(t);return n?.status}}}]);
1
+ (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["2620"],{5602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},7657(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(a,s,i){var r=s.prototype;i.utc=function(e){var t={date:e,utc:!0,args:arguments};return new s(t)},r.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},r.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var o=r.parse;r.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var l=r.init;r.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var m=r.utcOffset;r.utcOffset=function(a,s){var i=this.$utils().u;if(i(a))return this.$u?0:i(this.$offset)?m.call(this):this.$offset;if("string"==typeof a&&null===(a=function(e){void 0===e&&(e="");var a=e.match(t);if(!a)return null;var s=(""+a[0]).match(n)||["-",0,0],i=s[0],r=60*s[1]+ +s[2];return 0===r?0:"+"===i?r:-r}(a)))return this;var r=16>=Math.abs(a)?60*a:a,o=this;if(s)return o.$offset=r,o.$u=0===a,o;if(0!==a){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(r+l,e)).$offset=r,o.$x.$localOffset=l}else o=this.utc();return o};var p=r.format;r.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,t)},r.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var c=r.toDate;r.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=r.diff;r.diff=function(e,t,n){if(e&&this.$u===e.$u)return u.call(this,e,t,n);var a=this.local(),s=i(e).local();return u.call(a,s,t,n)}}}()},7(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>T});var a=n(7125),s=n.n(a),i=n(3464),r=n.n(i),o=n(5921),l=n(411),m=n(2895),p=n(2845),c=n(3373),u=n.n(c),d=n(7657),h=n.n(d);let f="-esm-appointments__patient-appointments-action-menu__menuItem___rJ8Ol",_=({appointment:e,patientUuid:t,launchAppointmentForm:n})=>{let{t:a}=(0,o.useTranslation)(),i="tablet"===(0,m.useLayoutType)();return s().createElement(l.Wdr,{className:"-esm-appointments__patient-appointments-action-menu__layer___QvdWM"},s().createElement(l.obU,{"aria-label":"Edit or delete appointment",size:i?"lg":"sm",flipped:!0,align:"left"},s().createElement(l.XSD,{className:f,id:"editAppointment",itemText:a("edit","Edit"),onClick:()=>{n?n(t,e):(0,m.launchWorkspace2)("appointments-form-workspace",{appointment:e,patientUuid:t})}}),s().createElement(l.XSD,{className:f,hasDivider:!0,id:"cancelAppointment",isDelete:!0,itemText:a("cancel","Cancel"),onClick:()=>{let n=(0,m.showModal)("cancel-appointment-modal",{closeCancelModal:()=>n(),appointmentUuid:e.uuid,patientUuid:t})}})))},g={layer:"-esm-appointments__patient-appointments-table__layer___3XHUe",menuItem:"-esm-appointments__patient-appointments-table__menuItem___lt5oF",text02:"-esm-appointments__patient-appointments-table__text02___YEBCA",table:"-esm-appointments__patient-appointments-table__table___6grQU"};r().extend(h());let y=({patientAppointments:e,patientUuid:t,switchedView:n,setSwitchedView:i,launchAppointmentForm:r})=>{let{t:p}=(0,o.useTranslation)(),{results:c,currentPage:d,goTo:h}=(0,m.usePagination)(e,10),f="tablet"===(0,m.useLayoutType)();(0,a.useEffect)(()=>{n&&1!==d&&h(1)},[n,h,d]);let y=(0,a.useMemo)(()=>[{key:"date",header:p("date","Date")},{key:"location",header:p("location","Location")},{key:"service",header:p("service","Service")},{key:"status",header:p("status","Status")},{key:"type",header:p("type","Type")},{key:"notes",header:p("notes","Notes")}],[p]),E=(0,a.useMemo)(()=>c?.map(e=>({id:e.uuid,date:e.startDateTime?(0,m.formatDatetime)(new Date(e.startDateTime),{mode:"wide"}):"——",location:e?.location?.name?e?.location?.name:"——",service:e.service.name,status:e.status,type:e.appointmentKind?e.appointmentKind:"——",notes:e.comments?e.comments:"——"})),[c]);return s().createElement("div",null,s().createElement(l.bQt,{rows:E,headers:y,isSortable:!0,size:f?"lg":"sm",useZebraStyles:!0},({rows:e,headers:n,getHeaderProps:a,getTableProps:i})=>s().createElement(l.K3K,null,s().createElement(l.XIK,{className:g.table,...i()},s().createElement(l.ndF,null,s().createElement(l.Hjg,null,n.map(e=>s().createElement(l.A0N,{className:u()(g.productiveHeading01,g.text02),...a({header:e})},e.header)),s().createElement(l.A0N,null))),s().createElement(l.BFY,null,e.map((e,n)=>s().createElement(l.Hjg,{key:e.id},e.cells.map(e=>s().createElement(l.nA6,{key:e.id},e.value?.content??e.value)),s().createElement(l.nA6,{className:"cds--table-column-menu"},s().createElement(_,{appointment:c[n],patientUuid:t,launchAppointmentForm:r})))))))),s().createElement(m.Pagination,{currentItems:c.length,totalItems:e.length,onPageNumberChange:({page:e})=>{i(!1),h(e)},pageNumber:d,pageSize:10}))},E="-esm-appointments__patient-appointments-detailed-summary__content___UXb5t",D="-esm-appointments__patient-appointments-detailed-summary__tile___1k6FD",T=({patientUuid:e,launchAppointmentForm:t})=>{let{t:n}=(0,o.useTranslation)(),i=n("appointments","Appointments"),c="tablet"===(0,m.useLayoutType)(),[u,d]=(0,a.useState)(!1),h=t||((e,t)=>{(0,m.launchWorkspace2)("appointments-form-workspace",{patientUuid:e,appointment:t})}),[f,_]=(0,a.useState)(0),g=(0,a.useMemo)(()=>r()().subtract(6,"month").toISOString(),[]),{data:T,error:$,isLoading:v,isValidating:S}=(0,p.DM)(e,g,(0,a.useMemo)(()=>new AbortController,[]));return v?s().createElement(l.OOb,{role:"progressbar",compact:!c,zebra:!0}):$?s().createElement(m.ErrorCard,{headerTitle:i,error:$}):T&&Object.keys(T)?.length?s().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__widgetCard___NRC+0"},s().createElement(m.CardHeader,{title:i},S?s().createElement("span",null,s().createElement(l.OuH,null)):null,s().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__contentSwitcherWrapper___kUL1Q"},s().createElement(l.Tps,{size:c?"md":"sm",selectedIndex:f,onChange:({index:e})=>{_(e),d(!0)}},s().createElement(l.dOG,{name:"upcoming"},n("upcoming","Upcoming")),s().createElement(l.dOG,{name:"today"},n("today","Today")),s().createElement(l.dOG,{name:"past"},n("past","Past"))),s().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__divider___t1P0L"},"|"),s().createElement(l.$nd,{kind:"ghost",renderIcon:e=>s().createElement(m.AddIcon,{size:16,...e}),iconDescription:n("addAppointments","Add Appointments"),onClick:()=>h(e)},n("add","Add")))),0===f?T.upcomingAppointments?.length?s().createElement(y,{patientAppointments:T?.upcomingAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:h}):s().createElement(l.Wdr,null,s().createElement(l.FAs,{className:D},s().createElement(m.EmptyCardIllustration,null),s().createElement("p",{className:E},n("noUpcomingAppointmentsForPatient","There are no upcoming appointments to display for this patient")))):1===f?T.todaysAppointments?.length?s().createElement(y,{patientAppointments:T?.todaysAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:h}):s().createElement(l.Wdr,null,s().createElement(l.FAs,{className:D},s().createElement(m.EmptyCardIllustration,null),s().createElement("p",{className:E},n("noCurrentAppointments","There are no appointments scheduled for today to display for this patient")))):2===f?T.pastAppointments?.length?s().createElement(y,{patientAppointments:T?.pastAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:h}):s().createElement(l.Wdr,null,s().createElement(l.FAs,{className:D},s().createElement(m.EmptyCardIllustration,null),s().createElement("p",{className:E},n("noPastAppointments","There are no past appointments to display for this patient")))):void 0):void 0}},2845(e,t,n){"use strict";n.d(t,{DM:()=>c,oo:()=>d,yI:()=>u});var a=n(3464),s=n.n(a),i=n(8909),r=n.n(i),o=n(2895),l=n(5602),m=n.n(l);s().extend(m());let p=`${o.restBaseUrl}/appointments/search`;function c(e,t,n){let{data:a,error:i,isLoading:l,isValidating:m,mutate:c}=r()(e?[p,e,t]:null,()=>(0,o.openmrsFetch)(p,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),u=a?.data?.length?a.data:null,d=u?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),h=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isAfter(s()().endOf("day"))),f=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isToday());return{data:a?{pastAppointments:d,upcomingAppointments:h,todaysAppointments:f}:null,error:i,isLoading:l,isValidating:m,mutate:c}}let u=async(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=s()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),i=`${o.restBaseUrl}/appointments/${t}/status-change`;return await (0,o.openmrsFetch)(i,{body:{toStatus:e,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},d=async e=>{let t=`${o.restBaseUrl}/appointment?uuid=${e}`,{data:n}=await (0,o.openmrsFetch)(t);return n?.status}}}]);
package/dist/3220.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["3220"],{9116(e,t,n){n.r(t),n.d(t,{default:()=>U});var a=n(7125),l=n.n(a),r=n(5921),i=n(2745),m=n(411),s=n(2895),p=n(3464),o=n.n(p),d=n(515),c=n.n(d),u=n(3639),_=n(5845),h=n(2452),E=n(1947);let g={switcher:"-esm-appointments__scheduled-appointments__switcher___9YU-U"};o().extend(c());let b=()=>{let{t:e}=(0,r.useTranslation)(),{appointmentServiceTypes:t}=(0,u.nS)(),n=(0,E.h)(),{appointmentList:a,isLoading:i,error:m}=(0,_.H)(n),p=t.length>0?a.filter(({service:e})=>t.includes(e.uuid)):a;(0,s.useDefineAppContext)("appointments",{appointmentForSelectedDateFilteredByServiceTypes:p,isLoading:i,error:m});let o=(0,s.formatDate)((0,s.parseDate)(n),{mode:"standard",time:!1});return l().createElement("div",{className:g.container},l().createElement(h.A,{appointments:p,isLoading:i,tableHeading:e("appointmentsForDate","Appointments for: {{date}}",{date:o})}))};var f=n(8622),y=n(7364),v=n.n(y),T=n(7488),k=n(8755),C=n(9224);let N=()=>{let{t:e}=(0,r.useTranslation)(),[t,n]=(0,a.useState)(25),[i,p]=(0,a.useState)(""),{data:o,isLoading:d,error:c}=function(){let e=(0,E.h)(),t=`${s.restBaseUrl}/appointment/unScheduledAppointment?forDate=${e}`,{data:n,error:a,isLoading:l}=v()(t,s.openmrsFetch,{errorRetryCount:2});return{isLoading:l,data:n?.data?.map(e=>{var t;return{name:(t=e).name,identifier:t?.identifiers?.find(e=>e.identifierName===T.Q.patientIdentifierType._default).identifier,dateTime:t?.visit.startDateTime,gender:t.gender,phoneNumber:t.phoneNumber,age:t.age,uuid:t.uuid}})??[],error:a}}(),u=(0,C.WB)(o,i),{customPatientChartUrl:_}=(0,s.useConfig)(),{results:h,currentPage:g,goTo:b}=(0,s.usePagination)(u,t),y=h?.map(e=>({id:`${e.uuid}`,name:l().createElement(s.ConfigurableLink,{style:{textDecoration:"none"},to:_,templateParams:{patientUuid:e.uuid}},e.name),gender:"F"===e.gender?"Female":"Male",phoneNumber:""===e.phoneNumber?"--":e.phoneNumber,identifier:e?.identifier}));return d?l().createElement(m.OOb,null):o?.length?l().createElement("div",null,l().createElement(m.bQt,{rows:y,headers:[{header:"Patient Name",key:"name"},{header:"Identifier",key:"identifier"},{header:"Gender",key:"gender"},{header:"Phone Number",key:"phoneNumber"}],isSortable:!0},({rows:t,headers:n,getHeaderProps:a,getTableProps:r})=>l().createElement(m.K3K,{title:`${e("unscheduledAppointments","Unscheduled appointments")} ${o.length}`,description:`${e(`Total ${o.length??0}`)}`},l().createElement(m.e1U,null,l().createElement(m.VbH,null,l().createElement(m.w6V,{style:{backgroundColor:"#f4f4f4"},tabIndex:0,onChange:(e,t)=>p(t??"")}),l().createElement(m.$nd,{size:"lg",kind:"tertiary",renderIcon:f.f5,onClick:()=>(0,k.K)(o)},e("download","Download")))),l().createElement(m.XIK,r(),l().createElement(m.ndF,null,l().createElement(m.Hjg,null,n.map(e=>l().createElement(m.A0N,a({header:e}),e.header)))),l().createElement(m.BFY,null,t.map(e=>l().createElement(m.Hjg,{key:e.id},e.cells.map(e=>l().createElement(m.nA6,{key:e.id},e.value)))))))),l().createElement(m.dKS,{backwardText:"Previous page",forwardText:"Next page",page:g,pageNumberText:"Page Number",pageSize:t,onChange:({page:e,pageSize:t})=>{b(e),n(t)},pageSizes:(0,C.uB)(o,t)??[],totalItems:o.length??0})):l().createElement(s.EmptyCard,{displayText:e("unscheduledAppointments_lower","unscheduled appointments"),headerTitle:e("unscheduledAppointments","Unscheduled appointments")})};var A=n(256);let S=()=>{let{t:e}=(0,r.useTranslation)(),{showUnscheduledAppointmentsTab:t,showEarlyAppointmentsTab:n}=(0,s.useConfig)(),[i,p]=(0,a.useState)(0),o=[{label:e("scheduled","Scheduled"),component:l().createElement(b,null)}];return t&&o.push({label:e("unscheduled","Unscheduled"),component:l().createElement(N,null)}),n&&o.push({label:e("early","Early"),component:l().createElement(A.default,null)}),l().createElement("div",{className:"-esm-appointments__appointment-tabs__appointmentList___AwMSu","data-testid":"appointment-list"},o.length>1?l().createElement("div",{className:"-esm-appointments__appointment-tabs__tabs___UTPKY"},l().createElement(m.tUM,{selectedIndex:i,onChange:({selectedIndex:e})=>{p(e)}},l().createElement(m.wbY,{style:{paddingLeft:"1rem"},"aria-label":"Appointment tabs",contained:!0},o.map(e=>l().createElement(m.ozo,{key:e.label,className:"-esm-appointments__appointment-tabs__tab___QSgcp"},e.label))),l().createElement(m.T2N,null,o.map(e=>l().createElement(m.KpK,{key:e.label,className:"-esm-appointments__appointment-tabs__tabPanel___R+iDl"},e.component))))):l().createElement(b,null))};var w=n(5881),D=n(5602),$=n.n(D),x=n(8466),F=n(3760),P=n(7003),I=n(9391);o().extend($());let M=()=>{let{t:e}=(0,r.useTranslation)(),t=(0,E.h)(),n=(0,s.useLayoutType)(),a=(0,s.isDesktop)(n)?"sm":"md";return l().createElement("div",{className:"-esm-appointments__metrics-header__metricsContainer___uCxcx"},l().createElement("div",{className:"-esm-appointments__metrics-header__metricsContent___PF5DR"},l().createElement(m.$nd,{kind:"tertiary",renderIcon:x.Vv,size:a,onClick:()=>(0,s.navigate)({to:`${P.lw}/appointments/calendar/${o()(t).format("YYYY-MM-DD")}`})},e("appointmentsCalendar","Appointments calendar")),l().createElement(m.$nd,{kind:"primary",renderIcon:e=>l().createElement(F.vg,{size:32,...e}),size:a,onClick:()=>(0,I.Xz)(e)},e("createNewAppointment","Create new appointment"))))},Y=()=>l().createElement(l().Fragment,null,l().createElement(M,null),l().createElement(s.ExtensionSlot,{name:"appointments-metrics-slot",className:"-esm-appointments__metrics-container__cardContainer___b6u5q"})),U=()=>{let{t:e}=(0,r.useTranslation)(),{setAppointmentServiceTypes:t}=(0,u.nS)(),n=(0,i.useParams)();return(0,a.useEffect)(()=>{n.serviceType&&t([n.serviceType])},[n.serviceType,t]),l().createElement(l().Fragment,null,l().createElement(w.A,{title:e("appointments","Appointments"),showServiceTypeFilter:!0}),l().createElement(Y,null),l().createElement(S,null))}},256(e,t,n){n.r(t),n.d(t,{default:()=>d});var a=n(7125),l=n.n(a),r=n(5921),i=n(9224),m=n(5845),s=n(2452),p=n(3639),o=n(1947);let d=()=>{let{t:e}=(0,r.useTranslation)(),{appointmentServiceTypes:t}=(0,p.nS)(),n=(0,o.h)(),{earlyAppointmentList:a,isLoading:d}=(0,m.M)(n),c=(0,i.Bm)(a,t).map((e,t)=>({id:`${t}`,...e}));return l().createElement(s.A,{appointments:c,isLoading:d,tableHeading:e("cameEarly","Came Early")})}},5881(e,t,n){n.d(t,{A:()=>E});var a=n(7125),l=n.n(a),r=n(3464),i=n.n(r),m=n(5921),s=n(2745),p=n(411),o=n(5848),d=n(2895),c=n(6),u=n(1947),_=n(3639),h=n(2373);let E=({title:e,showServiceTypeFilter:t,isCalendarView:n})=>{let{t:r}=(0,m.useTranslation)(),E=(0,s.useNavigate)(),g=(0,s.useLocation)(),{appointmentServiceTypes:b,setAppointmentServiceTypes:f}=(0,_.nS)(),{serviceTypes:y}=(0,c.V)(),v=(0,u.h)(),T=(0,a.useMemo)(()=>i()(v).toDate(),[v]),k=(0,a.useCallback)(({selectedItems:e})=>{f(e.map(e=>e.id))},[f]),C=(0,a.useMemo)(()=>y?.map(e=>({id:e.uuid,label:e.name}))??[],[y]);return l().createElement(d.PageHeader,{className:"-esm-appointments__appointments-header__header___QILcB","data-testid":"appointments-header"},l().createElement(d.PageHeaderContent,{illustration:l().createElement(d.AppointmentsPictogram,null),title:e}),l().createElement("div",{className:"-esm-appointments__appointments-header__rightJustifiedItems___2dLRu"},n?l().createElement(p.$nd,{kind:"primary",renderIcon:o.OM,size:"sm",onClick:()=>(0,h.Xz)(r)},r("newAppointment","New appointment")):l().createElement(l().Fragment,null,l().createElement(d.OpenmrsDatePicker,{"data-testid":"appointment-date-picker",id:"appointment-date-picker","aria-label":r("appointmentDate","Appointment date"),onChange:e=>{if(!e)return;let t=`/${i()(e).format("YYYY-MM-DD")}`;g.pathname.endsWith(t)||E(t)},value:T}),t&&l().createElement(p.KFt,{id:"serviceTypeMultiSelect",items:C,itemToString:e=>e?e.label:"",label:r("filterAppointmentsByServiceType","Filter appointments by service type"),onChange:k,type:"inline",selectedItems:C.filter(e=>b.includes(e.id))}))))}},6(e,t,n){n.d(t,{V:()=>m});var a=n(7125),l=n(2895),r=n(7364),i=n.n(r);function m(){let{data:e,error:t,isLoading:n}=i()(`${l.restBaseUrl}/appointmentService/all/default`,l.openmrsFetch);return{serviceTypes:(0,a.useMemo)(()=>e?.data?[...e.data].sort((e,t)=>e.name.localeCompare(t.name)):[],[e?.data]),isLoading:n,error:t}}}}]);
1
+ "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["3220"],{9116(e,t,n){n.r(t),n.d(t,{default:()=>U});var a=n(7125),l=n.n(a),r=n(5921),i=n(2745),m=n(411),s=n(2895),p=n(3464),o=n.n(p),d=n(515),c=n.n(d),u=n(3639),_=n(5845),h=n(2452),E=n(1947);let g={switcher:"-esm-appointments__scheduled-appointments__switcher___9YU-U"};o().extend(c());let b=()=>{let{t:e}=(0,r.useTranslation)(),{appointmentServiceTypes:t}=(0,u.nS)(),n=(0,E.h)(),{appointmentList:a,isLoading:i,error:m}=(0,_.H)(n),p=t.length>0?a.filter(({service:e})=>t.includes(e.uuid)):a;(0,s.useDefineAppContext)("appointments",{appointmentForSelectedDateFilteredByServiceTypes:p,isLoading:i,error:m});let o=(0,s.formatDate)((0,s.parseDate)(n),{mode:"standard",time:!1});return l().createElement("div",{className:g.container},l().createElement(h.A,{appointments:p,isLoading:i,tableHeading:e("appointmentsForDate","Appointments for: {{date}}",{date:o})}))};var f=n(8622),y=n(8909),v=n.n(y),T=n(7488),k=n(8755),C=n(9224);let N=()=>{let{t:e}=(0,r.useTranslation)(),[t,n]=(0,a.useState)(25),[i,p]=(0,a.useState)(""),{data:o,isLoading:d,error:c}=function(){let e=(0,E.h)(),t=`${s.restBaseUrl}/appointment/unScheduledAppointment?forDate=${e}`,{data:n,error:a,isLoading:l}=v()(t,s.openmrsFetch,{errorRetryCount:2});return{isLoading:l,data:n?.data?.map(e=>{var t;return{name:(t=e).name,identifier:t?.identifiers?.find(e=>e.identifierName===T.Q.patientIdentifierType._default).identifier,dateTime:t?.visit.startDateTime,gender:t.gender,phoneNumber:t.phoneNumber,age:t.age,uuid:t.uuid}})??[],error:a}}(),u=(0,C.WB)(o,i),{customPatientChartUrl:_}=(0,s.useConfig)(),{results:h,currentPage:g,goTo:b}=(0,s.usePagination)(u,t),y=h?.map(e=>({id:`${e.uuid}`,name:l().createElement(s.ConfigurableLink,{style:{textDecoration:"none"},to:_,templateParams:{patientUuid:e.uuid}},e.name),gender:"F"===e.gender?"Female":"Male",phoneNumber:""===e.phoneNumber?"--":e.phoneNumber,identifier:e?.identifier}));return d?l().createElement(m.OOb,null):o?.length?l().createElement("div",null,l().createElement(m.bQt,{rows:y,headers:[{header:"Patient Name",key:"name"},{header:"Identifier",key:"identifier"},{header:"Gender",key:"gender"},{header:"Phone Number",key:"phoneNumber"}],isSortable:!0},({rows:t,headers:n,getHeaderProps:a,getTableProps:r})=>l().createElement(m.K3K,{title:`${e("unscheduledAppointments","Unscheduled appointments")} ${o.length}`,description:`${e(`Total ${o.length??0}`)}`},l().createElement(m.e1U,null,l().createElement(m.VbH,null,l().createElement(m.w6V,{style:{backgroundColor:"#f4f4f4"},tabIndex:0,onChange:(e,t)=>p(t??"")}),l().createElement(m.$nd,{size:"lg",kind:"tertiary",renderIcon:f.f5,onClick:()=>(0,k.K)(o)},e("download","Download")))),l().createElement(m.XIK,r(),l().createElement(m.ndF,null,l().createElement(m.Hjg,null,n.map(e=>l().createElement(m.A0N,a({header:e}),e.header)))),l().createElement(m.BFY,null,t.map(e=>l().createElement(m.Hjg,{key:e.id},e.cells.map(e=>l().createElement(m.nA6,{key:e.id},e.value)))))))),l().createElement(m.dKS,{backwardText:"Previous page",forwardText:"Next page",page:g,pageNumberText:"Page Number",pageSize:t,onChange:({page:e,pageSize:t})=>{b(e),n(t)},pageSizes:(0,C.uB)(o,t)??[],totalItems:o.length??0})):l().createElement(s.EmptyCard,{displayText:e("unscheduledAppointments_lower","unscheduled appointments"),headerTitle:e("unscheduledAppointments","Unscheduled appointments")})};var A=n(256);let S=()=>{let{t:e}=(0,r.useTranslation)(),{showUnscheduledAppointmentsTab:t,showEarlyAppointmentsTab:n}=(0,s.useConfig)(),[i,p]=(0,a.useState)(0),o=[{label:e("scheduled","Scheduled"),component:l().createElement(b,null)}];return t&&o.push({label:e("unscheduled","Unscheduled"),component:l().createElement(N,null)}),n&&o.push({label:e("early","Early"),component:l().createElement(A.default,null)}),l().createElement("div",{className:"-esm-appointments__appointment-tabs__appointmentList___AwMSu","data-testid":"appointment-list"},o.length>1?l().createElement("div",{className:"-esm-appointments__appointment-tabs__tabs___UTPKY"},l().createElement(m.tUM,{selectedIndex:i,onChange:({selectedIndex:e})=>{p(e)}},l().createElement(m.wbY,{style:{paddingLeft:"1rem"},"aria-label":"Appointment tabs",contained:!0},o.map(e=>l().createElement(m.ozo,{key:e.label,className:"-esm-appointments__appointment-tabs__tab___QSgcp"},e.label))),l().createElement(m.T2N,null,o.map(e=>l().createElement(m.KpK,{key:e.label,className:"-esm-appointments__appointment-tabs__tabPanel___R+iDl"},e.component))))):l().createElement(b,null))};var w=n(5881),D=n(5602),$=n.n(D),x=n(8466),F=n(3760),P=n(7003),I=n(9391);o().extend($());let M=()=>{let{t:e}=(0,r.useTranslation)(),t=(0,E.h)(),n=(0,s.useLayoutType)(),a=(0,s.isDesktop)(n)?"sm":"md";return l().createElement("div",{className:"-esm-appointments__metrics-header__metricsContainer___uCxcx"},l().createElement("div",{className:"-esm-appointments__metrics-header__metricsContent___PF5DR"},l().createElement(m.$nd,{kind:"tertiary",renderIcon:x.Vv,size:a,onClick:()=>(0,s.navigate)({to:`${P.lw}/appointments/calendar/${o()(t).format("YYYY-MM-DD")}`})},e("appointmentsCalendar","Appointments calendar")),l().createElement(m.$nd,{kind:"primary",renderIcon:e=>l().createElement(F.vg,{size:32,...e}),size:a,onClick:()=>(0,I.Xz)(e)},e("createNewAppointment","Create new appointment"))))},Y=()=>l().createElement(l().Fragment,null,l().createElement(M,null),l().createElement(s.ExtensionSlot,{name:"appointments-metrics-slot",className:"-esm-appointments__metrics-container__cardContainer___b6u5q"})),U=()=>{let{t:e}=(0,r.useTranslation)(),{setAppointmentServiceTypes:t}=(0,u.nS)(),n=(0,i.useParams)();return(0,a.useEffect)(()=>{n.serviceType&&t([n.serviceType])},[n.serviceType,t]),l().createElement(l().Fragment,null,l().createElement(w.A,{title:e("appointments","Appointments"),showServiceTypeFilter:!0}),l().createElement(Y,null),l().createElement(S,null))}},256(e,t,n){n.r(t),n.d(t,{default:()=>d});var a=n(7125),l=n.n(a),r=n(5921),i=n(9224),m=n(5845),s=n(2452),p=n(3639),o=n(1947);let d=()=>{let{t:e}=(0,r.useTranslation)(),{appointmentServiceTypes:t}=(0,p.nS)(),n=(0,o.h)(),{earlyAppointmentList:a,isLoading:d}=(0,m.M)(n),c=(0,i.Bm)(a,t).map((e,t)=>({id:`${t}`,...e}));return l().createElement(s.A,{appointments:c,isLoading:d,tableHeading:e("cameEarly","Came Early")})}},5881(e,t,n){n.d(t,{A:()=>E});var a=n(7125),l=n.n(a),r=n(3464),i=n.n(r),m=n(5921),s=n(2745),p=n(411),o=n(5848),d=n(2895),c=n(6),u=n(1947),_=n(3639),h=n(2373);let E=({title:e,showServiceTypeFilter:t,isCalendarView:n})=>{let{t:r}=(0,m.useTranslation)(),E=(0,s.useNavigate)(),g=(0,s.useLocation)(),{appointmentServiceTypes:b,setAppointmentServiceTypes:f}=(0,_.nS)(),{serviceTypes:y}=(0,c.V)(),v=(0,u.h)(),T=(0,a.useMemo)(()=>i()(v).toDate(),[v]),k=(0,a.useCallback)(({selectedItems:e})=>{f(e.map(e=>e.id))},[f]),C=(0,a.useMemo)(()=>y?.map(e=>({id:e.uuid,label:e.name}))??[],[y]);return l().createElement(d.PageHeader,{className:"-esm-appointments__appointments-header__header___QILcB","data-testid":"appointments-header"},l().createElement(d.PageHeaderContent,{illustration:l().createElement(d.AppointmentsPictogram,null),title:e}),l().createElement("div",{className:"-esm-appointments__appointments-header__rightJustifiedItems___2dLRu"},n?l().createElement(p.$nd,{kind:"primary",renderIcon:o.OM,size:"sm",onClick:()=>(0,h.Xz)(r)},r("newAppointment","New appointment")):l().createElement(l().Fragment,null,l().createElement(d.OpenmrsDatePicker,{"data-testid":"appointment-date-picker",id:"appointment-date-picker","aria-label":r("appointmentDate","Appointment date"),onChange:e=>{if(!e)return;let t=`/${i()(e).format("YYYY-MM-DD")}`;g.pathname.endsWith(t)||E(t)},value:T}),t&&l().createElement(p.KFt,{id:"serviceTypeMultiSelect",items:C,itemToString:e=>e?e.label:"",label:r("filterAppointmentsByServiceType","Filter appointments by service type"),onChange:k,type:"inline",selectedItems:C.filter(e=>b.includes(e.id))}))))}},6(e,t,n){n.d(t,{V:()=>m});var a=n(7125),l=n(2895),r=n(8909),i=n.n(r);function m(){let{data:e,error:t,isLoading:n}=i()(`${l.restBaseUrl}/appointmentService/all/default`,l.openmrsFetch);return{serviceTypes:(0,a.useMemo)(()=>e?.data?[...e.data].sort((e,t)=>e.name.localeCompare(t.name)):[],[e?.data]),isLoading:n,error:t}}}}]);
package/dist/3989.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["3989"],{2372(e,t,n){n.r(t),n.d(t,{INFINITE_PREFIX:()=>B,IS_REACT_LEGACY:()=>k,IS_SERVER:()=>I,OBJECT:()=>l,SWRConfig:()=>H,SWRGlobalState:()=>_,UNDEFINED:()=>a,cache:()=>q,compare:()=>$,createCacheHelper:()=>b,defaultConfig:()=>j,defaultConfigOptions:()=>S,getTimestamp:()=>W,hasRequestAnimationFrame:()=>y,initCache:()=>U,internalMutate:()=>x,isDocumentDefined:()=>v,isFunction:()=>u,isPromiseLike:()=>f,isUndefined:()=>s,isWindowDefined:()=>g,mergeConfigs:()=>z,mergeObjects:()=>c,mutate:()=>J,noop:()=>o,normalize:()=>K,preload:()=>Z,preset:()=>O,rAF:()=>A,revalidateEvents:()=>M,serialize:()=>N,slowConnection:()=>F,stableHash:()=>E,subscribeCallback:()=>en,useIsomorphicLayoutEffect:()=>D,useSWRConfig:()=>Q,withArgs:()=>et,withMiddleware:()=>er});var r=n(7125),i=n.n(r);let o=()=>{},a=o(),l=Object,s=e=>e===a,u=e=>"function"==typeof e,c=(e,t)=>({...e,...t}),f=e=>u(e.then),d=new WeakMap,p=0,E=e=>{let t,n,r=typeof e,i=e&&e.constructor,o=i==Date;if(l(e)!==e||o||i==RegExp)t=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=d.get(e))return t;if(t=++p+"~",d.set(e,t),i==Array){for(n=0,t="@";n<e.length;n++)t+=E(e[n])+",";d.set(e,t)}if(i==l){t="#";let r=l.keys(e).sort();for(;!s(n=r.pop());)s(e[n])||(t+=n+":"+E(e[n])+",");d.set(e,t)}}return t},_=new WeakMap,h={},m={},w="undefined",g=typeof window!=w,v=typeof document!=w,y=()=>g&&typeof window.requestAnimationFrame!=w,b=(e,t)=>{let n=_.get(e);return[()=>!s(t)&&e.get(t)||h,r=>{if(!s(t)){let i=e.get(t);t in m||(m[t]=i),n[5](t,c(i,r),i||h)}},n[6],()=>!s(t)&&t in m?m[t]:!s(t)&&e.get(t)||h]},R=!0,[C,T]=g&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[o,o],O={isOnline:()=>R,isVisible:()=>{let e=v&&document.visibilityState;return s(e)||"hidden"!==e}},S={initFocus:e=>(v&&document.addEventListener("visibilitychange",e),C("focus",e),()=>{v&&document.removeEventListener("visibilitychange",e),T("focus",e)}),initReconnect:e=>{let t=()=>{R=!0,e()},n=()=>{R=!1};return C("online",t),C("offline",n),()=>{T("online",t),T("offline",n)}}},k=!i().useId,I=!g||"Deno"in window,A=e=>y()?window.requestAnimationFrame(e):setTimeout(e,1),D=I?r.useEffect:r.useLayoutEffect,L="u">typeof navigator&&navigator.connection,F=!I&&L&&(["slow-2g","2g"].includes(L.effectiveType)||L.saveData),N=e=>{if(u(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?E(e):"",t]},V=0,W=()=>++V;var M={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function x(...e){let[t,n,r,i]=e,o=c({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),l=o.populateCache,d=o.rollbackOnError,p=o.optimisticData,E=o.throwOnError;if(u(n)){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(h))}return h(n);async function h(n){let i,[c]=N(n);if(!c)return;let[h,m]=b(t,c),[w,g,v,y]=_.get(t),R=()=>{let e=w[c];return(u(o.revalidate)?o.revalidate(h().data,n):!1!==o.revalidate)&&(delete v[c],delete y[c],e&&e[0])?e[0](2).then(()=>h().data):h().data};if(e.length<3)return R();let C=r,T=W();g[c]=[T,0];let O=!s(p),S=h(),k=S.data,I=S._c,A=s(I)?k:I;if(O&&m({data:p=u(p)?p(A,k):p,_c:A}),u(C))try{C=C(A)}catch(e){i=e}if(C&&f(C)){let e;if(C=await C.catch(e=>{i=e}),T!==g[c][0]){if(i)throw i;return C}i&&O&&(e=i,"function"==typeof d?d(e):!1!==d)&&(l=!0,m({data:A,_c:a}))}if(l&&!i&&(u(l)?m({data:l(C,A),error:a,_c:a}):m({data:C,error:a,_c:a})),g[c][1]=W(),Promise.resolve(R()).then(()=>{m({_c:a})}),i){if(E)throw i;return}return C}}let P=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},U=(e,t)=>{if(!_.has(e)){let n=c(S,t),r={},i=x.bind(a,e),l=o,s={},u=(e,t)=>{let n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},f=(t,n,r)=>{e.set(t,n);let i=s[t];if(i)for(let e of i)e(n,r)},d=()=>{if(!_.has(e)&&(_.set(e,[r,{},{},{},i,f,u]),!I)){let t=n.initFocus(setTimeout.bind(a,P.bind(a,r,0))),i=n.initReconnect(setTimeout.bind(a,P.bind(a,r,1)));l=()=>{t&&t(),i&&i(),_.delete(e)}}};return d(),[e,i,d,l]}return[e,_.get(e)[4]]},$=(e,t)=>E(e)==E(t),[q,J]=U(new Map),j=c({onLoadingSlow:o,onSuccess:o,onError:o,onErrorRetry:(e,t,n,r,i)=>{let o=n.errorRetryCount,a=i.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;(s(o)||!(a>o))&&setTimeout(r,l,i)},onDiscarded:o,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:F?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:F?5e3:3e3,compare:$,isPaused:()=>!1,cache:q,mutate:J,fallback:{}},O),z=(e,t)=>{let n=c(e,t);if(t){let{use:r,fallback:i}=e,{use:o,fallback:a}=t;r&&o&&(n.use=r.concat(o)),i&&a&&(n.fallback=c(i,a))}return n},G=(0,r.createContext)({}),H=e=>{let{value:t}=e,n=(0,r.useContext)(G),i=u(t),o=(0,r.useMemo)(()=>i?t(n):t,[i,n,t]),l=(0,r.useMemo)(()=>i?o:z(n,o),[i,n,o]),s=o&&o.provider,f=(0,r.useRef)(a);s&&!f.current&&(f.current=U(s(l.cache||q),o));let d=f.current;return d&&(l.cache=d[0],l.mutate=d[1]),D(()=>{if(d)return d[2]&&d[2](),d[3]},[]),(0,r.createElement)(G.Provider,c(e,{value:l}))},B="$inf$",X=g&&window.__SWR_DEVTOOLS_USE__,Y=X?window.__SWR_DEVTOOLS_USE__:[],K=e=>u(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],Q=()=>c(j,(0,r.useContext)(G)),Z=(e,t)=>{let[n,r]=N(e),[,,,i]=_.get(q);if(i[n])return i[n];let o=t(r);return i[n]=o,o},ee=Y.concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=N(t),[,,,i]=_.get(q);if(r.startsWith(B))return n(...e);let o=i[r];return s(o)?n(...e):(delete i[r],o)});return e(t,i,r)}),et=e=>function(...t){let n=Q(),[r,i,o]=K(t),a=z(n,o),l=e,{use:s}=a,u=(s||[]).concat(ee);for(let e=u.length;e--;)l=u[e](l);return l(r,i||a.fetcher||null,a)},en=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},er=(e,t)=>(...n)=>{let[r,i,o]=K(n),a=(o.use||[]).concat(t);return e(r,i,{...o,use:a})};X&&(window.__SWR_DEVTOOLS_REACT__=i())}}]);
1
+ "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["3989"],{2372(e,t,r){r.r(t),r.d(t,{INFINITE_PREFIX:()=>"$inf$",IS_REACT_LEGACY:()=>n.j,IS_SERVER:()=>n.I,OBJECT:()=>n.O,SWRConfig:()=>n.S,SWRGlobalState:()=>n.a,UNDEFINED:()=>n.U,cache:()=>n.o,compare:()=>n.v,createCacheHelper:()=>n.c,defaultConfig:()=>n.d,defaultConfigOptions:()=>n.w,getTimestamp:()=>n.g,hasRequestAnimationFrame:()=>n.x,initCache:()=>n.y,internalMutate:()=>n.f,isDocumentDefined:()=>n.z,isFunction:()=>n.e,isLegacyDeno:()=>n.A,isPromiseLike:()=>n.b,isUndefined:()=>n.i,isWindowDefined:()=>n.p,mergeConfigs:()=>n.t,mergeObjects:()=>n.m,mutate:()=>n.k,noop:()=>n.n,normalize:()=>u,preload:()=>s,preset:()=>n.B,rAF:()=>n.r,revalidateEvents:()=>n.C,serialize:()=>n.s,slowConnection:()=>n.D,stableHash:()=>n.G,subscribeCallback:()=>p,unload:()=>n.l,useIsomorphicLayoutEffect:()=>n.u,useSWRConfig:()=>c,withArgs:()=>d,withMiddleware:()=>g});var n=r(4079),i=r(7125),o=r.n(i);let a=n.p&&window.__SWR_DEVTOOLS_USE__,l=a?window.__SWR_DEVTOOLS_USE__:[],u=e=>(0,n.e)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],c=()=>{let e=(0,i.useContext)(n.q);return(0,i.useMemo)(()=>(0,n.m)(n.d,e),[e])},s=(e,t)=>{if(n.I)return;let[r,i]=(0,n.s)(e),[,,,o]=n.a.get(n.o);if(o[r])return o[r];let a=t(i);return o[r]=a,a},f=l.concat(e=>(t,r,i)=>{let o=r&&((...e)=>{let[i]=(0,n.s)(t),[,,,o]=n.a.get(n.o);if(i.startsWith("$inf$"))return r(...e);let a=o[i];return(0,n.i)(a)?r(...e):(delete o[i],a)});return e(t,o,i)}),d=e=>function(...t){let r=c(),[i,o,a]=u(t),l=(0,n.t)(r,a),s=e,{use:d}=l,p=(d||[]).concat(f);for(let e=p.length;e--;)s=p[e](s);return s(i,o||l.fetcher||null,l)},p=(e,t,r)=>{let n=t[e]||(t[e]=[]);return n.push(r),()=>{let e=n.indexOf(r);e>=0&&(n[e]=n[n.length-1],n.pop())}},g=(e,t)=>(...r)=>{let[n,i,o]=u(r),a=(o.use||[]).concat(t);return e(n,i,{...o,use:a})};a&&(window.__SWR_DEVTOOLS_REACT__=o())},4079(e,t,r){r.d(t,{x:()=>T,I:()=>N,j:()=>j,u:()=>M,F:()=>a,g:()=>G,r:()=>F,C:()=>f,d:()=>Z,o:()=>Y,z:()=>R,a:()=>d,l:()=>Q,w:()=>L,S:()=>er,i:()=>m,t:()=>ee,E:()=>c,f:()=>B,q:()=>et,c:()=>C,B:()=>I,M:()=>u,n:()=>p,y:()=>H,U:()=>g,k:()=>K,v:()=>X,G:()=>$,R:()=>l,h:()=>s,s:()=>q,D:()=>W,O:()=>h,e:()=>E,p:()=>O,A:()=>S,b:()=>w,m:()=>_});var n=r(7125),i=r.n(n),o=Object.prototype.hasOwnProperty;let a=0,l=1,u=2,c=3,s=4;var f={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1,UNLOAD_EVENT:4};let d=new WeakMap,p=()=>{},g=p(),h=Object,m=e=>e===g,E=e=>"function"==typeof e,_=(e,t)=>({...e,...t}),w=e=>E(e.then),y={},b={},v="undefined",O=typeof window!=v,R=typeof document!=v,S=O&&"Deno"in window,T=()=>O&&typeof window.requestAnimationFrame!=v,C=(e,t)=>{let r=d.get(e);return[()=>!m(t)&&e.get(t)||y,n=>{if(!m(t)){let i=e.get(t);t in b||(b[t]=i),r[5](t,_(i,n),i||y)}},r[6],()=>!m(t)&&t in b?b[t]:!m(t)&&e.get(t)||y]},D=!0,[k,A]=O&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[p,p],I={isOnline:()=>D,isVisible:()=>{let e=R&&document.visibilityState;return m(e)||"hidden"!==e}},L={initFocus:e=>(R&&document.addEventListener("visibilitychange",e),k("focus",e),()=>{R&&document.removeEventListener("visibilitychange",e),A("focus",e)}),initReconnect:e=>{let t=()=>{D=!0,e()},r=()=>{D=!1};return k("online",t),k("offline",r),()=>{A("online",t),A("offline",r)}}},j=!i().useId,N=!O||S,F=e=>T()?window.requestAnimationFrame(e):setTimeout(e,1),M=N?n.useEffect:n.useLayoutEffect,V="u">typeof navigator&&navigator.connection,W=!N&&V&&(["slow-2g","2g"].includes(V.effectiveType)||V.saveData),x=new WeakMap,U=(e,t)=>e===`[object ${t}]`,P=0,$=e=>{let t,r,n=typeof e,i=h.prototype.toString.call(e),o=U(i,"Date"),a=U(i,"RegExp"),l=U(i,"Object");if(h(e)!==e||o||a)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=x.get(e))return t;if(t=++P+"~",x.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=$(e[r])+",";x.set(e,t)}if(l){t="#";let n=h.keys(e).sort();for(;!m(r=n.pop());)m(e[r])||(t+=r+":"+$(e[r])+",");x.set(e,t)}}return t},q=e=>{if(E(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?$(e):"",t]},z=0,G=()=>++z;async function B(...e){let[t,r,n,i]=e,o=_({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),a=o.populateCache,l=o.rollbackOnError,c=o.optimisticData,s=o.throwOnError;if(E(r)){let e=[];for(let n of t.keys())!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n);return Promise.all(e.map(f))}return f(r);async function f(r){let i,[f]=q(r);if(!f)return;let[p,h]=C(t,f),[_,y,b,v]=d.get(t),O=()=>{let e=_[f];return(E(o.revalidate)?o.revalidate(p().data,r):!1!==o.revalidate)&&(delete b[f],delete v[f],e&&e[0])?e[0](u).then(()=>p().data):p().data};if(e.length<3)return O();let R=n,S=!1,T=G();y[f]=[T,0];let D=!m(c),k=p(),A=k.data,I=k._c,L=m(I)?A:I;if(D&&h({data:c=E(c)?c(L,A):c,_c:L}),E(R))try{R=R(L)}catch(e){i=e,S=!0}if(R&&w(R)){let e;if(R=await R.catch(e=>{i=e,S=!0}),T!==y[f][0]){if(S)throw i;return R}S&&D&&(e=i,"function"==typeof l?l(e):!1!==l)&&(a=!0,h({data:L,_c:g}))}if(a&&!S&&(E(a)?h({data:a(R,L),error:g,_c:g}):h({data:R,error:g,_c:g})),y[f][1]=G(),Promise.resolve(O()).then(()=>{h({_c:g})}),S){if(s)throw i;return}return R}}let J=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},H=(e,t)=>{if(!d.has(e)){let r=_(L,t),n=Object.create(null),i=B.bind(g,e),o=p,u=Object.create(null),c=(e,t)=>{let r=u[e]||[];return u[e]=r,r.push(t),()=>{let e=r.indexOf(t);e>=0&&(r[e]=r[r.length-1],r.pop())}},f=(t,r,n)=>{e.set(t,r);let i=u[t];if(i)for(let e of i)e(r,n)},h=t=>{let r=d.get(e),[,i,o,a]=r,l=G();for(let e in r[8]++,o)delete o[e];for(let e in a)delete a[e];for(let e in i)i[e]=[l,l];let c={};for(let t of[...e.keys()]){let r=e.get(t);e.delete(t);let n=u[t];if(n)for(let e of n)e(c,r)}let f=!t||!1!==t.revalidate;for(let e in n){let t=n[e];for(let e=0;e<t.length;e++)t[e](s,{revalidate:f&&!e})}},m=()=>{if(!d.has(e)&&(d.set(e,[n,Object.create(null),Object.create(null),Object.create(null),i,f,c,h,0]),!N)){let t=r.initFocus(setTimeout.bind(g,J.bind(g,n,a))),i=r.initReconnect(setTimeout.bind(g,J.bind(g,n,l)));o=()=>{t&&t(),i&&i(),d.delete(e)}}};return m(),[e,i,m,o,h]}let r=d.get(e);return[e,r[4],g,g,r[7]]},X=function e(t,r){var n,i;if(t===r)return!0;if(t&&r&&(n=t.constructor)===r.constructor){if(n===Date)return t.getTime()===r.getTime();if(n===RegExp)return t.toString()===r.toString();if(n===Array){if((i=t.length)===r.length)for(;i--&&e(t[i],r[i]););return -1===i}if(!n||"object"==typeof t){for(n in i=0,t)if(o.call(t,n)&&++i&&!o.call(r,n)||!(n in r)||!e(t[n],r[n]))return!1;return Object.keys(r).length===i}}return t!=t&&r!=r},[Y,K,,,Q]=H(new Map),Z=_({onLoadingSlow:p,onSuccess:p,onError:p,onErrorRetry:(e,t,r,n,i)=>{let o=r.errorRetryCount,a=i.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;(m(o)||!(a>o))&&setTimeout(n,l,i)},onDiscarded:p,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:W?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:W?5e3:3e3,compare:X,isPaused:()=>!1,cache:Y,mutate:K,unload:Q,fallback:{}},I),ee=(e,t)=>{let r=_(e,t);if(t){let{use:n,fallback:i,cacheData:o}=e,{use:a,fallback:l,cacheData:u}=t;n&&a&&(r.use=n.concat(a)),i&&l&&(r.fallback=_(i,l)),o&&u&&(r.cacheData=_(o,u))}return r},et=(0,n.createContext)({}),er=e=>{let{value:t}=e,r=(0,n.useContext)(et),i=E(t),o=(0,n.useMemo)(()=>i?t(r):t,[i,r,t]),a=(0,n.useMemo)(()=>i?o:ee(r,o),[i,r,o]),l=o&&o.provider,u=(0,n.useRef)(g);l&&!u.current&&(u.current=H(l(a.cache||Y),o));let c=u.current;return c&&(a.cache=c[0],a.mutate=c[1],a.unload=c[4]),M(()=>{if(c)return c[2]&&c[2](),c[3]},[]),(0,n.createElement)(et.Provider,_(e,{value:a}))}}}]);
package/dist/3989.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"3989.js","sources":["webpack://@openmrs/esm-appointments-app/../../node_modules/swr/dist/_internal/index.mjs"],"names":["Object","WeakMap","Date","RegExp","JSON","Array","window","document","I","setTimeout","navigator","o","Promise","e","t","s","Map","r","Math","i"],"mappings":"64BAGA,IAAM,EAAO,KAAK,EAKZ,EAA8B,IAC9B,EAASA,OACT,EAAc,AAAC,GAAI,IAAM,EACzB,EAAa,AAAC,GAAI,AAAY,YAAZ,OAAO,EACzB,EAAe,CAAC,EAAG,IAAK,EACtB,GAAG,CAAC,CACJ,GAAG,CAAC,AACR,GACE,EAAgB,AAAC,GAAI,EAAW,EAAE,IAAI,EAMtC,EAAQ,IAAIC,QAEd,EAAU,EASR,EAAa,AAAC,IAChB,IAGI,EACA,EAJE,EAAO,OAAO,EACd,EAAc,GAAO,EAAI,WAAW,CACpC,EAAS,GAAeC,KAG9B,GAAI,EAAO,KAAS,GAAQ,GAAU,GAAeC,OA8BjD,EAAS,EAAS,EAAI,MAAM,GAAK,AAAQ,UAAR,EAAmB,EAAI,QAAQ,GAAK,AAAQ,UAAR,EAAmBC,KAAK,SAAS,CAAC,GAAO,GA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sources":["webpack://@openmrs/esm-appointments-app/../../node_modules/swr/dist/_internal/index.mjs","webpack://@openmrs/esm-appointments-app/../../node_modules/dequal/lite/index.mjs","webpack://@openmrs/esm-appointments-app/../../node_modules/swr/dist/config-context-ext53wcz.mjs"],"names":["window","Object","WeakMap","document","setTimeout","navigator","t","JSON","Array","o","Promise","e","Date","RegExp","Map","Math","i","c"],"mappings":"4/BAMA,IAAM,EAAiB,GAAe,EAAIA,OAAO,oBAAoB,CAC/D,EAAM,EAAiBA,OAAO,oBAAoB,CAAG,EAAE,CAQvD,EAAY,AAAC,GACR,QAAW,CAAI,CAAC,EAAE,EAAI,CACzB,CAAI,CAAC,EAAE,CACP,CAAI,CAAC,EAAE,CACP,CAAI,CAAC,EAAE,EAAI,CAAC,EACf,CAAG,CACA,CAAI,CAAC,EAAE,CACP,KACA,AAAC,CAAY,OAAZ,CAAI,CAAC,EAAE,CAAY,CAAI,CAAC,EAAE,CAAG,CAAI,CAAC,EAAE,AAAD,GAAM,CAAC,EAC9C,CAGC,EAAe,KACjB,IAAM,EAAe,iBAAW,GAAgB,EAIhD,MAHqB,cAAQ,IAAI,QAAa,GAAa,CAAE,GAAe,CACxE,EACH,CAEL,EAEM,EAAU,CAAC,EAAM,KAEnB,GAAI,GAAS,CACT,OAEJ,GAAM,CAAC,EAAK,EAAM,CAAG,QAAU,GACzB,IAAO,EAAQ,CAAG,OAAkB,CAAC,GAAK,EAEhD,GAAI,CAAO,CAAC,EAAI,CACZ,OAAO,CAAO,CAAC,EAAI,CAEvB,IAAM,EAAM,EAAQ,GAEpB,OADA,CAAO,CAAC,EAAI,CAAG,EACR,CACX,EAmBM,EAAsB,EAAI,MAAM,CAlBnB,AAAC,GAAa,CAAC,EAAM,EAAU,KAE1C,IAAM,EAAU,GAAa,EAAC,GAAG,KAC7B,GAAM,CAAC,EAAI,CAAG,QAAU,GAClB,IAAO,EAAQ,CAAG,OAAkB,CAAC,GAAK,EAChD,GAAI,EAAI,UAAU,CAAC,SAGf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ACZ,EAAe,iBAAW,IAC1BY,EAAqB,EAAW,GAChC,EAAS,cAAQ,IAAIA,EAAqB,EAAM,GAAgB,EAAO,CACzEA,EACA,EACA,EACH,EAEK,EAAiB,cAAQ,IAAIA,EAAqB,EAAS,GAAa,EAAc,GAAS,CACjGA,EACA,EACA,EACH,EAEK,EAAW,GAAU,EAAO,QAAQ,CAEpC,EAAkB,aAAO,EAC3B,IAAY,CAAC,EAAgB,OAAO,EACpC,GAAgB,OAAO,CAAG,EAAU,EAAS,EAAe,KAAK,EAAI,GAAQ,EAAM,EAEvF,IAAMC,EAAe,EAAgB,OAAO,CAe5C,OAbIA,IACA,EAAe,KAAK,CAAGA,CAAY,CAAC,EAAE,CACtC,EAAe,MAAM,CAAGA,CAAY,CAAC,EAAE,CACvC,EAAe,MAAM,CAAGA,CAAY,CAAC,EAAE,EAG3C,EAA0B,KACtB,GAAIA,EAGA,OADAA,CAAY,CAAC,EAAE,EAAIA,CAAY,CAAC,EAAE,GAC3BA,CAAY,CAAC,EAAE,AAE9B,EAAG,EAAE,EACE,oBAAc,GAAiB,QAAQ,CAAE,EAAa,EAAO,CAChE,MAAO,CACX,GACJ,C"}
package/dist/4307.js CHANGED
@@ -1 +1 @@
1
- (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["4307"],{5602(e){e.exports=function(e,t,a){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=a();return this.format(e)===t.format(e)}}},4350(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>m});var n=a(7125),s=a.n(n),i=a(5921),l=a(411),r=a(2895),o=a(9391),p=a(2845),d=a(5084),u=a(5370);let m=({appointments:e,closeModal:t})=>{let{t:a}=(0,i.useTranslation)(),{mutateAppointments:m}=(0,u.q)(),c=!(0,r.isDesktop)((0,r.useLayoutType)()),[h,f]=(0,n.useState)(),{checkOutButton:E}=(0,r.useConfig)(),[y,C]=(0,n.useState)(!1),g=null!=h?e.find(e=>e.status!==h&&!(0,o.w)(e.status,h)):void 0,S=(0,n.useCallback)(()=>{C(!0),Promise.allSettled(e.map(e=>h===e.status?Promise.resolve():(0,p.yI)(h,e.uuid).then(t=>{var n;return h!==d.y2.COMPLETED?t:(n=e.patient.uuid,(0,r.openmrsFetch)(`${r.restBaseUrl}/visit?patient=${n}&v=${(void 0)??"default"}&includeInactive=false`,{signal:void 0,method:"GET",headers:{"Content-type":"application/json"}})).then(e=>{let t=e.data.results?.[0];if(t){let e=new AbortController,a={stopDatetime:new Date};return(0,r.updateVisit)(t.uuid,a,e)}}).catch(()=>((0,r.showSnackbar)({title:a("failedToUpdateVisit","Failed to update visit"),subtitle:a("failedToEndActiveVisit","Failed to end active visit for {{patient}}",{patient:e.patient.name})}),t))}))).then(async t=>{if(t.some(e=>"rejected"===e.status))for(let n=0;n<t.length;n++){let i=t[n];if("rejected"===i.status){let t=await i.reason.response.json(),l=e[n];(0,r.showSnackbar)({title:a("appointmentsUpdateFailed","Appointments update failed"),kind:"error",subtitle:s().createElement("div",null,a("appointmentsUpdateFailedMessage","Appointments update failed for {{patient}}. Reason: {{reason}}",{patient:l.patient.name,reason:t.error.translatedMessage}))})}}else(0,r.showSnackbar)({title:a("appointmentsUpdated","Appointments updated"),subtitle:a("appointmentsUpdatedMessage","Appointments for selected patients have been successfully updated")})}).finally(()=>{C(!1),m(),t()})},[h,e,t,m,a]);return s().createElement(s().Fragment,null,s().createElement(l.rQ0,{closeModal:t,title:a("changeAppointmentsStatus","Change appointments status")}),s().createElement(l.cwr,{className:"-esm-appointments__batch-change-appointment-statuses__modalBody___ROxOM"},s().createElement(l.BJc,{gap:5},s().createElement("p",null,a("changeStatusForSelectedAppointments","Change the status for the following appointments.")),s().createElement("ul",{className:"-esm-appointments__batch-change-appointment-statuses__appointmentsList___tqXTP"},e.map(e=>s().createElement("li",{key:e.patient.uuid},s().createElement(i.Trans,{i18nKey:"appointmentDisplay",values:{patientName:e.patient.name,serviceName:e.service.name,currentStatus:e.status}},s().createElement("strong",null,e.patient.name)," - ",e.service.name," - ",e.status)))),s().createElement(l.Wdr,null,s().createElement(l.msM,{id:"statusDropdown",className:"-esm-appointments__batch-change-appointment-statuses__statusDropdown___lx8de",label:a("selectStatus","Select status"),titleText:"",type:"inline",items:[{id:d.y2.SCHEDULED,label:a("scheduled","Scheduled")},{id:d.y2.CANCELLED,label:a("cancelled","Cancelled")},{id:d.y2.MISSED,label:a("missed","Missed")},...E.enabled?[{id:d.y2.COMPLETED,label:a("completed","Completed")}]:[]],itemToString:e=>e?e.label:"",onChange:e=>f(e.selectedItem.id),size:c?"lg":"sm"})),h===d.y2.COMPLETED&&s().createElement(l.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:a("markAppointmentAsCompletedMessage","Marking appointment as completed will end the active visit of the patient")}),h&&g&&s().createElement(l.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:a("invalidAppointmentStatusChange","Cannot transition appointment with status {{currentStatus}} to status {{newStatus}}",{currentStatus:g.status,newStatus:h})}))),s().createElement(l.jlY,null,s().createElement(l.$nd,{kind:"secondary",onClick:t},(0,r.getCoreTranslation)("cancel")),s().createElement(l.$nd,{kind:"primary",disabled:y||null!=g||null==h,onClick:S},y?s().createElement(l.OuH,{description:a("saving","Saving")+"..."}):s().createElement("span",null,a("saveAndClose","Save and close")))))}},2373(e,t,a){"use strict";a.d(t,{Ee:()=>o,Xz:()=>c,_h:()=>u,o_:()=>m,tF:()=>d,w:()=>h,xh:()=>p});var n=a(3464),s=a.n(n),i=a(2895),l=a(5084),r=a(7003);let o=e=>{let t=s()(e).startOf("day").format(r.BC);return`${i.restBaseUrl}/appointments?forDate=${encodeURIComponent(t)}`},p=e=>{let t=e.getHours(),a=e.getMinutes(),n=a<10?`0${a}`:a.toString();return`${t%12||12}:${n} ${t>=12?"PM":"AM"}`},d=(e,t)=>e.isSame(t,"month"),u=e=>{let t=s()(e).startOf("month"),a=s()(e).endOf("month"),n=s()(e).daysInMonth(),i=s()(e).subtract(1,"month"),l=s()(e).add(1,"month"),r=[];for(let e=i.daysInMonth()-t.day()+1;e<=i.daysInMonth();e++)r.push(i.date(e));for(let t=1;t<=n;t++)r.push(e.date(t));let o=r.length>30?7:14;for(let e=1;e<o-a.day();e++)r.push(l.date(e));return r},m=(e,t)=>{switch(e){case"M":return t("male","Male");case"F":return t("female","Female");case"O":return t("other","Other");case"U":return t("unknown","Unknown");default:return e}},c=e=>{(0,i.launchWorkspace2)("appointments-patient-search-workspace",{initialQuery:"",workspaceTitle:e("createNewAppointment","Create new appointment"),onPatientSelected(e,t,a,n){a(r.gC,{patientUuid:t.id})}},{startVisitWorkspaceName:"appointments-start-visit-workspace"})},h=(e,t)=>{let a={[l.y2.REQUESTED]:0,[l.y2.SCHEDULED]:1,[l.y2.CHECKEDIN]:3,[l.y2.COMPLETED]:4,[l.y2.CANCELLED]:4,[l.y2.MISSED]:4};return a[e]<a[t]||t===l.y2.SCHEDULED}},9391(e,t,a){"use strict";a.d(t,{Ee:()=>n.Ee,Xz:()=>n.Xz,_h:()=>n._h,o_:()=>n.o_,tF:()=>n.tF,w:()=>n.w});var n=a(2373)},5370(e,t,a){"use strict";a.d(t,{q:()=>r});var n=a(7125),s=a(7364),i=a(2895);let l=`${i.restBaseUrl}/appointment`;function r(){let{mutate:e}=(0,s.useSWRConfig)();return{mutateAppointments:(0,n.useCallback)(()=>e(e=>"string"==typeof e&&e.startsWith(l)||Array.isArray(e)&&e[0].startsWith(l)),[e])}}},2845(e,t,a){"use strict";a.d(t,{DM:()=>u,oo:()=>c,yI:()=>m});var n=a(3464),s=a.n(n),i=a(7364),l=a.n(i),r=a(2895),o=a(5602),p=a.n(o);s().extend(p());let d=`${r.restBaseUrl}/appointments/search`;function u(e,t,a){let{data:n,error:i,isLoading:o,isValidating:p,mutate:u}=l()(e?[d,e,t]:null,()=>(0,r.openmrsFetch)(d,{method:"POST",signal:a.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),m=n?.data?.length?n.data:null,c=m?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),h=m?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isAfter(s()().endOf("day"))),f=m?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isToday());return{data:n?{pastAppointments:c,upcomingAppointments:h,todaysAppointments:f}:null,error:i,isLoading:o,isValidating:p,mutate:u}}let m=async(e,t)=>{let a=Intl.DateTimeFormat().resolvedOptions().timeZone,n=s()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),i=`${r.restBaseUrl}/appointments/${t}/status-change`;return await (0,r.openmrsFetch)(i,{body:{toStatus:e,onDate:n,timeZone:a},method:"POST",headers:{"Content-Type":"application/json"}})},c=async e=>{let t=`${r.restBaseUrl}/appointment?uuid=${e}`,{data:a}=await (0,r.openmrsFetch)(t);return a?.status}}}]);
1
+ (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["4307"],{5602(e){e.exports=function(e,t,a){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=a();return this.format(e)===t.format(e)}}},4350(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>m});var n=a(7125),s=a.n(n),i=a(5921),l=a(411),r=a(2895),o=a(9391),p=a(2845),d=a(5084),u=a(5370);let m=({appointments:e,closeModal:t})=>{let{t:a}=(0,i.useTranslation)(),{mutateAppointments:m}=(0,u.q)(),c=!(0,r.isDesktop)((0,r.useLayoutType)()),[h,f]=(0,n.useState)(),{checkOutButton:E}=(0,r.useConfig)(),[y,C]=(0,n.useState)(!1),g=null!=h?e.find(e=>e.status!==h&&!(0,o.w)(e.status,h)):void 0,S=(0,n.useCallback)(()=>{C(!0),Promise.allSettled(e.map(e=>h===e.status?Promise.resolve():(0,p.yI)(h,e.uuid).then(t=>{var n;return h!==d.y2.COMPLETED?t:(n=e.patient.uuid,(0,r.openmrsFetch)(`${r.restBaseUrl}/visit?patient=${n}&v=${(void 0)??"default"}&includeInactive=false`,{signal:void 0,method:"GET",headers:{"Content-type":"application/json"}})).then(e=>{let t=e.data.results?.[0];if(t){let e=new AbortController,a={stopDatetime:new Date};return(0,r.updateVisit)(t.uuid,a,e)}}).catch(()=>((0,r.showSnackbar)({title:a("failedToUpdateVisit","Failed to update visit"),subtitle:a("failedToEndActiveVisit","Failed to end active visit for {{patient}}",{patient:e.patient.name})}),t))}))).then(async t=>{if(t.some(e=>"rejected"===e.status))for(let n=0;n<t.length;n++){let i=t[n];if("rejected"===i.status){let t=await i.reason.response.json(),l=e[n];(0,r.showSnackbar)({title:a("appointmentsUpdateFailed","Appointments update failed"),kind:"error",subtitle:s().createElement("div",null,a("appointmentsUpdateFailedMessage","Appointments update failed for {{patient}}. Reason: {{reason}}",{patient:l.patient.name,reason:t.error.translatedMessage}))})}}else(0,r.showSnackbar)({title:a("appointmentsUpdated","Appointments updated"),subtitle:a("appointmentsUpdatedMessage","Appointments for selected patients have been successfully updated")})}).finally(()=>{C(!1),m(),t()})},[h,e,t,m,a]);return s().createElement(s().Fragment,null,s().createElement(l.rQ0,{closeModal:t,title:a("changeAppointmentsStatus","Change appointments status")}),s().createElement(l.cwr,{className:"-esm-appointments__batch-change-appointment-statuses__modalBody___ROxOM"},s().createElement(l.BJc,{gap:5},s().createElement("p",null,a("changeStatusForSelectedAppointments","Change the status for the following appointments.")),s().createElement("ul",{className:"-esm-appointments__batch-change-appointment-statuses__appointmentsList___tqXTP"},e.map(e=>s().createElement("li",{key:e.patient.uuid},s().createElement(i.Trans,{i18nKey:"appointmentDisplay",values:{patientName:e.patient.name,serviceName:e.service.name,currentStatus:e.status}},s().createElement("strong",null,e.patient.name)," - ",e.service.name," - ",e.status)))),s().createElement(l.Wdr,null,s().createElement(l.msM,{id:"statusDropdown",className:"-esm-appointments__batch-change-appointment-statuses__statusDropdown___lx8de",label:a("selectStatus","Select status"),titleText:"",type:"inline",items:[{id:d.y2.SCHEDULED,label:a("scheduled","Scheduled")},{id:d.y2.CANCELLED,label:a("cancelled","Cancelled")},{id:d.y2.MISSED,label:a("missed","Missed")},...E.enabled?[{id:d.y2.COMPLETED,label:a("completed","Completed")}]:[]],itemToString:e=>e?e.label:"",onChange:e=>f(e.selectedItem.id),size:c?"lg":"sm"})),h===d.y2.COMPLETED&&s().createElement(l.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:a("markAppointmentAsCompletedMessage","Marking appointment as completed will end the active visit of the patient")}),h&&g&&s().createElement(l.jeF,{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:a("invalidAppointmentStatusChange","Cannot transition appointment with status {{currentStatus}} to status {{newStatus}}",{currentStatus:g.status,newStatus:h})}))),s().createElement(l.jlY,null,s().createElement(l.$nd,{kind:"secondary",onClick:t},(0,r.getCoreTranslation)("cancel")),s().createElement(l.$nd,{kind:"primary",disabled:y||null!=g||null==h,onClick:S},y?s().createElement(l.OuH,{description:a("saving","Saving")+"..."}):s().createElement("span",null,a("saveAndClose","Save and close")))))}},2373(e,t,a){"use strict";a.d(t,{Ee:()=>o,Xz:()=>c,_h:()=>u,o_:()=>m,tF:()=>d,w:()=>h,xh:()=>p});var n=a(3464),s=a.n(n),i=a(2895),l=a(5084),r=a(7003);let o=e=>{let t=s()(e).startOf("day").format(r.BC);return`${i.restBaseUrl}/appointments?forDate=${encodeURIComponent(t)}`},p=e=>{let t=e.getHours(),a=e.getMinutes(),n=a<10?`0${a}`:a.toString();return`${t%12||12}:${n} ${t>=12?"PM":"AM"}`},d=(e,t)=>e.isSame(t,"month"),u=e=>{let t=s()(e).startOf("month"),a=s()(e).endOf("month"),n=s()(e).daysInMonth(),i=s()(e).subtract(1,"month"),l=s()(e).add(1,"month"),r=[];for(let e=i.daysInMonth()-t.day()+1;e<=i.daysInMonth();e++)r.push(i.date(e));for(let t=1;t<=n;t++)r.push(e.date(t));let o=r.length>30?7:14;for(let e=1;e<o-a.day();e++)r.push(l.date(e));return r},m=(e,t)=>{switch(e){case"M":return t("male","Male");case"F":return t("female","Female");case"O":return t("other","Other");case"U":return t("unknown","Unknown");default:return e}},c=e=>{(0,i.launchWorkspace2)("appointments-patient-search-workspace",{initialQuery:"",workspaceTitle:e("createNewAppointment","Create new appointment"),onPatientSelected(e,t,a,n){a(r.gC,{patientUuid:t.id})}},{startVisitWorkspaceName:"appointments-start-visit-workspace"})},h=(e,t)=>{let a={[l.y2.REQUESTED]:0,[l.y2.SCHEDULED]:1,[l.y2.CHECKEDIN]:3,[l.y2.COMPLETED]:4,[l.y2.CANCELLED]:4,[l.y2.MISSED]:4};return a[e]<a[t]||t===l.y2.SCHEDULED}},9391(e,t,a){"use strict";a.d(t,{Ee:()=>n.Ee,Xz:()=>n.Xz,_h:()=>n._h,o_:()=>n.o_,tF:()=>n.tF,w:()=>n.w});var n=a(2373)},5370(e,t,a){"use strict";a.d(t,{q:()=>r});var n=a(7125),s=a(8909),i=a(2895);let l=`${i.restBaseUrl}/appointment`;function r(){let{mutate:e}=(0,s.useSWRConfig)();return{mutateAppointments:(0,n.useCallback)(()=>e(e=>"string"==typeof e&&e.startsWith(l)||Array.isArray(e)&&e[0].startsWith(l)),[e])}}},2845(e,t,a){"use strict";a.d(t,{DM:()=>u,oo:()=>c,yI:()=>m});var n=a(3464),s=a.n(n),i=a(8909),l=a.n(i),r=a(2895),o=a(5602),p=a.n(o);s().extend(p());let d=`${r.restBaseUrl}/appointments/search`;function u(e,t,a){let{data:n,error:i,isLoading:o,isValidating:p,mutate:u}=l()(e?[d,e,t]:null,()=>(0,r.openmrsFetch)(d,{method:"POST",signal:a.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),m=n?.data?.length?n.data:null,c=m?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),h=m?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isAfter(s()().endOf("day"))),f=m?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>s()(new Date(e).toISOString()).isToday());return{data:n?{pastAppointments:c,upcomingAppointments:h,todaysAppointments:f}:null,error:i,isLoading:o,isValidating:p,mutate:u}}let m=async(e,t)=>{let a=Intl.DateTimeFormat().resolvedOptions().timeZone,n=s()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),i=`${r.restBaseUrl}/appointments/${t}/status-change`;return await (0,r.openmrsFetch)(i,{body:{toStatus:e,onDate:n,timeZone:a},method:"POST",headers:{"Content-Type":"application/json"}})},c=async e=>{let t=`${r.restBaseUrl}/appointment?uuid=${e}`,{data:a}=await (0,r.openmrsFetch)(t);return a?.status}}}]);
package/dist/4560.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["4560"],{3296(e,r,t){var n=t(7125),a="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},i=n.useState,u=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function c(e){var r=e.getSnapshot;e=e.value;try{var t=r();return!a(e,t)}catch(e){return!0}}var o="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,r){return r()}:function(e,r){var t=r(),n=i({inst:{value:t,getSnapshot:r}}),a=n[0].inst,o=n[1];return s(function(){a.value=t,a.getSnapshot=r,c(a)&&o({inst:a})},[e,t,r]),u(function(){return c(a)&&o({inst:a}),e(function(){c(a)&&o({inst:a})})},[e]),l(t),t};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:o},8139(e,r,t){e.exports=t(3296)},4675(e,r,t){t.d(r,{S:()=>v,u:()=>h});var n=t(7125),a=t.n(n),i=t(8139),u=t(2372),s=t(4079);let l=a().use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(r=>{e.status="fulfilled",e.value=r},r=>{e.status="rejected",e.reason=r}),e}}),c={dedupe:!0},o=(e,r,t)=>{var n;return!!r&&(null==(n=e.get(r))?void 0:n.has(t))===!0},d=(e,r,t)=>{if(!r)return;let n=e.get(r);n||(n=new Set,e.set(r,n)),n.add(t)},f=Promise.resolve(s.U);f.status="fulfilled",f.value=s.U;let g=()=>s.n,v=s.O.defineProperty(s.S,"defaultValue",{value:s.d}),h=(0,u.withArgs)((e,r,t)=>{let{cache:a,compare:v,suspense:h,fallbackData:p,revalidateOnMount:b,revalidateIfStale:w,refreshInterval:S,refreshWhenHidden:k,refreshWhenOffline:m,keepPreviousData:y,strictServerPrefetchWarning:R}=t,[V,_,E,U]=s.a.get(a),[C,D]=(0,s.s)(e),L=(0,n.useRef)(!1),O=(0,n.useRef)(!1),T=(0,n.useRef)(C),P=(0,n.useRef)(r),I=(0,n.useRef)(t),j=()=>I.current.isVisible()&&I.current.isOnline(),[x,F,M,W]=(0,s.c)(a,C),q=(0,n.useRef)({}).current,z=(0,s.i)(p)?(0,s.i)(t.fallback)?s.U:t.fallback[C]:p,A=t.cacheData,Y=C?null==A?void 0:A[C]:s.U,$=C?U[C]:s.U,B=(0,s.i)($)&&!(0,s.i)(Y),G=B?Y:$,H=(e,r)=>{for(let t in q)if("data"===t){if(!v(e[t],r[t])&&(!(0,s.i)(e[t])||!v(ei,r[t])))return!1}else if(r[t]!==e[t])return!1;return!0},J=!L.current,K=(0,n.useMemo)(()=>{let e=x(),t=W(),n=e=>{let t=(0,s.m)(e);return(delete t._k,(()=>{if(!C||!r||I.current.isPaused())return!1;if(J&&!(0,s.i)(b))return b;let e=(0,s.i)(z)?t.data:z;return!(h&&B&&(0,s.i)(e))&&((0,s.i)(e)||w)})())?{isValidating:!0,isLoading:!0,...t}:t},a=n(e),i=e===t?a:n(t),u=a;return[()=>{let e=n(x());return H(e,u)?(u.data=e.data,u.isLoading=e.isLoading,u.isValidating=e.isValidating,u.error=e.error,u):(u=e,e)},()=>i]},[a,C]),N=(0,i.useSyncExternalStore)((0,n.useCallback)(e=>M(C,(r,t)=>{H(t,r)||e()}),[a,C]),K[0],K[1]),Q=V[C]&&V[C].length>0,X=N.data,Z=(0,s.i)(X)?z&&(0,s.b)(z)?l(z):z:X,ee=N.error,er=(0,n.useRef)(Z),et=(0,n.useRef)(s.U),en=et.current;en||(et.current=en=new WeakMap);let ea=(0,n.useRef)(null),ei=y?(0,s.i)(X)?(0,s.i)(er.current)?Z:er.current:X:Z,eu=C&&(0,s.i)(Z),es=(0,n.useRef)(null);s.I||(0,i.useSyncExternalStore)(g,()=>(es.current=!1,es),()=>(es.current=!0,es));let el=es.current;R&&el&&!h&&eu&&console.warn(`Missing pre-initiated data for serialized key "${C}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let ec=!(!C||!r||I.current.isPaused())&&(!Q||!!(0,s.i)(ee))&&(J&&!(0,s.i)(b)?b:(!h||!B||!eu)&&(h?!(0,s.i)(Z)&&w:(0,s.i)(Z)||w)),eo=J&&ec,ed=(0,s.i)(N.isValidating)?eo:N.isValidating,ef=(0,s.i)(N.isLoading)?eo:N.isLoading,eg=(0,n.useCallback)(async e=>{let r,n,a=P.current;if(!C||!a||O.current||I.current.isPaused())return!1;let i=!0,u=e||{},l=!E[C]||!u.dedupe,c=B&&!o(en,A,C)&&!(0,s.i)(G)&&(0,s.i)(x().data),f=()=>s.j?!O.current&&C===T.current&&L.current:C===T.current,g={isValidating:!1,isLoading:!1},h=()=>{F(g)},p=()=>{let e=E[C];e&&e[1]===n&&delete E[C]},b={isValidating:!0};(0,s.i)(x().data)&&(b.isLoading=!0);try{if(l&&(F(b),t.loadingTimeout&&(0,s.i)(x().data)&&setTimeout(()=>{i&&f()&&I.current.onLoadingSlow(C,t)},t.loadingTimeout),c&&d(en,A,C),E[C]=[c?G:a(D),(0,s.g)()],c&&U[C]&&delete U[C]),[r,n]=E[C],r=await r,l&&setTimeout(p,t.dedupingInterval),!E[C]||E[C][1]!==n)return l&&f()&&I.current.onDiscarded(C),!1;g.error=s.U;let e=_[C];if(!(0,s.i)(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return h(),l&&f()&&I.current.onDiscarded(C),!1;let u=x().data;g.data=v(u,r)?u:r,l&&f()&&I.current.onSuccess(r,C,t)}catch(t){p();let e=I.current,{shouldRetryOnError:r}=e;!e.isPaused()&&(g.error=t,l&&f()&&(e.onError(t,C,e),(!0===r||(0,s.e)(r)&&r(t))&&(!I.current.revalidateOnFocus||!I.current.revalidateOnReconnect||j())&&e.onErrorRetry(t,C,e,e=>{let r=V[C];r&&r[0]&&r[0](s.E,e)},{retryCount:(u.retryCount||0)+1,dedupe:!0})))}return i=!1,h(),!0},[C,a]),ev=(0,n.useCallback)((...e)=>(0,s.f)(a,T.current,...e),[]);if((0,s.u)(()=>{let e=ea.current;e&&(ea.current=null,d(en,e.cacheData,e.key),(0,s.i)(x().data)&&F({data:e.data,error:s.U,_k:e._k}),U[e.key]&&delete U[e.key])}),(0,s.u)(()=>{P.current=r,I.current=t,(0,s.i)(X)||(er.current=X)}),(0,s.u)(()=>{if(r||!B||(0,s.i)(G)||o(en,A,C)||!(0,s.i)(x().data))return;d(en,A,C);let e=_[C];(({value:e,getCacheData:r,canCommit:t,setCache:n})=>{let a=e=>{t()&&(0,s.i)(r())&&n(e)};Promise.resolve(e).then(e=>{a({data:e,error:s.U})},e=>{a({error:e})})})({value:G,getCacheData:()=>x().data,canCommit:()=>!O.current&&C===T.current&&_[C]===e,setCache:e=>F({...e,_k:D})})}),(0,s.u)(()=>{if(!C)return;let e=eg.bind(s.U,c),r=0;I.current.revalidateOnFocus&&(r=Date.now()+I.current.focusThrottleInterval);let t=(0,u.subscribeCallback)(C,V,(t,n={})=>{if(t==s.F){let t=Date.now();I.current.revalidateOnFocus&&t>r&&j()&&(r=t+I.current.focusThrottleInterval,e())}else if(t==s.R)I.current.revalidateOnReconnect&&j()&&e();else if(t==s.M)return eg();else if(t==s.E)return eg(n);else if(t==s.h&&(er.current=s.U,n.revalidate))return eg()});return O.current=!1,T.current=C,L.current=!0,F({_k:D}),ec&&!E[C]&&((0,s.i)(Z)||s.I?e():(0,s.r)(e)),()=>{O.current=!0,t()}},[C]),(0,s.u)(()=>{let e;function r(){let r=(0,s.e)(S)?S(x().data):S;r&&-1!==e&&(e=setTimeout(t,r))}function t(){!x().error&&(k||I.current.isVisible())&&(m||I.current.isOnline())?eg(c).then(r):r()}return r(),()=>{e&&(clearTimeout(e),e=-1)}},[S,k,m,C]),(0,n.useDebugValue)(ei),h){if(!s.j&&s.I&&eu&&(0,s.i)(G))throw Error("Fallback data is required when using Suspense in SSR.");eu&&(P.current=r,I.current=t,O.current=!1);let e=!(0,s.i)(G)&&eu,n=s.U;if(e&&B?(Z=n=G&&(0,s.b)(G)?l(G):G,ei=n,s.I||(ea.current={data:n,_k:D,key:C,cacheData:A})):l(e?ev(G):f),!(0,s.i)(ee)&&eu)throw ee;let a=eu&&(0,s.i)(n)?eg(c):f;!(0,s.i)(ei)&&eu&&(a.status="fulfilled",a.value=!0),l(a)}return{mutate:ev,get data(){return q.data=!0,ei},get error(){return q.error=!0,ee},get isValidating(){return q.isValidating=!0,ed},get isLoading(){return q.isLoading=!0,ef}}})}}]);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4560.js","sources":["webpack://@openmrs/esm-appointments-app/../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","webpack://@openmrs/esm-appointments-app/../../node_modules/use-sync-external-store/shim/index.js","webpack://@openmrs/esm-appointments-app/../../node_modules/swr/dist/use-swr-emll9s78.mjs"],"names":["Object","u","c","e","window","Set","Promise","s","WeakMap","console","setTimeout","r","Date","t","clearTimeout","Error"],"mappings":"yJAWA,IAAI,EAAQ,EAAQ,MAIhB,EAAW,YAAe,OAAOA,OAAO,EAAE,CAAGA,OAAO,EAAE,CAH1D,SAAY,CAAC,CAAE,CAAC,EACd,OAAO,AAAC,IAAM,GAAM,KAAM,GAAK,EAAI,GAAM,EAAI,IAAQ,GAAM,GAAK,GAAM,CACxE,EAEE,EAAW,EAAM,QAAQ,CACzBC,EAAY,EAAM,SAAS,CAC3B,EAAkB,EAAM,eAAe,CACvC,EAAgB,EAAM,aAAa,CA0BrC,SAASC,EAAuB,CAAI,EAClC,IAAI,EAAoB,EAAK,WAAW,CACxC,EAAO,EAAK,KAAK,CACjB,GAAI,CACF,IAAI,EAAY,IAChB,MAAO,CAAC,EAAS,EAAM,EACzB,CAAE,MAAOC,EAAO,CACd,MAAO,CAAC,CACV,CACF,CAIA,IAAI,EACF,IAAgB,OAAOC,QACvB,SAAuBA,OAAO,QAAQ,EACtC,SAAuBA,OAAO,QAAQ,CAAC,aAAa,CANtD,SAAgC,CAAS,CAAE,CAAW,EACpD,OAAO,GACT,EArCA,SAAgC,CAAS,CAAE,CAAW,EACpD,IAAI,EAAQ,IACV,EAAY,EAAS,CAAE,KAAM,CAAE,MAAO,EAAO,YAAa,CAAY,CAAE,GACxE,EAAO,CAAS,CAAC,EAAE,CAAC,IAAI,CACxB,EAAc,CAAS,CAAC,EAAE,CAmB5B,OAlBA,EACE,WACE,EAAK,KAAK,CAAG,EACb,EAAK,WAAW,CAAG,EACnBF,EAAuB,IAAS,EAAY,CAAE,KAAM,CAAK,EAC3D,EACA,CAAC,EAAW,EAAO,EAAY,EAEjCD,EACE,WAEE,OADAC,EAAuB,IAAS,EAAY,CAAE,KAAM,CAAK,GAClD,EAAU,WACfA,EA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,EAEnF,GAAe,EACX,AAAC,GAAS,EACV,IAAgB,OAAO,CAAG,CACtB,KAAM,EACN,GAAI,EACJ,MACA,UAAW,CACf,IAIJ,EADkB,EAAuB,GAAY,GAAiB,GAGtE,CAAC,QAAY,KAAU,GACvB,MAAM,GAEV,IAAM,EAAe,IAAmB,QAAY,GAAe,GAAW,GAAe,CACzF,EAAC,QAAY,KAAiB,KAE9B,EAAa,MAAM,CAAG,YAEtB,EAAa,KAAK,CAAG,IAEzB,EAAI,EACR,CAoBA,MAnBoB,CAChB,OAAQ,GACR,IAAI,MAAQ,CAER,OADA,EAAkB,IAAI,CAAG,GAClB,EACX,EACA,IAAI,OAAS,CAET,OADA,EAAkB,KAAK,CAAG,GACnB,EACX,EACA,IAAI,cAAgB,CAEhB,OADA,EAAkB,YAAY,CAAG,GAC1B,EACX,EACA,IAAI,WAAa,CAEb,OADA,EAAkB,SAAS,CAAG,GACvB,EACX,CACJ,CAEJ,E"}
package/dist/5640.js CHANGED
@@ -1 +1 @@
1
- (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["5640"],{5602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},7657(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(a,i,s){var r=i.prototype;s.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},r.utc=function(t){var n=s(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},r.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var o=r.parse;r.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var l=r.init;r.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var m=r.utcOffset;r.utcOffset=function(a,i){var s=this.$utils().u;if(s(a))return this.$u?0:s(this.$offset)?m.call(this):this.$offset;if("string"==typeof a&&null===(a=function(e){void 0===e&&(e="");var a=e.match(t);if(!a)return null;var i=(""+a[0]).match(n)||["-",0,0],s=i[0],r=60*i[1]+ +i[2];return 0===r?0:"+"===s?r:-r}(a)))return this;var r=16>=Math.abs(a)?60*a:a,o=this;if(i)return o.$offset=r,o.$u=0===a,o;if(0!==a){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(r+l,e)).$offset=r,o.$x.$localOffset=l}else o=this.utc();return o};var p=r.format;r.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,t)},r.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var c=r.toDate;r.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=r.diff;r.diff=function(e,t,n){if(e&&this.$u===e.$u)return u.call(this,e,t,n);var a=this.local(),i=s(e).local();return u.call(a,i,t,n)}}}()},7(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>D});var a=n(7125),i=n.n(a),s=n(3464),r=n.n(s),o=n(5921),l=n(411),m=n(2895),p=n(2845),c=n(3373),u=n.n(c),d=n(7657),_=n.n(d);let h="-esm-appointments__patient-appointments-action-menu__menuItem___rJ8Ol",f=({appointment:e,patientUuid:t,launchAppointmentForm:n})=>{let{t:a}=(0,o.useTranslation)(),s="tablet"===(0,m.useLayoutType)();return i().createElement(l.Wdr,{className:"-esm-appointments__patient-appointments-action-menu__layer___QvdWM"},i().createElement(l.obU,{"aria-label":"Edit or delete appointment",size:s?"lg":"sm",flipped:!0,align:"left"},i().createElement(l.XSD,{className:h,id:"editAppointment",itemText:a("edit","Edit"),onClick:()=>{n?n(t,e):(0,m.launchWorkspace2)("appointments-form-workspace",{appointment:e,patientUuid:t})}}),i().createElement(l.XSD,{className:h,hasDivider:!0,id:"cancelAppointment",isDelete:!0,itemText:a("cancel","Cancel"),onClick:()=>{let n=(0,m.showModal)("cancel-appointment-modal",{closeCancelModal:()=>n(),appointmentUuid:e.uuid,patientUuid:t})}})))},E={layer:"-esm-appointments__patient-appointments-table__layer___3XHUe",menuItem:"-esm-appointments__patient-appointments-table__menuItem___lt5oF",text02:"-esm-appointments__patient-appointments-table__text02___YEBCA",table:"-esm-appointments__patient-appointments-table__table___6grQU"};r().extend(_());let g=({patientAppointments:e,patientUuid:t,switchedView:n,setSwitchedView:s,launchAppointmentForm:r})=>{let{t:p}=(0,o.useTranslation)(),{results:c,currentPage:d,goTo:_}=(0,m.usePagination)(e,10),h="tablet"===(0,m.useLayoutType)();(0,a.useEffect)(()=>{n&&1!==d&&_(1)},[n,_,d]);let g=(0,a.useMemo)(()=>[{key:"date",header:p("date","Date")},{key:"location",header:p("location","Location")},{key:"service",header:p("service","Service")},{key:"status",header:p("status","Status")},{key:"type",header:p("type","Type")},{key:"notes",header:p("notes","Notes")}],[p]),v=(0,a.useMemo)(()=>c?.map(e=>({id:e.uuid,date:e.startDateTime?(0,m.formatDatetime)(new Date(e.startDateTime),{mode:"wide"}):"——",location:e?.location?.name?e?.location?.name:"——",service:e.service.name,status:e.status,type:e.appointmentKind?e.appointmentKind:"——",notes:e.comments?e.comments:"——"})),[c]);return i().createElement("div",null,i().createElement(l.bQt,{rows:v,headers:g,isSortable:!0,size:h?"lg":"sm",useZebraStyles:!0},({rows:e,headers:n,getHeaderProps:a,getTableProps:s})=>i().createElement(l.K3K,null,i().createElement(l.XIK,{className:E.table,...s()},i().createElement(l.ndF,null,i().createElement(l.Hjg,null,n.map(e=>i().createElement(l.A0N,{className:u()(E.productiveHeading01,E.text02),...a({header:e})},e.header)),i().createElement(l.A0N,null))),i().createElement(l.BFY,null,e.map((e,n)=>i().createElement(l.Hjg,{key:e.id},e.cells.map(e=>i().createElement(l.nA6,{key:e.id},e.value?.content??e.value)),i().createElement(l.nA6,{className:"cds--table-column-menu"},i().createElement(f,{appointment:c[n],patientUuid:t,launchAppointmentForm:r})))))))),i().createElement(m.Pagination,{currentItems:c.length,totalItems:e.length,onPageNumberChange:({page:e})=>{s(!1),_(e)},pageNumber:d,pageSize:10}))},v="-esm-appointments__patient-appointments-detailed-summary__content___UXb5t",y="-esm-appointments__patient-appointments-detailed-summary__tile___1k6FD",D=({patientUuid:e,launchAppointmentForm:t})=>{let{t:n}=(0,o.useTranslation)(),s=n("appointments","Appointments"),c="tablet"===(0,m.useLayoutType)(),[u,d]=(0,a.useState)(!1),_=t||((e,t)=>{(0,m.launchWorkspace2)("appointments-form-workspace",{patientUuid:e,appointment:t})}),[h,f]=(0,a.useState)(0),E=(0,a.useMemo)(()=>r()().subtract(6,"month").toISOString(),[]),{data:D,error:T,isLoading:$,isValidating:b}=(0,p.DM)(e,E,(0,a.useMemo)(()=>new AbortController,[]));return $?i().createElement(l.OOb,{role:"progressbar",compact:!c,zebra:!0}):T?i().createElement(m.ErrorCard,{headerTitle:s,error:T}):D&&Object.keys(D)?.length?i().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__widgetCard___NRC+0"},i().createElement(m.CardHeader,{title:s},b?i().createElement("span",null,i().createElement(l.OuH,null)):null,i().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__contentSwitcherWrapper___kUL1Q"},i().createElement(l.Tps,{size:c?"md":"sm",selectedIndex:h,onChange:({index:e})=>{f(e),d(!0)}},i().createElement(l.dOG,{name:"upcoming"},n("upcoming","Upcoming")),i().createElement(l.dOG,{name:"today"},n("today","Today")),i().createElement(l.dOG,{name:"past"},n("past","Past"))),i().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__divider___t1P0L"},"|"),i().createElement(l.$nd,{kind:"ghost",renderIcon:e=>i().createElement(m.AddIcon,{size:16,...e}),iconDescription:n("addAppointments","Add Appointments"),onClick:()=>_(e)},n("add","Add")))),0===h?D.upcomingAppointments?.length?i().createElement(g,{patientAppointments:D?.upcomingAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:_}):i().createElement(l.Wdr,null,i().createElement(l.FAs,{className:y},i().createElement(m.EmptyCardIllustration,null),i().createElement("p",{className:v},n("noUpcomingAppointmentsForPatient","There are no upcoming appointments to display for this patient")))):1===h?D.todaysAppointments?.length?i().createElement(g,{patientAppointments:D?.todaysAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:_}):i().createElement(l.Wdr,null,i().createElement(l.FAs,{className:y},i().createElement(m.EmptyCardIllustration,null),i().createElement("p",{className:v},n("noCurrentAppointments","There are no appointments scheduled for today to display for this patient")))):2===h?D.pastAppointments?.length?i().createElement(g,{patientAppointments:D?.pastAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:_}):i().createElement(l.Wdr,null,i().createElement(l.FAs,{className:y},i().createElement(m.EmptyCardIllustration,null),i().createElement("p",{className:v},n("noPastAppointments","There are no past appointments to display for this patient")))):void 0):void 0}},4299(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});var a=n(7125),i=n.n(a),s=n(411),r=n(2745),o=n(2895),l=n(7),m=n(5848),p=n(5921);let c={patientBanner:"-esm-appointments__patient-appointments-header__patientBanner___ZB+Tp",patientAvatar:"-esm-appointments__patient-appointments-header__patientAvatar___mPs+Y",divider:"-esm-appointments__patient-appointments-header__divider___bc+VD",backButton:"-esm-appointments__patient-appointments-header__backButton___uXOql",titleContent:"-esm-appointments__patient-appointments-header__titleContent___eyA4H"},u=({patient:e})=>{let{t}=(0,p.useTranslation)(),n=(0,r.useNavigate)(),a=(0,o.getPatientName)(e);return i().createElement("header",null,i().createElement("div",{className:c.titleContainer},i().createElement(s.$nd,{className:c.backButton,iconDescription:t("back","Back"),kind:"ghost",onClick:()=>n(-1),renderIcon:m.nk,size:"lg"},i().createElement("span",null,t("back","Back")))),i().createElement("div",{className:c.divider}),i().createElement("div",{className:c.patientBanner},i().createElement("div",{className:c.patientAvatar},i().createElement(o.PatientPhoto,{patientUuid:e.id,patientName:a})),i().createElement(o.PatientBannerPatientInfo,{patient:e})),i().createElement("div",{className:c.divider}))},d=()=>{let e=(0,r.useParams)(),t=(0,o.usePatient)(e.patientUuid),n=(0,o.useLayoutType)();return t.isLoading?i().createElement(s.OOb,{role:"progressbar",compact:(0,o.isDesktop)(n),zebra:!0}):i().createElement("div",{className:"-esm-appointments__patient-appointments-overview__patientAppointmentsOverview___yVu1O"},i().createElement(u,{patient:t.patient}),i().createElement(l.default,{patientUuid:t.patient.id,launchAppointmentForm:(e,t)=>{(0,o.launchWorkspace2)("appointments-form-workspace",{patientUuid:e,appointment:t})}}),i().createElement(o.WorkspaceContainer,{overlay:!0,contextKey:`patient/${e.patientUuid}`}))}},2845(e,t,n){"use strict";n.d(t,{DM:()=>c,oo:()=>d,yI:()=>u});var a=n(3464),i=n.n(a),s=n(7364),r=n.n(s),o=n(2895),l=n(5602),m=n.n(l);i().extend(m());let p=`${o.restBaseUrl}/appointments/search`;function c(e,t,n){let{data:a,error:s,isLoading:l,isValidating:m,mutate:c}=r()(e?[p,e,t]:null,()=>(0,o.openmrsFetch)(p,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),u=a?.data?.length?a.data:null,d=u?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>i()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),_=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>i()(new Date(e).toISOString()).isAfter(i()().endOf("day"))),h=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>i()(new Date(e).toISOString()).isToday());return{data:a?{pastAppointments:d,upcomingAppointments:_,todaysAppointments:h}:null,error:s,isLoading:l,isValidating:m,mutate:c}}let u=async(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=i()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),s=`${o.restBaseUrl}/appointments/${t}/status-change`;return await (0,o.openmrsFetch)(s,{body:{toStatus:e,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},d=async e=>{let t=`${o.restBaseUrl}/appointment?uuid=${e}`,{data:n}=await (0,o.openmrsFetch)(t);return n?.status}}}]);
1
+ (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["5640"],{5602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},7657(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(a,i,s){var r=i.prototype;s.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},r.utc=function(t){var n=s(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},r.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var o=r.parse;r.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var l=r.init;r.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var m=r.utcOffset;r.utcOffset=function(a,i){var s=this.$utils().u;if(s(a))return this.$u?0:s(this.$offset)?m.call(this):this.$offset;if("string"==typeof a&&null===(a=function(e){void 0===e&&(e="");var a=e.match(t);if(!a)return null;var i=(""+a[0]).match(n)||["-",0,0],s=i[0],r=60*i[1]+ +i[2];return 0===r?0:"+"===s?r:-r}(a)))return this;var r=16>=Math.abs(a)?60*a:a,o=this;if(i)return o.$offset=r,o.$u=0===a,o;if(0!==a){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(r+l,e)).$offset=r,o.$x.$localOffset=l}else o=this.utc();return o};var p=r.format;r.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,t)},r.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var c=r.toDate;r.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=r.diff;r.diff=function(e,t,n){if(e&&this.$u===e.$u)return u.call(this,e,t,n);var a=this.local(),i=s(e).local();return u.call(a,i,t,n)}}}()},7(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>D});var a=n(7125),i=n.n(a),s=n(3464),r=n.n(s),o=n(5921),l=n(411),m=n(2895),p=n(2845),c=n(3373),u=n.n(c),d=n(7657),_=n.n(d);let h="-esm-appointments__patient-appointments-action-menu__menuItem___rJ8Ol",f=({appointment:e,patientUuid:t,launchAppointmentForm:n})=>{let{t:a}=(0,o.useTranslation)(),s="tablet"===(0,m.useLayoutType)();return i().createElement(l.Wdr,{className:"-esm-appointments__patient-appointments-action-menu__layer___QvdWM"},i().createElement(l.obU,{"aria-label":"Edit or delete appointment",size:s?"lg":"sm",flipped:!0,align:"left"},i().createElement(l.XSD,{className:h,id:"editAppointment",itemText:a("edit","Edit"),onClick:()=>{n?n(t,e):(0,m.launchWorkspace2)("appointments-form-workspace",{appointment:e,patientUuid:t})}}),i().createElement(l.XSD,{className:h,hasDivider:!0,id:"cancelAppointment",isDelete:!0,itemText:a("cancel","Cancel"),onClick:()=>{let n=(0,m.showModal)("cancel-appointment-modal",{closeCancelModal:()=>n(),appointmentUuid:e.uuid,patientUuid:t})}})))},E={layer:"-esm-appointments__patient-appointments-table__layer___3XHUe",menuItem:"-esm-appointments__patient-appointments-table__menuItem___lt5oF",text02:"-esm-appointments__patient-appointments-table__text02___YEBCA",table:"-esm-appointments__patient-appointments-table__table___6grQU"};r().extend(_());let g=({patientAppointments:e,patientUuid:t,switchedView:n,setSwitchedView:s,launchAppointmentForm:r})=>{let{t:p}=(0,o.useTranslation)(),{results:c,currentPage:d,goTo:_}=(0,m.usePagination)(e,10),h="tablet"===(0,m.useLayoutType)();(0,a.useEffect)(()=>{n&&1!==d&&_(1)},[n,_,d]);let g=(0,a.useMemo)(()=>[{key:"date",header:p("date","Date")},{key:"location",header:p("location","Location")},{key:"service",header:p("service","Service")},{key:"status",header:p("status","Status")},{key:"type",header:p("type","Type")},{key:"notes",header:p("notes","Notes")}],[p]),v=(0,a.useMemo)(()=>c?.map(e=>({id:e.uuid,date:e.startDateTime?(0,m.formatDatetime)(new Date(e.startDateTime),{mode:"wide"}):"——",location:e?.location?.name?e?.location?.name:"——",service:e.service.name,status:e.status,type:e.appointmentKind?e.appointmentKind:"——",notes:e.comments?e.comments:"——"})),[c]);return i().createElement("div",null,i().createElement(l.bQt,{rows:v,headers:g,isSortable:!0,size:h?"lg":"sm",useZebraStyles:!0},({rows:e,headers:n,getHeaderProps:a,getTableProps:s})=>i().createElement(l.K3K,null,i().createElement(l.XIK,{className:E.table,...s()},i().createElement(l.ndF,null,i().createElement(l.Hjg,null,n.map(e=>i().createElement(l.A0N,{className:u()(E.productiveHeading01,E.text02),...a({header:e})},e.header)),i().createElement(l.A0N,null))),i().createElement(l.BFY,null,e.map((e,n)=>i().createElement(l.Hjg,{key:e.id},e.cells.map(e=>i().createElement(l.nA6,{key:e.id},e.value?.content??e.value)),i().createElement(l.nA6,{className:"cds--table-column-menu"},i().createElement(f,{appointment:c[n],patientUuid:t,launchAppointmentForm:r})))))))),i().createElement(m.Pagination,{currentItems:c.length,totalItems:e.length,onPageNumberChange:({page:e})=>{s(!1),_(e)},pageNumber:d,pageSize:10}))},v="-esm-appointments__patient-appointments-detailed-summary__content___UXb5t",y="-esm-appointments__patient-appointments-detailed-summary__tile___1k6FD",D=({patientUuid:e,launchAppointmentForm:t})=>{let{t:n}=(0,o.useTranslation)(),s=n("appointments","Appointments"),c="tablet"===(0,m.useLayoutType)(),[u,d]=(0,a.useState)(!1),_=t||((e,t)=>{(0,m.launchWorkspace2)("appointments-form-workspace",{patientUuid:e,appointment:t})}),[h,f]=(0,a.useState)(0),E=(0,a.useMemo)(()=>r()().subtract(6,"month").toISOString(),[]),{data:D,error:T,isLoading:$,isValidating:b}=(0,p.DM)(e,E,(0,a.useMemo)(()=>new AbortController,[]));return $?i().createElement(l.OOb,{role:"progressbar",compact:!c,zebra:!0}):T?i().createElement(m.ErrorCard,{headerTitle:s,error:T}):D&&Object.keys(D)?.length?i().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__widgetCard___NRC+0"},i().createElement(m.CardHeader,{title:s},b?i().createElement("span",null,i().createElement(l.OuH,null)):null,i().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__contentSwitcherWrapper___kUL1Q"},i().createElement(l.Tps,{size:c?"md":"sm",selectedIndex:h,onChange:({index:e})=>{f(e),d(!0)}},i().createElement(l.dOG,{name:"upcoming"},n("upcoming","Upcoming")),i().createElement(l.dOG,{name:"today"},n("today","Today")),i().createElement(l.dOG,{name:"past"},n("past","Past"))),i().createElement("div",{className:"-esm-appointments__patient-appointments-detailed-summary__divider___t1P0L"},"|"),i().createElement(l.$nd,{kind:"ghost",renderIcon:e=>i().createElement(m.AddIcon,{size:16,...e}),iconDescription:n("addAppointments","Add Appointments"),onClick:()=>_(e)},n("add","Add")))),0===h?D.upcomingAppointments?.length?i().createElement(g,{patientAppointments:D?.upcomingAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:_}):i().createElement(l.Wdr,null,i().createElement(l.FAs,{className:y},i().createElement(m.EmptyCardIllustration,null),i().createElement("p",{className:v},n("noUpcomingAppointmentsForPatient","There are no upcoming appointments to display for this patient")))):1===h?D.todaysAppointments?.length?i().createElement(g,{patientAppointments:D?.todaysAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:_}):i().createElement(l.Wdr,null,i().createElement(l.FAs,{className:y},i().createElement(m.EmptyCardIllustration,null),i().createElement("p",{className:v},n("noCurrentAppointments","There are no appointments scheduled for today to display for this patient")))):2===h?D.pastAppointments?.length?i().createElement(g,{patientAppointments:D?.pastAppointments,switchedView:u,setSwitchedView:d,patientUuid:e,launchAppointmentForm:_}):i().createElement(l.Wdr,null,i().createElement(l.FAs,{className:y},i().createElement(m.EmptyCardIllustration,null),i().createElement("p",{className:v},n("noPastAppointments","There are no past appointments to display for this patient")))):void 0):void 0}},4299(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});var a=n(7125),i=n.n(a),s=n(411),r=n(2745),o=n(2895),l=n(7),m=n(5848),p=n(5921);let c={patientBanner:"-esm-appointments__patient-appointments-header__patientBanner___ZB+Tp",patientAvatar:"-esm-appointments__patient-appointments-header__patientAvatar___mPs+Y",divider:"-esm-appointments__patient-appointments-header__divider___bc+VD",backButton:"-esm-appointments__patient-appointments-header__backButton___uXOql",titleContent:"-esm-appointments__patient-appointments-header__titleContent___eyA4H"},u=({patient:e})=>{let{t}=(0,p.useTranslation)(),n=(0,r.useNavigate)(),a=(0,o.getPatientName)(e);return i().createElement("header",null,i().createElement("div",{className:c.titleContainer},i().createElement(s.$nd,{className:c.backButton,iconDescription:t("back","Back"),kind:"ghost",onClick:()=>n(-1),renderIcon:m.nk,size:"lg"},i().createElement("span",null,t("back","Back")))),i().createElement("div",{className:c.divider}),i().createElement("div",{className:c.patientBanner},i().createElement("div",{className:c.patientAvatar},i().createElement(o.PatientPhoto,{patientUuid:e.id,patientName:a})),i().createElement(o.PatientBannerPatientInfo,{patient:e})),i().createElement("div",{className:c.divider}))},d=()=>{let e=(0,r.useParams)(),t=(0,o.usePatient)(e.patientUuid),n=(0,o.useLayoutType)();return t.isLoading?i().createElement(s.OOb,{role:"progressbar",compact:(0,o.isDesktop)(n),zebra:!0}):i().createElement("div",{className:"-esm-appointments__patient-appointments-overview__patientAppointmentsOverview___yVu1O"},i().createElement(u,{patient:t.patient}),i().createElement(l.default,{patientUuid:t.patient.id,launchAppointmentForm:(e,t)=>{(0,o.launchWorkspace2)("appointments-form-workspace",{patientUuid:e,appointment:t})}}),i().createElement(o.WorkspaceContainer,{overlay:!0,contextKey:`patient/${e.patientUuid}`}))}},2845(e,t,n){"use strict";n.d(t,{DM:()=>c,oo:()=>d,yI:()=>u});var a=n(3464),i=n.n(a),s=n(8909),r=n.n(s),o=n(2895),l=n(5602),m=n.n(l);i().extend(m());let p=`${o.restBaseUrl}/appointments/search`;function c(e,t,n){let{data:a,error:s,isLoading:l,isValidating:m,mutate:c}=r()(e?[p,e,t]:null,()=>(0,o.openmrsFetch)(p,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),u=a?.data?.length?a.data:null,d=u?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>i()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),_=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>i()(new Date(e).toISOString()).isAfter(i()().endOf("day"))),h=u?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>i()(new Date(e).toISOString()).isToday());return{data:a?{pastAppointments:d,upcomingAppointments:_,todaysAppointments:h}:null,error:s,isLoading:l,isValidating:m,mutate:c}}let u=async(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=i()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),s=`${o.restBaseUrl}/appointments/${t}/status-change`;return await (0,o.openmrsFetch)(s,{body:{toStatus:e,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},d=async e=>{let t=`${o.restBaseUrl}/appointment?uuid=${e}`,{data:n}=await (0,o.openmrsFetch)(t);return n?.status}}}]);
package/dist/6236.js CHANGED
@@ -1 +1 @@
1
- (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["6236"],{5602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},6199(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>m});var a=n(7125),r=n.n(a),o=n(3464),s=n.n(o),l=n(5921),i=n(411),c=n(2895),p=n(2845);let m=({closeCancelModal:e,appointmentUuid:t,patientUuid:n})=>{let{t:o}=(0,l.useTranslation)(),m=(0,a.useMemo)(()=>s()().subtract(6,"month").toISOString(),[]),{mutate:d}=(0,p.DM)(n,m,(0,a.useMemo)(()=>new AbortController,[])),[u,y]=(0,a.useState)(!1),h=async()=>{y(!0);try{await (0,p.yI)("Cancelled",t),d(),e(),(0,c.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:o("appointmentCancelledSuccessfully","Appointment cancelled successfully"),title:o("appointmentCancelled","Appointment cancelled")})}catch(t){let e=(t?.responseBody?.error?.message||t?.responseBody?.message||t?.message||o("unknownError","An unknown error occurred")).replace(/^\[|\]$/g,"");(0,c.showSnackbar)({title:o("appointmentCancelError","Error cancelling appointment"),kind:"error",isLowContrast:!1,subtitle:e})}finally{y(!1)}};return r().createElement("div",null,r().createElement(i.rQ0,{closeModal:e,title:o("cancelAppointment","Cancel appointment")}),r().createElement(i.cwr,null,r().createElement("p",null,o("cancelAppointmentModalConfirmationText","Are you sure you want to cancel this appointment?"))),r().createElement(i.jlY,null,r().createElement(i.$nd,{kind:"secondary",onClick:e},o("discard","Discard")),r().createElement(i.$nd,{kind:"danger",onClick:h,disabled:u},o("cancelAppointment","Cancel appointment"))))}},2845(e,t,n){"use strict";n.d(t,{DM:()=>m,oo:()=>u,yI:()=>d});var a=n(3464),r=n.n(a),o=n(7364),s=n.n(o),l=n(2895),i=n(5602),c=n.n(i);r().extend(c());let p=`${l.restBaseUrl}/appointments/search`;function m(e,t,n){let{data:a,error:o,isLoading:i,isValidating:c,mutate:m}=s()(e?[p,e,t]:null,()=>(0,l.openmrsFetch)(p,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),d=a?.data?.length?a.data:null,u=d?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>r()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),y=d?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>r()(new Date(e).toISOString()).isAfter(r()().endOf("day"))),h=d?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>r()(new Date(e).toISOString()).isToday());return{data:a?{pastAppointments:u,upcomingAppointments:y,todaysAppointments:h}:null,error:o,isLoading:i,isValidating:c,mutate:m}}let d=async(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=r()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),o=`${l.restBaseUrl}/appointments/${t}/status-change`;return await (0,l.openmrsFetch)(o,{body:{toStatus:e,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},u=async e=>{let t=`${l.restBaseUrl}/appointment?uuid=${e}`,{data:n}=await (0,l.openmrsFetch)(t);return n?.status}}}]);
1
+ (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([["6236"],{5602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},6199(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>m});var a=n(7125),r=n.n(a),o=n(3464),s=n.n(o),l=n(5921),i=n(411),c=n(2895),p=n(2845);let m=({closeCancelModal:e,appointmentUuid:t,patientUuid:n})=>{let{t:o}=(0,l.useTranslation)(),m=(0,a.useMemo)(()=>s()().subtract(6,"month").toISOString(),[]),{mutate:d}=(0,p.DM)(n,m,(0,a.useMemo)(()=>new AbortController,[])),[u,y]=(0,a.useState)(!1),h=async()=>{y(!0);try{await (0,p.yI)("Cancelled",t),d(),e(),(0,c.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:o("appointmentCancelledSuccessfully","Appointment cancelled successfully"),title:o("appointmentCancelled","Appointment cancelled")})}catch(t){let e=(t?.responseBody?.error?.message||t?.responseBody?.message||t?.message||o("unknownError","An unknown error occurred")).replace(/^\[|\]$/g,"");(0,c.showSnackbar)({title:o("appointmentCancelError","Error cancelling appointment"),kind:"error",isLowContrast:!1,subtitle:e})}finally{y(!1)}};return r().createElement("div",null,r().createElement(i.rQ0,{closeModal:e,title:o("cancelAppointment","Cancel appointment")}),r().createElement(i.cwr,null,r().createElement("p",null,o("cancelAppointmentModalConfirmationText","Are you sure you want to cancel this appointment?"))),r().createElement(i.jlY,null,r().createElement(i.$nd,{kind:"secondary",onClick:e},o("discard","Discard")),r().createElement(i.$nd,{kind:"danger",onClick:h,disabled:u},o("cancelAppointment","Cancel appointment"))))}},2845(e,t,n){"use strict";n.d(t,{DM:()=>m,oo:()=>u,yI:()=>d});var a=n(3464),r=n.n(a),o=n(8909),s=n.n(o),l=n(2895),i=n(5602),c=n.n(i);r().extend(c());let p=`${l.restBaseUrl}/appointments/search`;function m(e,t,n){let{data:a,error:o,isLoading:i,isValidating:c,mutate:m}=s()(e?[p,e,t]:null,()=>(0,l.openmrsFetch)(p,{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:{patientUuid:e,startDate:t}})),d=a?.data?.length?a.data:null,u=d?.sort((e,t)=>t.startDateTime>e.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>r()(new Date(e).toISOString()).isBefore(new Date().setHours(0,0,0,0))),y=d?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>r()(new Date(e).toISOString()).isAfter(r()().endOf("day"))),h=d?.sort((e,t)=>e.startDateTime>t.startDateTime?1:-1)?.filter(({status:e})=>"Cancelled"!==e)?.filter(({startDateTime:e})=>r()(new Date(e).toISOString()).isToday());return{data:a?{pastAppointments:u,upcomingAppointments:y,todaysAppointments:h}:null,error:o,isLoading:i,isValidating:c,mutate:m}}let d=async(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone,a=r()(new Date).format("YYYY-MM-DDTHH:mm:ss.SSSZZ"),o=`${l.restBaseUrl}/appointments/${t}/status-change`;return await (0,l.openmrsFetch)(o,{body:{toStatus:e,onDate:a,timeZone:n},method:"POST",headers:{"Content-Type":"application/json"}})},u=async e=>{let t=`${l.restBaseUrl}/appointment?uuid=${e}`,{data:n}=await (0,l.openmrsFetch)(t);return n?.status}}}]);