@openmrs/esm-patient-programs-app 4.0.1-pre.231 → 4.0.1-pre.243

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.
@@ -1,33 +1,33 @@
1
- @openmrs/esm-patient-programs-app:build: cache hit, replaying output 062a358876c878d0
2
- @openmrs/esm-patient-programs-app:build: assets by chunk 927 KiB (id hint: vendors)
3
- @openmrs/esm-patient-programs-app:build:  assets by status 851 KiB [big]
4
- @openmrs/esm-patient-programs-app:build:  asset 396.js 435 KiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
5
- @openmrs/esm-patient-programs-app:build:  asset 858.js 415 KiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
6
- @openmrs/esm-patient-programs-app:build:  asset 206.js 45.4 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
7
- @openmrs/esm-patient-programs-app:build:  asset 709.js 19 KiB [emitted] [minimized] (id hint: vendors)
8
- @openmrs/esm-patient-programs-app:build:  asset 238.js 8.46 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
9
- @openmrs/esm-patient-programs-app:build:  asset 461.js 3.83 KiB [emitted] [minimized] (id hint: vendors)
10
- @openmrs/esm-patient-programs-app:build: + 12 assets
11
- @openmrs/esm-patient-programs-app:build: orphan modules 3.88 MiB [orphan] 734 modules
12
- @openmrs/esm-patient-programs-app:build: runtime modules 40.1 KiB 28 modules
13
- @openmrs/esm-patient-programs-app:build: built modules 3.08 MiB (javascript) 294 bytes (consume-shared) 252 bytes (share-init) [built]
14
- @openmrs/esm-patient-programs-app:build:  modules by path ../../node_modules/ 2.97 MiB 87 modules
15
- @openmrs/esm-patient-programs-app:build:  modules by path ./ 49 KiB 11 modules
16
- @openmrs/esm-patient-programs-app:build:  consume-shared-module modules 294 bytes
17
- @openmrs/esm-patient-programs-app:build:  modules by path consume shared module (default) @openmrs/ 126 bytes 3 modules
18
- @openmrs/esm-patient-programs-app:build:  + 4 modules
19
- @openmrs/esm-patient-programs-app:build:  provide-module modules 252 bytes
20
- @openmrs/esm-patient-programs-app:build:  modules by path provide shared module (default) @openmrs/ 84 bytes 2 modules
21
- @openmrs/esm-patient-programs-app:build:  + 4 modules
22
- @openmrs/esm-patient-programs-app:build:  modules by path ../esm-patient-common-lib/src/ 69.5 KiB
23
- @openmrs/esm-patient-programs-app:build:  ../esm-patient-common-lib/src/index.ts + 31 modules 58.7 KiB [built] [code generated]
24
- @openmrs/esm-patient-programs-app:build:  + 5 modules
25
- @openmrs/esm-patient-programs-app:build:  container entry 42 bytes [built] [code generated]
26
- @openmrs/esm-patient-programs-app:build: 
27
- @openmrs/esm-patient-programs-app:build: WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
28
- @openmrs/esm-patient-programs-app:build: This can impact web performance.
29
- @openmrs/esm-patient-programs-app:build: Assets:
30
- @openmrs/esm-patient-programs-app:build:  858.js (415 KiB)
31
- @openmrs/esm-patient-programs-app:build:  396.js (435 KiB)
32
- @openmrs/esm-patient-programs-app:build: 
33
- @openmrs/esm-patient-programs-app:build: webpack 5.74.0 compiled with 1 warning in 96685 ms
1
+ @openmrs/esm-patient-programs-app:build: cache hit, replaying output 38635682c6251cc0
2
+ @openmrs/esm-patient-programs-app:build: assets by chunk 927 KiB (id hint: vendors)
3
+ @openmrs/esm-patient-programs-app:build:  assets by status 851 KiB [big]
4
+ @openmrs/esm-patient-programs-app:build:  asset 396.js 435 KiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
5
+ @openmrs/esm-patient-programs-app:build:  asset 858.js 415 KiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
6
+ @openmrs/esm-patient-programs-app:build:  asset 206.js 45.4 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
7
+ @openmrs/esm-patient-programs-app:build:  asset 709.js 19 KiB [emitted] [minimized] (id hint: vendors)
8
+ @openmrs/esm-patient-programs-app:build:  asset 238.js 8.46 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
9
+ @openmrs/esm-patient-programs-app:build:  asset 461.js 3.83 KiB [emitted] [minimized] (id hint: vendors)
10
+ @openmrs/esm-patient-programs-app:build: + 12 assets
11
+ @openmrs/esm-patient-programs-app:build: orphan modules 3.88 MiB [orphan] 734 modules
12
+ @openmrs/esm-patient-programs-app:build: runtime modules 40.1 KiB 28 modules
13
+ @openmrs/esm-patient-programs-app:build: built modules 3.08 MiB (javascript) 294 bytes (consume-shared) 252 bytes (share-init) [built]
14
+ @openmrs/esm-patient-programs-app:build:  modules by path ../../node_modules/ 2.97 MiB 87 modules
15
+ @openmrs/esm-patient-programs-app:build:  modules by path ./ 49.1 KiB 11 modules
16
+ @openmrs/esm-patient-programs-app:build:  consume-shared-module modules 294 bytes
17
+ @openmrs/esm-patient-programs-app:build:  modules by path consume shared module (default) @openmrs/ 126 bytes 3 modules
18
+ @openmrs/esm-patient-programs-app:build:  + 4 modules
19
+ @openmrs/esm-patient-programs-app:build:  provide-module modules 252 bytes
20
+ @openmrs/esm-patient-programs-app:build:  modules by path provide shared module (default) @openmrs/ 84 bytes 2 modules
21
+ @openmrs/esm-patient-programs-app:build:  + 4 modules
22
+ @openmrs/esm-patient-programs-app:build:  modules by path ../esm-patient-common-lib/src/ 69.5 KiB
23
+ @openmrs/esm-patient-programs-app:build:  ../esm-patient-common-lib/src/index.ts + 31 modules 58.7 KiB [built] [code generated]
24
+ @openmrs/esm-patient-programs-app:build:  + 5 modules
25
+ @openmrs/esm-patient-programs-app:build:  container entry 42 bytes [built] [code generated]
26
+ @openmrs/esm-patient-programs-app:build: 
27
+ @openmrs/esm-patient-programs-app:build: WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
28
+ @openmrs/esm-patient-programs-app:build: This can impact web performance.
29
+ @openmrs/esm-patient-programs-app:build: Assets:
30
+ @openmrs/esm-patient-programs-app:build:  858.js (415 KiB)
31
+ @openmrs/esm-patient-programs-app:build:  396.js (435 KiB)
32
+ @openmrs/esm-patient-programs-app:build: 
33
+ @openmrs/esm-patient-programs-app:build: webpack 5.74.0 compiled with 1 warning in 135920 ms
package/dist/641.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[641],{6983:(e,r,t)=>{t.d(r,{Z:()=>i});var n=t(9601),a=t.n(n),o=t(2609),l=t.n(o)()(a());l.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__programs-overview__widgetCard___W1HJv{border:1px solid #e0e0e0}",""]),l.locals={widgetCard:"-esm-patient-programs__programs-overview__widgetCard___W1HJv"};const i=l},7641:(e,r,t)=>{t.r(r),t.d(r,{default:()=>Z});var n=t(7900),a=t.n(n),o=t(4924),l=t(5573),i=t(5922),s=t(6759),d=t(3771),c=t(3066),u=t(4076),m=t(6039);function p(){return p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)}const g=function(e){var r=e.enrollment,t=(0,o.useTranslation)().t,n="eligible"===r.enrollmentStatus?r.enrollmentFormUuid:r.discontinuationFormUuid,l=function(e){d.formEntrySub.next({formUuid:n,encounterUuid:""}),(0,d.launchPatientWorkspace)("patient-form-entry-workspace",{workspaceTitle:"".concat(null==r?void 0:r.display," ").concat(e," Form")})};return"eligible"===r.enrollmentStatus?a().createElement(i.zxk,{onClick:function(){return l(t("enrollment","Enrollment"))},renderIcon:function(e){return a().createElement(m.sQ,p({size:20},e))},kind:"tertiary",size:"small"},t("enroll","Enroll")):a().createElement(i.zxk,{onClick:function(){return l(t("discontinue","Discontinue"))},renderIcon:function(e){return a().createElement(m.sQ,p({size:20},e))},kind:"danger--ghost",size:"small"},t("discontinue","Discontinue"))};var v=t(6062),f=t.n(v),b=t(4036),h=t.n(b),E=t(6793),y=t.n(E),P=t(7892),w=t.n(P),O=t(1173),k=t.n(O),C=t(2464),_=t.n(C),S=t(6983),j={};j.styleTagTransform=_(),j.setAttributes=w(),j.insert=y().bind(null,"head"),j.domAPI=h(),j.insertStyleElement=k(),f()(S.Z,j);const T=S.Z&&S.Z.locals?S.Z.locals:void 0;function D(){return D=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},D.apply(this,arguments)}const Z=function(e){var r,t,n=e.basePath,m=e.patientUuid,p=(0,o.useTranslation)().t,v=(0,c.useConfig)(),f=p("programs","Program enrollments"),b=p("carePrograms","Care Programs"),h=p("seeAll","See all"),E=window.spaBase+n+"/programs",y=!!v.customUrl,P=(0,u.b$)(m),w=P.activeEnrollments,O=P.availablePrograms,k=P.configurablePrograms,C=P.eligiblePrograms,_=P.enrollments,S=P.isError,j=P.isLoading,Z=P.isValidating,L=(0,c.usePagination)(y?k:null!=_?_:[],5),F=L.results,z=L.goTo,x=L.currentPage,A=a().useCallback((function(){return(0,d.launchPatientWorkspace)("programs-form-workspace")}),[]),U=[{key:"display",header:p("activePrograms","Active programs")},{key:"location",header:p("location","Location")},{key:"dateEnrolled",header:p("dateEnrolled","Date enrolled")},{key:"status",header:p("status","Status")},{key:"actions",header:p("actions","Actions")}],H=a().useMemo((function(){return null==F?void 0:F.map((function(e){var r;return{id:e.uuid,display:e.display,location:null===(r=e.location)||void 0===r?void 0:r.display,dateEnrolled:e.dateEnrolled?(0,c.formatDatetime)(new Date(e.dateEnrolled)):"--",status:y?(0,l.Z)(e.enrollmentStatus):e.dateCompleted?"".concat(p("completedOn","Completed On")," ").concat((0,c.formatDate)(new Date(e.dateCompleted))):p("active","Active"),actions:a().createElement(g,{enrollment:e})}}))}),[y,F,p]);return j?a().createElement(i.gqd,{role:"progressbar"}):S?a().createElement(d.ErrorState,{error:S,headerTitle:b}):(y?k.length:null==w?void 0:w.length)?a().createElement("div",{className:T.widgetCard},a().createElement(d.CardHeader,{title:b},a().createElement("span",null,Z?a().createElement(i.lSo,null):null),a().createElement(i.zxk,{kind:"ghost",renderIcon:function(e){return a().createElement(s.mm,D({size:16},e))},iconDescription:"Add programs",onClick:A,disabled:(null==O?void 0:O.length)&&0===(null==C?void 0:C.length)},p("add","Add"))),(null==O?void 0:O.length)&&0===(null==C?void 0:C.length)&&a().createElement(i.K0D,{style:{minWidth:"100%",margin:"0rem",padding:"0rem"},kind:"info",lowContrast:!0,subtitle:p("noEligibleEnrollments","There are no more programs left to enroll this patient in"),title:p("fullyEnrolled","Enrolled in all programs")}),a().createElement(i.wQF,{rows:H,headers:U,isSortable:!0,size:"sm",useZebraStyles:!0},(function(e){var n=e.rows,o=e.headers,l=e.getHeaderProps,s=e.getTableProps;return a().createElement(i.xJi,null,a().createElement(i.iA_,D({},s()),a().createElement(i.ssF,null,a().createElement(i.SCH,null,o.map((function(e){var t;return a().createElement(i.xDH,D({className:"".concat(T.productiveHeading01," ").concat(T.text02)},l({header:e,isSortable:e.isSortable})),null!==(r=null===(t=e.header)||void 0===t?void 0:t.content)&&void 0!==r?r:e.header)})))),a().createElement(i.RMI,null,n.map((function(e){return a().createElement(i.SCH,{key:e.id},e.cells.map((function(e){var r;return a().createElement(i.pj1,{key:e.id},null!==(t=null===(r=e.value)||void 0===r?void 0:r.content)&&void 0!==t?t:e.value)})))})))))})),a().createElement(d.PatientChartPagination,{currentItems:F.length,onPageNumberChange:function(e){var r=e.page;return z(r)},pageNumber:x,pageSize:5,totalItems:y?k.length:null==_?void 0:_.length,dashboardLinkUrl:E,dashboardLinkLabel:h})):a().createElement(d.EmptyState,{displayText:f,headerTitle:b,launchForm:A})}},4076:(e,r,t)=>{t.d(r,{Bw:()=>u,YX:()=>g,b$:()=>v,df:()=>p,o9:()=>c,oI:()=>m});var n=t(9857),a=t(3066),o=t(4200),l=t(3863),i=t(8827),s=t(819);function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var c="custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display))";function u(e){var r,t=(0,n.ZP)("/ws/rest/v1/programenrollment?patient=".concat(e,"&v=").concat(c),a.openmrsFetch),l=t.data,i=t.error,s=t.isValidating,d=(null==l||null===(r=l.data)||void 0===r?void 0:r.results.length)>0?null==l?void 0:l.data.results.sort((function(e,r){return r.dateEnrolled>e.dateEnrolled?1:-1})):null,u=null==d?void 0:d.filter((function(e){return!e.dateCompleted}));return{data:l?(0,o.Z)(d,(function(e){var r;return null==e||null===(r=e.program)||void 0===r?void 0:r.uuid})):null,isError:i,isLoading:!l&&!i,isValidating:s,activeEnrollments:u}}function m(e){var r,t,o=(0,n.ZP)("/ws/rest/v1/program?v=custom:(uuid,display,allWorkflows,concept:(uuid,display))",a.openmrsFetch),d=o.data,c=o.error,u=null!==(t=null==d||null===(r=d.data)||void 0===r?void 0:r.results)&&void 0!==t?t:null;return{data:u,isError:c,isLoading:!d&&!c,eligiblePrograms:(0,l.Z)(u,(function(r){return!(0,i.Z)((0,s.Z)(e,"program.uuid"),r.uuid)}))}}function p(e,r){if(!e)return null;var t=e.program,n=e.patient,o=e.dateEnrolled,l=e.dateCompleted,i=e.location;return(0,a.openmrsObservableFetch)("/ws/rest/v1/programenrollment",{method:"POST",headers:{"Content-Type":"application/json"},body:{program:t,patient:n,dateEnrolled:o,dateCompleted:l,location:i},signal:r.signal})}function g(e,r,t){if(!r&&!r.program)return null;r.program;var n=r.dateEnrolled,o=r.dateCompleted,l=r.location;return(0,a.openmrsObservableFetch)("/ws/rest/v1/programenrollment/".concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:{dateEnrolled:n,dateCompleted:o,location:l},signal:t.signal})}var v=function(e){var r,t,o=(0,a.useConfig)().customUrl,l=u(e),i=l.data,s=l.isError,c=l.isLoading,p=l.isValidating,g=l.activeEnrollments,v=m(i),f=v.data,b=v.eligiblePrograms,h=function(e){var r,t=(0,a.useConfig)().customUrl,o=(0,n.ZP)(t?"".concat(t).concat(e):null,a.openmrsFetch),l=o.data,i=o.error;return{configurablePrograms:null!==(r=null==l?void 0:l.data)&&void 0!==r?r:[],isLoading:!l&&!i,error:i}}(e),E=h.configurablePrograms,y=h.isLoading,P=h.error;return r=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){d(e,r,t[r])}))}return e}({enrollments:i},o?{isLoading:y,isError:P}:{isLoading:c,isError:s}),t=null!=(t={isValidating:p,activeEnrollments:g,availablePrograms:f,eligiblePrograms:b,configurablePrograms:E})?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})),r}}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[641],{6983:(e,r,t)=>{t.d(r,{Z:()=>i});var n=t(9601),o=t.n(n),a=t(2609),l=t.n(a)()(o());l.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__programs-overview__widgetCard___W1HJv{border:1px solid #e0e0e0}",""]),l.locals={widgetCard:"-esm-patient-programs__programs-overview__widgetCard___W1HJv"};const i=l},7641:(e,r,t)=>{t.r(r),t.d(r,{default:()=>Z});var n=t(7900),o=t.n(n),a=t(4924),l=t(5573),i=t(5922),s=t(6759),d=t(3771),c=t(3066),u=t(4076),m=t(6039);function p(){return p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)}const g=function(e){var r=e.enrollment,t=(0,a.useTranslation)().t,n="eligible"===r.enrollmentStatus?r.enrollmentFormUuid:r.discontinuationFormUuid,l=function(e){d.formEntrySub.next({formUuid:n,encounterUuid:""}),(0,d.launchPatientWorkspace)("patient-form-entry-workspace",{workspaceTitle:"".concat(null==r?void 0:r.display," ").concat(e," Form")})};return"eligible"===r.enrollmentStatus?o().createElement(i.zxk,{iconDescription:"Enroll to program",onClick:function(){return l(t("enrollment","Enrollment"))},renderIcon:function(e){return o().createElement(m.sQ,p({size:20},e))},kind:"tertiary",size:"sm"},t("enroll","Enroll")):o().createElement(i.zxk,{iconDescription:"Discontinue enrollment",onClick:function(){return l(t("discontinue","Discontinue"))},renderIcon:function(e){return o().createElement(m.sQ,p({size:20},e))},kind:"danger--ghost",size:"sm"},t("discontinue","Discontinue"))};var v=t(6062),f=t.n(v),b=t(4036),E=t.n(b),h=t(6793),y=t.n(h),P=t(7892),w=t.n(P),O=t(1173),k=t.n(O),C=t(2464),_=t.n(C),S=t(6983),j={};j.styleTagTransform=_(),j.setAttributes=w(),j.insert=y().bind(null,"head"),j.domAPI=E(),j.insertStyleElement=k(),f()(S.Z,j);const D=S.Z&&S.Z.locals?S.Z.locals:void 0;function T(){return T=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},T.apply(this,arguments)}const Z=function(e){var r,t,n=e.basePath,m=e.patientUuid,p=(0,a.useTranslation)().t,v=(0,c.useConfig)(),f=p("programs","Program enrollments"),b=p("carePrograms","Care Programs"),E=p("seeAll","See all"),h=window.spaBase+n+"/programs",y=!!v.customUrl,P=(0,u.b$)(m),w=P.activeEnrollments,O=P.availablePrograms,k=P.configurablePrograms,C=P.eligiblePrograms,_=P.enrollments,S=P.isError,j=P.isLoading,Z=P.isValidating,L=(0,c.usePagination)(y?k:null!=_?_:[],5),F=L.results,z=L.goTo,x=L.currentPage,A=o().useCallback((function(){return(0,d.launchPatientWorkspace)("programs-form-workspace")}),[]),U=[{key:"display",header:p("activePrograms","Active programs")},{key:"location",header:p("location","Location")},{key:"dateEnrolled",header:p("dateEnrolled","Date enrolled")},{key:"status",header:p("status","Status")},{key:"actions",header:p("actions","Actions")}],H=o().useMemo((function(){return null==F?void 0:F.map((function(e){var r;return{id:e.uuid,display:e.display,location:null===(r=e.location)||void 0===r?void 0:r.display,dateEnrolled:e.dateEnrolled?(0,c.formatDatetime)(new Date(e.dateEnrolled)):"--",status:y?(0,l.Z)(e.enrollmentStatus):e.dateCompleted?"".concat(p("completedOn","Completed On")," ").concat((0,c.formatDate)(new Date(e.dateCompleted))):p("active","Active"),actions:o().createElement(g,{enrollment:e})}}))}),[y,F,p]);return j?o().createElement(i.gqd,{role:"progressbar"}):S?o().createElement(d.ErrorState,{error:S,headerTitle:b}):(y?k.length:null==w?void 0:w.length)?o().createElement("div",{className:D.widgetCard},o().createElement(d.CardHeader,{title:b},o().createElement("span",null,Z?o().createElement(i.lSo,null):null),o().createElement(i.zxk,{kind:"ghost",renderIcon:function(e){return o().createElement(s.mm,T({size:16},e))},iconDescription:"Add programs",onClick:A,disabled:(null==O?void 0:O.length)&&0===(null==C?void 0:C.length)},p("add","Add"))),(null==O?void 0:O.length)&&0===(null==C?void 0:C.length)&&o().createElement(i.K0D,{style:{minWidth:"100%",margin:"0rem",padding:"0rem"},kind:"info",lowContrast:!0,subtitle:p("noEligibleEnrollments","There are no more programs left to enroll this patient in"),title:p("fullyEnrolled","Enrolled in all programs")}),o().createElement(i.wQF,{rows:H,headers:U,isSortable:!0,size:"sm",useZebraStyles:!0},(function(e){var n=e.rows,a=e.headers,l=e.getHeaderProps,s=e.getTableProps;return o().createElement(i.xJi,null,o().createElement(i.iA_,T({},s()),o().createElement(i.ssF,null,o().createElement(i.SCH,null,a.map((function(e){var t;return o().createElement(i.xDH,T({className:"".concat(D.productiveHeading01," ").concat(D.text02)},l({header:e,isSortable:e.isSortable})),null!==(r=null===(t=e.header)||void 0===t?void 0:t.content)&&void 0!==r?r:e.header)})))),o().createElement(i.RMI,null,n.map((function(e){return o().createElement(i.SCH,{key:e.id},e.cells.map((function(e){var r;return o().createElement(i.pj1,{key:e.id},null!==(t=null===(r=e.value)||void 0===r?void 0:r.content)&&void 0!==t?t:e.value)})))})))))})),o().createElement(d.PatientChartPagination,{currentItems:F.length,onPageNumberChange:function(e){var r=e.page;return z(r)},pageNumber:x,pageSize:5,totalItems:y?k.length:null==_?void 0:_.length,dashboardLinkUrl:h,dashboardLinkLabel:E})):o().createElement(d.EmptyState,{displayText:f,headerTitle:b,launchForm:A})}},4076:(e,r,t)=>{t.d(r,{Bw:()=>u,YX:()=>g,b$:()=>v,df:()=>p,o9:()=>c,oI:()=>m});var n=t(9857),o=t(3066),a=t(4200),l=t(3863),i=t(8827),s=t(819);function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var c="custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display))";function u(e){var r,t=(0,n.ZP)("/ws/rest/v1/programenrollment?patient=".concat(e,"&v=").concat(c),o.openmrsFetch),l=t.data,i=t.error,s=t.isValidating,d=(null==l||null===(r=l.data)||void 0===r?void 0:r.results.length)>0?null==l?void 0:l.data.results.sort((function(e,r){return r.dateEnrolled>e.dateEnrolled?1:-1})):null,u=null==d?void 0:d.filter((function(e){return!e.dateCompleted}));return{data:l?(0,a.Z)(d,(function(e){var r;return null==e||null===(r=e.program)||void 0===r?void 0:r.uuid})):null,isError:i,isLoading:!l&&!i,isValidating:s,activeEnrollments:u}}function m(e){var r,t,a=(0,n.ZP)("/ws/rest/v1/program?v=custom:(uuid,display,allWorkflows,concept:(uuid,display))",o.openmrsFetch),d=a.data,c=a.error,u=null!==(t=null==d||null===(r=d.data)||void 0===r?void 0:r.results)&&void 0!==t?t:null;return{data:u,isError:c,isLoading:!d&&!c,eligiblePrograms:(0,l.Z)(u,(function(r){return!(0,i.Z)((0,s.Z)(e,"program.uuid"),r.uuid)}))}}function p(e,r){if(!e)return null;var t=e.program,n=e.patient,a=e.dateEnrolled,l=e.dateCompleted,i=e.location;return(0,o.openmrsObservableFetch)("/ws/rest/v1/programenrollment",{method:"POST",headers:{"Content-Type":"application/json"},body:{program:t,patient:n,dateEnrolled:a,dateCompleted:l,location:i},signal:r.signal})}function g(e,r,t){if(!r&&!r.program)return null;r.program;var n=r.dateEnrolled,a=r.dateCompleted,l=r.location;return(0,o.openmrsObservableFetch)("/ws/rest/v1/programenrollment/".concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:{dateEnrolled:n,dateCompleted:a,location:l},signal:t.signal})}var v=function(e){var r,t,a=(0,o.useConfig)().customUrl,l=u(e),i=l.data,s=l.isError,c=l.isLoading,p=l.isValidating,g=l.activeEnrollments,v=m(i),f=v.data,b=v.eligiblePrograms,E=function(e){var r,t=(0,o.useConfig)().customUrl,a=(0,n.ZP)(t?"".concat(t).concat(e):null,o.openmrsFetch),l=a.data,i=a.error;return{configurablePrograms:null!==(r=null==l?void 0:l.data)&&void 0!==r?r:[],isLoading:!l&&!i,error:i}}(e),h=E.configurablePrograms,y=E.isLoading,P=E.error;return r=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){d(e,r,t[r])}))}return e}({enrollments:i},a?{isLoading:y,isError:P}:{isLoading:c,isError:s}),t=null!=(t={isValidating:p,activeEnrollments:g,availablePrograms:f,eligiblePrograms:b,configurablePrograms:h})?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})),r}}}]);
@@ -244,9 +244,9 @@
244
244
  "initial": false,
245
245
  "entry": false,
246
246
  "recorded": false,
247
- "size": 20257,
247
+ "size": 20352,
248
248
  "sizes": {
249
- "javascript": 20257
249
+ "javascript": 20352
250
250
  },
251
251
  "names": [],
252
252
  "idHints": [],
@@ -258,7 +258,7 @@
258
258
  "641.js"
259
259
  ],
260
260
  "auxiliaryFiles": [],
261
- "hash": "b16466245b4bf0141043",
261
+ "hash": "86ab534df8b1ae463fb3",
262
262
  "childrenByOrder": {}
263
263
  },
264
264
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-programs-app",
3
- "version": "4.0.1-pre.231",
3
+ "version": "4.0.1-pre.243",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Patient programs microfrontend for the OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-patient-programs-app.js",
@@ -34,8 +34,8 @@
34
34
  "url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@carbon/react": "^1.8.0",
38
- "@openmrs/esm-patient-common-lib": "^4.0.1-pre.231",
37
+ "@carbon/react": "^1.9.0",
38
+ "@openmrs/esm-patient-common-lib": "^4.0.1-pre.243",
39
39
  "d3": "^7.0.3",
40
40
  "lodash-es": "^4.17.15"
41
41
  },
@@ -48,5 +48,5 @@
48
48
  "react-router-dom": "6.x",
49
49
  "rxjs": "6.x"
50
50
  },
51
- "gitHead": "a1fa2458394ff2206ae89aa5d01c7d108194b56d"
51
+ "gitHead": "bb74ac0e3268ac77ed4826c721eeda14ccc3c731"
52
52
  }
@@ -23,21 +23,24 @@ const ProgramActionButton: React.FC<ProgramActionButton> = ({ enrollment }) => {
23
23
  if (enrollment.enrollmentStatus === 'eligible') {
24
24
  return (
25
25
  <Button
26
+ iconDescription="Enroll to program"
26
27
  onClick={() => launchEnrollmentForm(t('enrollment', 'Enrollment'))}
27
28
  renderIcon={(props) => <TaskAdd size={20} {...props} />}
28
29
  kind="tertiary"
29
- size="small"
30
+ size="sm"
30
31
  >
31
32
  {t('enroll', 'Enroll')}
32
33
  </Button>
33
34
  );
34
35
  }
36
+
35
37
  return (
36
38
  <Button
39
+ iconDescription="Discontinue enrollment"
37
40
  onClick={() => launchEnrollmentForm(t('discontinue', 'Discontinue'))}
38
41
  renderIcon={(props) => <TaskAdd size={20} {...props} />}
39
42
  kind="danger--ghost"
40
- size="small"
43
+ size="sm"
41
44
  >
42
45
  {t('discontinue', 'Discontinue')}
43
46
  </Button>