@openmrs/esm-patient-programs-app 4.0.1-pre.262 → 4.0.1-pre.268

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 82f45829e3ab6779
2
- @openmrs/esm-patient-programs-app:build: assets by chunk 919 KiB (id hint: vendors)
3
- @openmrs/esm-patient-programs-app:build:  assets by status 842 KiB [big]
4
- @openmrs/esm-patient-programs-app:build:  asset 734.js 435 KiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
5
- @openmrs/esm-patient-programs-app:build:  asset 858.js 407 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.96 MiB 87 modules
15
- @openmrs/esm-patient-programs-app:build:  modules by path ./ 49.2 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/ 73.1 KiB
23
- @openmrs/esm-patient-programs-app:build:  ../esm-patient-common-lib/src/index.ts + 31 modules 62.3 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 (407 KiB)
31
- @openmrs/esm-patient-programs-app:build:  734.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 109297 ms
1
+ @openmrs/esm-patient-programs-app:build: cache hit, replaying output 0b593cc2c8f970a4
2
+ @openmrs/esm-patient-programs-app:build: assets by chunk 919 KiB (id hint: vendors)
3
+ @openmrs/esm-patient-programs-app:build:  assets by status 842 KiB [big]
4
+ @openmrs/esm-patient-programs-app:build:  asset 734.js 435 KiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
5
+ @openmrs/esm-patient-programs-app:build:  asset 858.js 407 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.96 MiB 87 modules
15
+ @openmrs/esm-patient-programs-app:build:  modules by path ./ 52.4 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/ 75.2 KiB
23
+ @openmrs/esm-patient-programs-app:build:  ../esm-patient-common-lib/src/index.ts + 31 modules 64.4 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 (407 KiB)
31
+ @openmrs/esm-patient-programs-app:build:  734.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 24924 ms
package/dist/402.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[402],{7904:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__card-header__desktopHeader___BUQ5I,.-esm-patient-programs__card-header__tabletHeader___efA_M{display:flex;justify-content:space-between;align-items:center;padding:.75rem 0 .75rem 1rem;background-color:#fff}.-esm-patient-programs__card-header__desktopHeader___BUQ5I h4:after,.-esm-patient-programs__card-header__tabletHeader___efA_M h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__card-header__desktopHeader___BUQ5I{height:3rem}.-esm-patient-programs__card-header__desktopHeader___BUQ5I h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-programs__card-header__tabletHeader___efA_M{height:4.5rem}.-esm-patient-programs__card-header__tabletHeader___efA_M h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}',""]),i.locals={desktopHeader:"-esm-patient-programs__card-header__desktopHeader___BUQ5I",tabletHeader:"-esm-patient-programs__card-header__tabletHeader___efA_M"};const s=i},7942:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.active-left-nav-link .-esm-patient-programs__dashboardextension__link___lom8t:nth-child(1){color:#161616;padding:1.2rem 0 1.2rem 1.2rem}",""]),i.locals={link:"-esm-patient-programs__dashboardextension__link___lom8t"};const s=i},7431:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__empty-state__action___xInzb{margin-bottom:.5rem}.-esm-patient-programs__empty-state__content___lACIK{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-patient-programs__empty-state__desktopHeading___UIGID h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-programs__empty-state__tabletHeading___lVXqD h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.-esm-patient-programs__empty-state__desktopHeading___UIGID,.-esm-patient-programs__empty-state__tabletHeading___lVXqD{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-patient-programs__empty-state__desktopHeading___UIGID h4:after,.-esm-patient-programs__empty-state__tabletHeading___lVXqD h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__empty-state__heading___gW4Bc:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__empty-state__tile___DvfL3{text-align:center;border:1px solid #e0e0e0}',""]),i.locals={action:"-esm-patient-programs__empty-state__action___xInzb",content:"-esm-patient-programs__empty-state__content___lACIK",desktopHeading:"-esm-patient-programs__empty-state__desktopHeading___UIGID",tabletHeading:"-esm-patient-programs__empty-state__tabletHeading___lVXqD",heading:"-esm-patient-programs__empty-state__heading___gW4Bc",tile:"-esm-patient-programs__empty-state__tile___DvfL3"};const s=i},418:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__error-state__errorMessage___kDICS{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-top:2.25rem;margin-bottom:.5rem}.-esm-patient-programs__error-state__errorCopy___UX21v{margin-bottom:.5rem;font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:#525252}.-esm-patient-programs__error-state__desktopHeading___Bhvtx h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-programs__error-state__tabletHeading___EAqy2 h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.-esm-patient-programs__error-state__desktopHeading___Bhvtx,.-esm-patient-programs__error-state__tabletHeading___EAqy2{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-patient-programs__error-state__desktopHeading___Bhvtx h4:after,.-esm-patient-programs__error-state__tabletHeading___EAqy2 h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__error-state__tile___LTdVO{text-align:center;border:1px solid #e0e0e0}',""]),i.locals={errorMessage:"-esm-patient-programs__error-state__errorMessage___kDICS",errorCopy:"-esm-patient-programs__error-state__errorCopy___UX21v",desktopHeading:"-esm-patient-programs__error-state__desktopHeading___Bhvtx",tabletHeading:"-esm-patient-programs__error-state__tabletHeading___EAqy2",tile:"-esm-patient-programs__error-state__tile___LTdVO"};const s=i},8952:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__pagination__bodyShort01____zD39,.-esm-patient-programs__pagination__configurableLink___JhehZ{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px)}.-esm-patient-programs__pagination__desktop___TGt17,.-esm-patient-programs__pagination__tablet___BEzP7{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);display:flex;border-top:1px solid #e0e0e0;justify-content:space-between;color:#525252;background-color:#fff;padding-left:1rem;align-items:center}.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination{min-height:0rem;height:2rem;width:auto;border:none}.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination .cds--select-input,.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination .cds--btn,.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination .cds--pagination__right{min-height:0rem;height:2rem}.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination{min-height:0rem;height:3rem;width:auto;border:none}.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination .cds--select-input,.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination .cds--btn,.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination .cds--pagination__right{min-height:0rem;height:3rem}.-esm-patient-programs__pagination__configurableLink___JhehZ{text-decoration:none;padding:0 .5rem}.-esm-patient-programs__pagination__pagination___B09B8{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);background-color:#fff;color:#525252;display:flex}div.-esm-patient-programs__pagination__pagination___B09B8>.cds--pagination__left{display:none}",""]),i.locals={bodyShort01:"-esm-patient-programs__pagination__bodyShort01____zD39",configurableLink:"-esm-patient-programs__pagination__configurableLink___JhehZ",desktop:"-esm-patient-programs__pagination__desktop___TGt17",tablet:"-esm-patient-programs__pagination__tablet___BEzP7",pagination:"-esm-patient-programs__pagination__pagination___B09B8"};const s=i},9402:(e,t,r)=>{r.r(t),r.d(t,{CardHeader:()=>w,DashboardExtension:()=>F,DashboardGroupExtension:()=>H,EmptyDataIllustration:()=>E,EmptyState:()=>C,ErrorState:()=>O,PatientChartPagination:()=>J,WorkspaceWindowSizeProvider:()=>He,cancelPrompt:()=>ve,changeWorkspaceContext:()=>we,closeAllWorkspaces:()=>be,closeWorkspace:()=>ye,convertTime12to24:()=>Y,createDashboardGroup:()=>L,createDashboardLink:()=>V,createOfflineVisitForPatient:()=>rt,formEntrySub:()=>ne,getOfflineVisitForPatient:()=>et,getPromptBeforeClosingFcn:()=>he,getWorkspaceStore:()=>ke,launchPatientChartWithWorkspaceOpen:()=>_e,launchPatientWorkspace:()=>me,launchStartVisitPrompt:()=>G,patientRegistrationSyncType:()=>Fe,promptBeforeClosing:()=>ge,registerNavGroup:()=>M,registerWorkspace:()=>ue,resetWorkspaceStore:()=>Ee,useActivePatientEnrollment:()=>je,useAutoCreatedOfflineVisit:()=>Ye,useNavGroups:()=>D,useOfflineVisit:()=>Ke,usePaginationInfo:()=>R,usePatientOrOfflineRegisteredPatient:()=>Ve,useVisitOrOfflineVisit:()=>Je,useVitalsConceptMetadata:()=>te,useWorkspaceWindowSize:()=>Oe,useWorkspaces:()=>Ce,visitSyncType:()=>Xe,withUnit:()=>re});var n=r(268),a=r.n(n),o=r(906),i=r(6062),s=r.n(i),l=r(4036),c=r.n(l),p=r(6793),u=r.n(p),d=r(7892),m=r.n(d),_=r(1173),f=r.n(_),g=r(2464),h=r.n(g),v=r(7904),y={};y.styleTagTransform=h(),y.setAttributes=m(),y.insert=u().bind(null,"head"),y.domAPI=c(),y.insertStyleElement=f(),s()(v.Z,y);const b=v.Z&&v.Z.locals?v.Z.locals:void 0;function w(e){var t=e.title,r=e.children,n="tablet"===(0,o.useLayoutType)();return a().createElement("div",{className:n?b.tabletHeader:b.desktopHeader},a().createElement("h4",null,t),r)}var S=r(7047),k=r(4924),E=function(e){var t=e.width,r=void 0===t?"64":t,n=e.height,o=void 0===n?"64":n;return a().createElement("svg",{width:r,height:o,viewBox:"0 0 64 64"},a().createElement("title",null,"Empty data illustration"),a().createElement("g",{fill:"none",fillRule:"evenodd"},a().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),a().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),a().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),a().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),a().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),a().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),a().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),a().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),a().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),a().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},A=r(7431),z={};z.styleTagTransform=h(),z.setAttributes=m(),z.insert=u().bind(null,"head"),z.domAPI=c(),z.insertStyleElement=f(),s()(A.Z,z);const x=A.Z&&A.Z.locals?A.Z.locals:void 0;var C=function(e){var t=(0,k.useTranslation)().t,r="tablet"===(0,o.useLayoutType)();return a().createElement(S.mh4,null,a().createElement(S.n9L,{className:x.tile},a().createElement("div",{className:r?x.tabletHeading:x.desktopHeading},a().createElement("h4",null,e.headerTitle)),a().createElement(E,null),a().createElement("p",{className:x.content},a().createElement(k.Trans,{i18nKey:"emptyStateText",values:{displayText:e.displayText.toLowerCase()}},"There are no ",e.displayText.toLowerCase()," to display for this patient")),a().createElement("p",{className:x.action},e.launchForm&&a().createElement("span",null,a().createElement(S.rUS,{onClick:function(){return e.launchForm()}},a().createElement(a().Fragment,null,t("record","Record")," ",e.displayText.toLowerCase()))))))},I=r(418),P={};P.styleTagTransform=h(),P.setAttributes=m(),P.insert=u().bind(null,"head"),P.domAPI=c(),P.insertStyleElement=f(),s()(I.Z,P);const T=I.Z&&I.Z.locals?I.Z.locals:void 0;var O=function(e){var t,r,n=e.error,i=e.headerTitle,s=(0,k.useTranslation)().t,l="tablet"===(0,o.useLayoutType)();return a().createElement(S.mh4,null,a().createElement(S.n9L,{className:T.tile},a().createElement("div",{className:l?T.tabletHeading:T.desktopHeading},a().createElement("h4",null,i)),a().createElement("p",{className:T.errorMessage},s("error","Error")," ","".concat(null==n||null===(t=n.response)||void 0===t?void 0:t.status,": "),null==n||null===(r=n.response)||void 0===r?void 0:r.statusText),a().createElement("p",{className:T.errorCopy},s("errorCopy","Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above."))))},H=function(e){var t=e.title,r=e.slotName,i=e.basePath,s=e.isExpanded;return(0,n.useEffect)((function(){M(r)}),[r]),a().createElement(S.UQy,null,a().createElement(S.Qdk,{open:null==s||s,title:t,style:{border:"none"}},a().createElement(o.ExtensionSlot,{extensionSlotName:null!=r?r:t,state:{basePath:i}})))},L=function(e){var t=e.title,r=e.slotName,n=e.isExpanded;return function(e){var o=e.basePath;return a().createElement(H,{title:t,slotName:r,basePath:o,isExpanded:n})}};function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var j=(0,o.createGlobalStore)("nav-groups",{navGroups:[]});function M(e){var t,r=j.getState();j.setState({navGroups:[e].concat((t=r.navGroups,function(e){if(Array.isArray(e))return W(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))})}var D=(0,o.createUseStore)(j),U=r(2228),Z=r(7942),N={};N.styleTagTransform=h(),N.setAttributes=m(),N.insert=u().bind(null,"head"),N.domAPI=c(),N.insertStyleElement=f(),s()(Z.Z,N);const B=Z.Z&&Z.Z.locals?Z.Z.locals:void 0;var F=function(e){var t,r=e.title,i=e.basePath,s=null!==(t=window.location)&&void 0!==t?t:{pathname:""},l=r===(0,n.useMemo)((function(){return decodeURIComponent((0,U.Z)(s.pathname.split("/")))}),[s.pathname])?"active-left-nav-link":"non-active";return a().createElement("div",{key:r,className:l},a().createElement(o.ConfigurableLink,{to:"".concat(i,"/").concat(encodeURIComponent(r)),className:"cds--side-nav__link "+B.link},r))},V=function(e){return function(t){var r=t.basePath;return a().createElement(F,{title:e.title,basePath:r})}};function G(){var e=(0,o.showModal)("start-visit-dialog",{closeModal:function(){return e()}})}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R(e,t,r,a){var o=(0,k.useTranslation)().t,i=(0,n.useMemo)((function(){var r,n=Math.ceil(t/e);return(r=Array(n).keys(),function(e){if(Array.isArray(e))return q(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(t){return(t+1)*e}))}),[e,t]),s=(0,n.useMemo)((function(){return e>t?"".concat(t," / ").concat(t):e*r>t?"".concat(e*(r-1)+a," / ").concat(t):"".concat(e*r," / ").concat(t)}),[e,t,r,a]);return{pageSizes:i,itemsDisplayed:"".concat(s," ").concat(o("items"," items"))}}var $=r(8952),Q={};Q.styleTagTransform=h(),Q.setAttributes=m(),Q.insert=u().bind(null,"head"),Q.domAPI=c(),Q.insertStyleElement=f(),s()($.Z,Q);const X=$.Z&&$.Z.locals?$.Z.locals:void 0;var J=function(e){var t=e.totalItems,r=e.pageSize,n=e.onPageNumberChange,i=e.pageNumber,s=e.dashboardLinkUrl,l=e.currentItems,c=e.dashboardLinkLabel,p=(0,k.useTranslation)().t,u=R(r,t,i,l),d=u.itemsDisplayed,m=u.pageSizes,_="tablet"===(0,o.useLayoutType)();return a().createElement(a().Fragment,null,t>0&&a().createElement("div",{className:_?X.tablet:X.desktop},a().createElement("div",null,d,s&&a().createElement(o.ConfigurableLink,{to:s,className:X.configurableLink},null!=c?c:p("seeAll","See all"))),a().createElement(S.tlE,{className:X.pagination,page:i,pageSize:r,pageSizes:m,totalItems:t,onChange:n,size:_?"lg":"sm"})))};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Y=function(e,t){var r,n,a=(r=e.split(":"),n=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(r,n)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=a[0],i=a[1];return"12"===o&&"AM"===t&&(o="00"),"PM"===t&&(o="12"===o?o:parseInt(o,10)+12),[o,i]},ee=r(2303);function te(){var e,t,r="/ws/rest/v1/concept/?q=VITALS SIGNS&v=".concat("custom:(setMembers:(uuid,display,hiNormal,hiAbsolute,hiCritical,lowNormal,lowAbsolute,lowCritical,units))"),n=(0,ee.Z)(r,o.openmrsFetch),a=n.data,i=n.error,s=null===(t=null==a||null===(e=a.data)||void 0===e?void 0:e.results[0])||void 0===t?void 0:t.setMembers;return{data:(null==s?void 0:s.length)?new Map(s.map((function(e){return[e.uuid,e.units]}))):new Map([]),isError:i,isLoading:!a&&!i,conceptMetadata:s}}var re=function(e,t){return"".concat(e," ").concat(t?"(".concat(t,")"):"")},ne=new(r(2444).BehaviorSubject)(null),ae=r(6081);function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ie(e,t,r[t])}))}return e}function le(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function ce(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pe={};function ue(e){var t,r;pe[e.name]=le(se({},e),{preferredWindowSize:null!==(t=e.preferredWindowSize)&&void 0!==t?t:"normal",type:null!==(r=e.type)&&void 0!==r?r:"form"})}function de(e){var t,r=null==e||null===(t=e.meta)||void 0===t?void 0:t.title;return"string"==typeof r?r:r&&"object"==typeof r?(0,o.translateFrom)(e.moduleName,r.key,r.default):e.name}function me(e,t){var r=ke(),n=r.getState(),a=function(e){if(pe[e])return pe[e];var t,r,n,a,o=(0,ae.getExtensionRegistration)(e);if(o)return{name:o.name,title:de(o),preferredWindowSize:null!==(n=null===(t=o.meta)||void 0===t?void 0:t.screenSize)&&void 0!==n?n:"normal",load:o.load,type:null!==(a=null===(r=o.meta)||void 0===r?void 0:r.type)&&void 0!==a?a:"form"};throw new Error("No workspace named '".concat(e,"' has been registered."))}(e),i=le(se({},a),{closeWorkspace:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return ye(e,t)},promptBeforeClosing:function(t){return ge(e,t)},additionalProps:t}),s=n.openWorkspaces.filter((function(e){return e.type==i.type}));if(0==s.length)r.setState(le(se({},n),{openWorkspaces:[i].concat(ce(n.openWorkspaces))}));else{var l=n.openWorkspaces.findIndex((function(t){return t.name==e})),c=he(s[0].name);if(l>=0){var p=ce(n.openWorkspaces);p.splice(l,1),n.openWorkspaces[l].additionalProps=i.additionalProps;var u=[n.openWorkspaces[l]].concat(ce(p));r.setState(le(se({},n),{openWorkspaces:u}))}else if(!c||c()){var d,m=null!==(d=s[0].title)&&void 0!==d?d:s[0].name,_={title:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","activeFormWarning","There is an active form open in the workspace"),body:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","workspaceModalText","Launching a new form in the workspace could cause you to lose unsaved work on the ".concat(m," form."),{formName:m}),onConfirm:function(){var e=r.getState();r.setState({openWorkspaces:[i].concat(ce(e.openWorkspaces.filter((function(e){return e.type!=i.type})))),prompt:null})},confirmText:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","openAnyway","Open anyway")};r.setState(le(se({},n),{prompt:_}))}else{var f=r.getState();r.setState(le(se({},f),{openWorkspaces:[i].concat(ce(f.openWorkspaces.filter((function(e){return e.type!=i.type}))))}))}}}function _e(e){var t=e.patientUuid,r=e.workspaceName,n=e.dashboardName,a=e.additionalProps;we(t),me(r,a),(0,o.navigate)({to:"${openmrsSpaBase}/patient/"+"".concat(t,"/chart")+(n?"/".concat(n):"")})}var fe={};function ge(e,t){fe[e]=t}function he(e){return fe[e]}function ve(){var e=ke(),t=e.getState();e.setState(le(se({},t),{prompt:null}))}function ye(e,t){var r=ke(),n=he(e);if(!t&&n&&n()){var a={title:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","unsavedChangesTitleText","Unsaved Changes"),body:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","unsavedChangeText","You have unsaved changes in the side panel. Do you want to discard these changes?"),onConfirm:function(){var t=r.getState();r.setState(le(se({},t),{prompt:null,openWorkspaces:t.openWorkspaces.filter((function(t){return t.name!=e}))}))},confirmText:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","discard","Discard")};r.setState(le(se({},r.getState()),{prompt:a}))}else{var i=r.getState();r.setState(le(se({},i),{openWorkspaces:i.openWorkspaces.filter((function(t){return t.name!=e}))}))}}function be(){var e=ke(),t=e.getState();e.setState(le(se({},t),{openWorkspaces:[]}))}function we(e){var t=ke();t.getState().patientUuid!=e&&t.setState({patientUuid:e,openWorkspaces:[],prompt:null})}var Se={patientUuid:null,openWorkspaces:[],prompt:null};function ke(){return(0,o.getGlobalStore)("workspace",Se)}function Ee(){ke().setState(Se)}var Ae=r(6217);function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ze(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ze(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ce(){var e=xe((0,n.useState)([]),2),t=e[0],r=e[1],a=xe((0,n.useState)(null),2),o=a[0],i=a[1];(0,n.useEffect)((function(){var e=function(e){r(e.openWorkspaces),i(e.prompt)};e((0,Ae.getWorkspaceStore)().getState()),(0,Ae.getWorkspaceStore)().subscribe(e)}),[]);var s=(0,n.useMemo)((function(){return 0===t.length?"hidden":t[0].preferredWindowSize}),[t]);return{active:t.length>0,windowState:s,workspaces:t,prompt:o}}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pe(e,t){switch(t){case"minimized":case"reopened":return{size:"normal"};default:return{size:t}}}var Te=(0,n.createContext)({windowSize:{size:"normal"},active:!1}),Oe=function(){return(0,n.useContext)(Te)},He=function(e){var t,r,o=e.children,i=(t=a().useReducer(Pe,{size:"normal"}),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return Ie(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ie(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],l=i[1],c=Ce(),p=c.workspaces,u=c.windowState,d=c.active;(0,n.useEffect)((function(){p.length>0&&"maximized"===u?l("maximized"):l("reopened")}),[p.length,u]);var m=(0,n.useCallback)((function(e){l(e)}),[]),_=(0,n.useMemo)((function(){return{windowSize:s,updateWindowSize:m,active:d}}),[s,m,d]);return a().createElement(Te.Provider,{value:_},o)},Le=r(9857),We=r(4200),je=function(e){var t,r=(0,Le.ZP)("/ws/rest/v1/programenrollment?patient=".concat(e,"&v=").concat("custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display))"),o.openmrsFetch),a=r.data,i=r.error,s=(0,n.useMemo)((function(){return null!==(t=null==a?void 0:a.data.results.sort((function(e,t){return t.dateEnrolled>e.dateEnrolled?1:-1})).filter((function(e){return null===e.dateCompleted})))&&void 0!==t?t:[]}),[null==a?void 0:a.data.results]);return{activePatientEnrollment:(0,We.Z)(s,(function(e){var t;return null==e||null===(t=e.program)||void 0===t?void 0:t.uuid})),error:i,isLoading:!a&&!i}},Me=r(5047),De=r.n(Me),Ue=r(9571);function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ne(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Be(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Ne(o,n,a,i,s,"next",e)}function s(e){Ne(o,n,a,i,s,"throw",e)}i(void 0)}))}}var Fe="patient-registration";function Ve(e){var t,r,a=(0,o.useConnectivity)(),i=(0,o.usePatient)(e),s=(t=(0,n.useState)({data:null,error:null}),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ze(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=s[0],c=s[1];return(0,n.useEffect)((function(){a?c({error:null,data:null}):function(e){return Ge.apply(this,arguments)}(e).then((function(e){c({error:null,data:e})})).catch((function(e){c({error:e,data:null})}))}),[e,a]),(0,n.useMemo)((function(){return i.isLoading||!l.data&&!l.error?{isLoading:!0,patient:null,patientUuid:e,error:null}:i.patient&&!i.patient.issue?{isLoading:!1,patient:i.patient,patientUuid:e,error:null}:l.data?{isLoading:!1,patient:l.data,patientUuid:e,error:null}:{isLoading:!1,patient:null,patientUuid:e,error:null!==(t=i.error)&&void 0!==t?t:l.error};var t}),[i,l.data,l.error,e])}function Ge(){return(Ge=Be(De().mark((function e(t){var r,n;return De().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getSynchronizationItems)(Fe);case 2:return r=e.sent,n=r.find((function(e){var r;return(null===(r=e.fhirPatient)||void 0===r?void 0:r.id)===t})),e.abrupt("return",n.fhirPatient);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Re(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function $e(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Re(o,n,a,i,s,"next",e)}function s(e){Re(o,n,a,i,s,"throw",e)}i(void 0)}))}}function Qe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Xe="visit";function Je(e){var t=(0,o.useConnectivity)(),r=Qe((0,n.useState)(),2),a=r[0],i=r[1];return(0,n.useEffect)((function(){i((t?o.useVisit:Ke)(e))}),[t,e]),a}function Ke(e){var t=Qe((0,n.useState)({data:null,error:null,isLoading:!0}),2),r=t[0],a=t[1];return(0,n.useEffect)((function(){et(e).then((function(e){a({error:null,data:e?at(e):null,isLoading:!1})})).catch((function(e){a({error:e,data:null,isLoading:!1})}))}),[e]),{currentVisit:r.data,isLoading:r.isLoading,isValidating:!1,error:r.error,mutate:function(){}}}function Ye(e,t){var r,a,i=(0,o.useConnectivity)(),s=null===(r=(0,o.useSession)())||void 0===r||null===(a=r.sessionLocation)||void 0===a?void 0:a.uuid,l=Ke(e),c=l.currentVisit,p=l.isValidating,u=l.error,d=l.mutate;(0,n.useEffect)((function(){i||p||c||u||rt(e,s,t).finally((function(){return d()}))}),[i,c,p,u,d,s,t,e])}function et(e){return tt.apply(this,arguments)}function tt(){return(tt=$e(De().mark((function e(t){var r;return De().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getSynchronizationItems)(Xe);case 2:return r=e.sent,e.abrupt("return",r.find((function(e){return e.patient===t})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rt(e,t,r){return nt.apply(this,arguments)}function nt(){return(nt=$e(De().mark((function e(t,r,n){var a,i,s,l;return De().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getSynchronizationItems)(Fe);case 2:return a=e.sent,i=a.some((function(e){return e.fhirPatient.id===t})),s={uuid:(0,Ue.Z)(),patient:t,startDatetime:new Date,location:r,visitType:n},l={id:s.uuid,displayName:"Offline visit",patientUuid:t,dependencies:i?[{type:Fe,id:t}]:[]},e.next=8,(0,o.queueSynchronizationItem)(Xe,s,l);case 8:return e.abrupt("return",s);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function at(e){var t,r;return{uuid:e.uuid,startDatetime:null===(t=e.startDatetime)||void 0===t?void 0:t.toString(),stopDatetime:null===(r=e.stopDatetime)||void 0===r?void 0:r.toString(),encounters:[],visitType:{uuid:e.visitType,display:"Offline"},patient:{uuid:e.patient}}}}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[402],{7904:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__card-header__desktopHeader___BUQ5I,.-esm-patient-programs__card-header__tabletHeader___efA_M{display:flex;justify-content:space-between;align-items:center;padding:.75rem 0 .75rem 1rem;background-color:#fff}.-esm-patient-programs__card-header__desktopHeader___BUQ5I h4:after,.-esm-patient-programs__card-header__tabletHeader___efA_M h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__card-header__desktopHeader___BUQ5I{height:3rem}.-esm-patient-programs__card-header__desktopHeader___BUQ5I h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-programs__card-header__tabletHeader___efA_M{height:4.5rem}.-esm-patient-programs__card-header__tabletHeader___efA_M h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}',""]),i.locals={desktopHeader:"-esm-patient-programs__card-header__desktopHeader___BUQ5I",tabletHeader:"-esm-patient-programs__card-header__tabletHeader___efA_M"};const s=i},7942:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.active-left-nav-link .-esm-patient-programs__dashboardextension__link___lom8t:nth-child(1){color:#161616;padding:1.2rem 0 1.2rem 1.2rem}",""]),i.locals={link:"-esm-patient-programs__dashboardextension__link___lom8t"};const s=i},7431:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__empty-state__action___xInzb{margin-bottom:.5rem}.-esm-patient-programs__empty-state__content___lACIK{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-patient-programs__empty-state__desktopHeading___UIGID h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-programs__empty-state__tabletHeading___lVXqD h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.-esm-patient-programs__empty-state__desktopHeading___UIGID,.-esm-patient-programs__empty-state__tabletHeading___lVXqD{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-patient-programs__empty-state__desktopHeading___UIGID h4:after,.-esm-patient-programs__empty-state__tabletHeading___lVXqD h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__empty-state__heading___gW4Bc:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__empty-state__tile___DvfL3{text-align:center;border:1px solid #e0e0e0}',""]),i.locals={action:"-esm-patient-programs__empty-state__action___xInzb",content:"-esm-patient-programs__empty-state__content___lACIK",desktopHeading:"-esm-patient-programs__empty-state__desktopHeading___UIGID",tabletHeading:"-esm-patient-programs__empty-state__tabletHeading___lVXqD",heading:"-esm-patient-programs__empty-state__heading___gW4Bc",tile:"-esm-patient-programs__empty-state__tile___DvfL3"};const s=i},418:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__error-state__errorMessage___kDICS{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-top:2.25rem;margin-bottom:.5rem}.-esm-patient-programs__error-state__errorCopy___UX21v{margin-bottom:.5rem;font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:#525252}.-esm-patient-programs__error-state__desktopHeading___Bhvtx h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-programs__error-state__tabletHeading___EAqy2 h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.-esm-patient-programs__error-state__desktopHeading___Bhvtx,.-esm-patient-programs__error-state__tabletHeading___EAqy2{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-patient-programs__error-state__desktopHeading___Bhvtx h4:after,.-esm-patient-programs__error-state__tabletHeading___EAqy2 h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-patient-programs__error-state__tile___LTdVO{text-align:center;border:1px solid #e0e0e0}',""]),i.locals={errorMessage:"-esm-patient-programs__error-state__errorMessage___kDICS",errorCopy:"-esm-patient-programs__error-state__errorCopy___UX21v",desktopHeading:"-esm-patient-programs__error-state__desktopHeading___Bhvtx",tabletHeading:"-esm-patient-programs__error-state__tabletHeading___EAqy2",tile:"-esm-patient-programs__error-state__tile___LTdVO"};const s=i},8952:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(9601),a=r.n(n),o=r(2609),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__pagination__bodyShort01____zD39,.-esm-patient-programs__pagination__configurableLink___JhehZ{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px)}.-esm-patient-programs__pagination__desktop___TGt17,.-esm-patient-programs__pagination__tablet___BEzP7{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);display:flex;border-top:1px solid #e0e0e0;justify-content:space-between;color:#525252;background-color:#fff;padding-left:1rem;align-items:center}.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination{min-height:0rem;height:2rem;width:auto;border:none}.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination .cds--select-input,.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination .cds--btn,.-esm-patient-programs__pagination__desktop___TGt17 .cds--pagination .cds--pagination__right{min-height:0rem;height:2rem}.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination{min-height:0rem;height:3rem;width:auto;border:none}.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination .cds--select-input,.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination .cds--btn,.-esm-patient-programs__pagination__tablet___BEzP7 .cds--pagination .cds--pagination__right{min-height:0rem;height:3rem}.-esm-patient-programs__pagination__configurableLink___JhehZ{text-decoration:none;padding:0 .5rem}.-esm-patient-programs__pagination__pagination___B09B8{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);background-color:#fff;color:#525252;display:flex}div.-esm-patient-programs__pagination__pagination___B09B8>.cds--pagination__left{display:none}",""]),i.locals={bodyShort01:"-esm-patient-programs__pagination__bodyShort01____zD39",configurableLink:"-esm-patient-programs__pagination__configurableLink___JhehZ",desktop:"-esm-patient-programs__pagination__desktop___TGt17",tablet:"-esm-patient-programs__pagination__tablet___BEzP7",pagination:"-esm-patient-programs__pagination__pagination___B09B8"};const s=i},9402:(e,t,r)=>{r.r(t),r.d(t,{CardHeader:()=>w,DashboardExtension:()=>F,DashboardGroupExtension:()=>j,EmptyDataIllustration:()=>E,EmptyState:()=>P,ErrorState:()=>T,PatientChartPagination:()=>J,WorkspaceWindowSizeProvider:()=>je,cancelPrompt:()=>ve,changeWorkspaceContext:()=>we,closeAllWorkspaces:()=>be,closeWorkspace:()=>ye,convertTime12to24:()=>Y,createDashboardGroup:()=>H,createDashboardLink:()=>V,createOfflineVisitForPatient:()=>nt,formEntrySub:()=>ne,getOfflineVisitForPatient:()=>tt,getPromptBeforeClosingFcn:()=>he,getWorkspaceStore:()=>ke,launchPatientChartWithWorkspaceOpen:()=>fe,launchPatientWorkspace:()=>me,launchStartVisitPrompt:()=>G,patientRegistrationSyncType:()=>Ve,promptBeforeClosing:()=>ge,registerNavGroup:()=>L,registerWorkspace:()=>ue,resetWorkspaceStore:()=>Ee,useActivePatientEnrollment:()=>De,useAutoCreatedOfflineVisit:()=>et,useNavGroups:()=>M,useOfflineVisit:()=>Ye,usePaginationInfo:()=>R,usePatientOrOfflineRegisteredPatient:()=>Ge,useVisitOrOfflineVisit:()=>Ke,useVitalsConceptMetadata:()=>te,useWorkspaceWindowSize:()=>Te,useWorkspaces:()=>Pe,visitSyncType:()=>Je,withUnit:()=>re});var n=r(268),a=r.n(n),o=r(906),i=r(6062),s=r.n(i),l=r(4036),c=r.n(l),p=r(6793),u=r.n(p),d=r(7892),m=r.n(d),f=r(1173),_=r.n(f),g=r(2464),h=r.n(g),v=r(7904),y={};y.styleTagTransform=h(),y.setAttributes=m(),y.insert=u().bind(null,"head"),y.domAPI=c(),y.insertStyleElement=_(),s()(v.Z,y);const b=v.Z&&v.Z.locals?v.Z.locals:void 0;function w(e){var t=e.title,r=e.children,n="tablet"===(0,o.useLayoutType)();return a().createElement("div",{className:n?b.tabletHeader:b.desktopHeader},a().createElement("h4",null,t),r)}var S=r(7047),k=r(4924),E=function(e){var t=e.width,r=void 0===t?"64":t,n=e.height,o=void 0===n?"64":n;return a().createElement("svg",{width:r,height:o,viewBox:"0 0 64 64"},a().createElement("title",null,"Empty data illustration"),a().createElement("g",{fill:"none",fillRule:"evenodd"},a().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),a().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),a().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),a().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),a().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),a().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),a().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),a().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),a().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),a().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))},A=r(7431),O={};O.styleTagTransform=h(),O.setAttributes=m(),O.insert=u().bind(null,"head"),O.domAPI=c(),O.insertStyleElement=_(),s()(A.Z,O);const z=A.Z&&A.Z.locals?A.Z.locals:void 0;var P=function(e){var t=(0,k.useTranslation)().t,r="tablet"===(0,o.useLayoutType)();return a().createElement(S.mh4,null,a().createElement(S.n9L,{className:z.tile},a().createElement("div",{className:r?z.tabletHeading:z.desktopHeading},a().createElement("h4",null,e.headerTitle)),a().createElement(E,null),a().createElement("p",{className:z.content},a().createElement(k.Trans,{i18nKey:"emptyStateText",values:{displayText:e.displayText.toLowerCase()}},"There are no ",e.displayText.toLowerCase()," to display for this patient")),a().createElement("p",{className:z.action},e.launchForm&&a().createElement("span",null,a().createElement(S.rUS,{onClick:function(){return e.launchForm()}},a().createElement(a().Fragment,null,t("record","Record")," ",e.displayText.toLowerCase()))))))},x=r(418),C={};C.styleTagTransform=h(),C.setAttributes=m(),C.insert=u().bind(null,"head"),C.domAPI=c(),C.insertStyleElement=_(),s()(x.Z,C);const I=x.Z&&x.Z.locals?x.Z.locals:void 0;var T=function(e){var t,r,n=e.error,i=e.headerTitle,s=(0,k.useTranslation)().t,l="tablet"===(0,o.useLayoutType)();return a().createElement(S.mh4,null,a().createElement(S.n9L,{className:I.tile},a().createElement("div",{className:l?I.tabletHeading:I.desktopHeading},a().createElement("h4",null,i)),a().createElement("p",{className:I.errorMessage},s("error","Error")," ","".concat(null==n||null===(t=n.response)||void 0===t?void 0:t.status,": "),null==n||null===(r=n.response)||void 0===r?void 0:r.statusText),a().createElement("p",{className:I.errorCopy},s("errorCopy","Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above."))))},j=function(e){var t=e.title,r=e.slotName,i=e.basePath,s=e.isExpanded;return(0,n.useEffect)((function(){L(r)}),[r]),a().createElement(S.UQy,null,a().createElement(S.Qdk,{open:null==s||s,title:t,style:{border:"none"}},a().createElement(o.ExtensionSlot,{extensionSlotName:null!=r?r:t,state:{basePath:i}})))},H=function(e){var t=e.title,r=e.slotName,n=e.isExpanded;return function(e){var o=e.basePath;return a().createElement(j,{title:t,slotName:r,basePath:o,isExpanded:n})}};function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var D=(0,o.createGlobalStore)("nav-groups",{navGroups:[]});function L(e){var t,r=D.getState();D.setState({navGroups:[e].concat((t=r.navGroups,function(e){if(Array.isArray(e))return W(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))})}var M=(0,o.createUseStore)(D),N=r(2228),U=r(7942),Z={};Z.styleTagTransform=h(),Z.setAttributes=m(),Z.insert=u().bind(null,"head"),Z.domAPI=c(),Z.insertStyleElement=_(),s()(U.Z,Z);const B=U.Z&&U.Z.locals?U.Z.locals:void 0;var F=function(e){var t,r=e.title,i=e.basePath,s=null!==(t=window.location)&&void 0!==t?t:{pathname:""},l=r===(0,n.useMemo)((function(){return decodeURIComponent((0,N.Z)(s.pathname.split("/")))}),[s.pathname])?"active-left-nav-link":"non-active";return a().createElement("div",{key:r,className:l},a().createElement(o.ConfigurableLink,{to:"".concat(i,"/").concat(encodeURIComponent(r)),className:"cds--side-nav__link "+B.link},r))},V=function(e){return function(t){var r=t.basePath;return a().createElement(F,{title:e.title,basePath:r})}};function G(){var e=(0,o.showModal)("start-visit-dialog",{closeModal:function(){return e()}})}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R(e,t,r,a){var o=(0,k.useTranslation)().t,i=(0,n.useMemo)((function(){var r,n=Math.ceil(t/e);return(r=Array(n).keys(),function(e){if(Array.isArray(e))return q(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(t){return(t+1)*e}))}),[e,t]),s=(0,n.useMemo)((function(){return e>t?"".concat(t," / ").concat(t):e*r>t?"".concat(e*(r-1)+a," / ").concat(t):"".concat(e*r," / ").concat(t)}),[e,t,r,a]);return{pageSizes:i,itemsDisplayed:"".concat(s," ").concat(o("items"," items"))}}var $=r(8952),Q={};Q.styleTagTransform=h(),Q.setAttributes=m(),Q.insert=u().bind(null,"head"),Q.domAPI=c(),Q.insertStyleElement=_(),s()($.Z,Q);const X=$.Z&&$.Z.locals?$.Z.locals:void 0;var J=function(e){var t=e.totalItems,r=e.pageSize,n=e.onPageNumberChange,i=e.pageNumber,s=e.dashboardLinkUrl,l=e.currentItems,c=e.dashboardLinkLabel,p=(0,k.useTranslation)().t,u=R(r,t,i,l),d=u.itemsDisplayed,m=u.pageSizes,f="tablet"===(0,o.useLayoutType)();return a().createElement(a().Fragment,null,t>0&&a().createElement("div",{className:f?X.tablet:X.desktop},a().createElement("div",null,d,s&&a().createElement(o.ConfigurableLink,{to:s,className:X.configurableLink},null!=c?c:p("seeAll","See all"))),a().createElement(S.tlE,{className:X.pagination,page:i,pageSize:r,pageSizes:m,totalItems:t,onChange:n,size:f?"lg":"sm"})))};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Y=function(e,t){var r,n,a=(r=e.split(":"),n=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(r,n)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=a[0],i=a[1];return"12"===o&&"AM"===t&&(o="00"),"PM"===t&&(o="12"===o?o:parseInt(o,10)+12),[o,i]},ee=r(2303);function te(){var e,t,r="/ws/rest/v1/concept/?q=VITALS SIGNS&v=".concat("custom:(setMembers:(uuid,display,hiNormal,hiAbsolute,hiCritical,lowNormal,lowAbsolute,lowCritical,units))"),n=(0,ee.Z)(r,o.openmrsFetch),a=n.data,i=n.error,s=null===(t=null==a||null===(e=a.data)||void 0===e?void 0:e.results[0])||void 0===t?void 0:t.setMembers;return{data:(null==s?void 0:s.length)?new Map(s.map((function(e){return[e.uuid,e.units]}))):new Map([]),isError:i,isLoading:!a&&!i,conceptMetadata:s}}var re=function(e,t){return"".concat(e," ").concat(t?"(".concat(t,")"):"")},ne=new(r(2444).BehaviorSubject)(null),ae=r(6081);function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ie(e,t,r[t])}))}return e}function le(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function ce(e){return function(e){if(Array.isArray(e))return oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pe={};function ue(e){var t,r;pe[e.name]=le(se({},e),{preferredWindowSize:null!==(t=e.preferredWindowSize)&&void 0!==t?t:"normal",type:null!==(r=e.type)&&void 0!==r?r:"form"})}function de(e){var t,r=null==e||null===(t=e.meta)||void 0===t?void 0:t.title;return"string"==typeof r?r:r&&"object"==typeof r?(0,o.translateFrom)(e.moduleName,r.key,r.default):e.name}function me(e,t){var r=ke(),n=r.getState(),a=function(e){if(pe[e])return pe[e];var t,r,n,a,o=(0,ae.getExtensionRegistration)(e);if(o)return{name:o.name,title:de(o),preferredWindowSize:null!==(n=null===(t=o.meta)||void 0===t?void 0:t.screenSize)&&void 0!==n?n:"normal",load:o.load,type:null!==(a=null===(r=o.meta)||void 0===r?void 0:r.type)&&void 0!==a?a:"form"};throw new Error("No workspace named '".concat(e,"' has been registered."))}(e),i=le(se({},a),{closeWorkspace:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return ye(e,t)},promptBeforeClosing:function(t){return ge(e,t)},additionalProps:t}),s=n.openWorkspaces.filter((function(e){return e.type==i.type}));if(0==s.length)r.setState(le(se({},n),{openWorkspaces:[i].concat(ce(n.openWorkspaces))}));else{var l=n.openWorkspaces.findIndex((function(t){return t.name==e})),c=he(s[0].name);if(l>=0){var p=ce(n.openWorkspaces);p.splice(l,1),n.openWorkspaces[l].additionalProps=i.additionalProps;var u=[n.openWorkspaces[l]].concat(ce(p));r.setState(le(se({},n),{openWorkspaces:u}))}else if(!c||c()){var d,m=null!==(d=s[0].title)&&void 0!==d?d:s[0].name,f={title:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","activeFormWarning","There is an active form open in the workspace"),body:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","workspaceModalText","Launching a new form in the workspace could cause you to lose unsaved work on the ".concat(m," form."),{formName:m}),onConfirm:function(){var e=r.getState();r.setState({openWorkspaces:[i].concat(ce(e.openWorkspaces.filter((function(e){return e.type!=i.type})))),prompt:null})},confirmText:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","openAnyway","Open anyway")};r.setState(le(se({},n),{prompt:f}))}else{var _=r.getState();r.setState(le(se({},_),{openWorkspaces:[i].concat(ce(_.openWorkspaces.filter((function(e){return e.type!=i.type}))))}))}}}function fe(e){var t=e.patientUuid,r=e.workspaceName,n=e.dashboardName,a=e.additionalProps;we(t),me(r,a),(0,o.navigate)({to:"${openmrsSpaBase}/patient/"+"".concat(t,"/chart")+(n?"/".concat(n):"")})}var _e={};function ge(e,t){_e[e]=t}function he(e){return _e[e]}function ve(){var e=ke(),t=e.getState();e.setState(le(se({},t),{prompt:null}))}function ye(e,t){var r=ke(),n=he(e);if(!t&&n&&n()){var a={title:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","unsavedChangesTitleText","Unsaved Changes"),body:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","unsavedChangeText","You have unsaved changes in the side panel. Do you want to discard these changes?"),onConfirm:function(){var t=r.getState();r.setState(le(se({},t),{prompt:null,openWorkspaces:t.openWorkspaces.filter((function(t){return t.name!=e}))}))},confirmText:(0,o.translateFrom)("@openmrs/esm-patient-chart-app","discard","Discard")};r.setState(le(se({},r.getState()),{prompt:a}))}else{var i=r.getState();r.setState(le(se({},i),{openWorkspaces:i.openWorkspaces.filter((function(t){return t.name!=e}))}))}}function be(){var e=ke(),t=e.getState();e.setState(le(se({},t),{openWorkspaces:[]}))}function we(e){var t=ke();t.getState().patientUuid!=e&&t.setState({patientUuid:e,openWorkspaces:[],prompt:null})}var Se={patientUuid:null,openWorkspaces:[],prompt:null};function ke(){return(0,o.getGlobalStore)("workspace",Se)}function Ee(){ke().setState(Se)}var Ae=r(6217);function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(){var e=ze((0,n.useState)([]),2),t=e[0],r=e[1],a=ze((0,n.useState)(null),2),o=a[0],i=a[1];(0,n.useEffect)((function(){var e=function(e){r(e.openWorkspaces),i(e.prompt)};e((0,Ae.getWorkspaceStore)().getState()),(0,Ae.getWorkspaceStore)().subscribe(e)}),[]);var s=(0,n.useMemo)((function(){return 0===t.length?"hidden":t[0].preferredWindowSize}),[t]);return{active:t.length>0,windowState:s,workspaces:t,prompt:o}}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ce(e,t){switch(t){case"minimized":case"reopened":return{size:"normal"};default:return{size:t}}}var Ie=(0,n.createContext)({windowSize:{size:"normal"},active:!1}),Te=function(){return(0,n.useContext)(Ie)},je=function(e){var t,r,o=e.children,i=(t=a().useReducer(Ce,{size:"normal"}),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xe(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],l=i[1],c=Pe(),p=c.workspaces,u=c.windowState,d=c.active;(0,n.useEffect)((function(){p.length>0&&"maximized"===u?l("maximized"):l("reopened")}),[p.length,u]);var m=(0,n.useCallback)((function(e){l(e)}),[]),f=(0,n.useMemo)((function(){return{windowSize:s,updateWindowSize:m,active:d}}),[s,m,d]);return a().createElement(Ie.Provider,{value:f},o)},He=r(9857),We=r(4200),De=function(e){var t,r=(0,He.ZP)("/ws/rest/v1/programenrollment?patient=".concat(e,"&v=").concat("custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display))"),o.openmrsFetch),a=r.data,i=r.error,s=(0,n.useMemo)((function(){return null!==(t=null==a?void 0:a.data.results.sort((function(e,t){return t.dateEnrolled>e.dateEnrolled?1:-1})).filter((function(e){return null===e.dateCompleted})))&&void 0!==t?t:[]}),[null==a?void 0:a.data.results]);return{activePatientEnrollment:(0,We.Z)(s,(function(e){var t;return null==e||null===(t=e.program)||void 0===t?void 0:t.uuid})),error:i,isLoading:!a&&!i}},Le=r(5047),Me=r.n(Le),Ne=r(9571);function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ze(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Be(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Ze(o,n,a,i,s,"next",e)}function s(e){Ze(o,n,a,i,s,"throw",e)}i(void 0)}))}}function Fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve="patient-registration";function Ge(e){var t,r,a=(0,o.useConnectivity)(),i=(0,o.usePatient)(e),s=(t=(0,n.useState)({patient:void 0,error:void 0}),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return Ue(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ue(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=s[0],c=s[1];return(0,n.useEffect)((function(){a?c({error:void 0,patient:void 0}):function(e){return qe.apply(this,arguments)}(e).then((function(e){c({error:void 0,patient:e})})).catch((function(e){var t,r;t=e,(null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](t):t instanceof r)?c({error:e,patient:void 0}):c({error:new Error(JSON.stringify(e)),patient:void 0})}))}),[e,a]),(0,n.useMemo)((function(){if(a){if(i.patient&&i.patient.hasOwnProperty("issue")){var e=i.patient;return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fe(e,t,r[t])}))}return e}({},i),r=null!=(r={patient:void 0,error:new Error(JSON.stringify(e.issue))})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})),t}return i}var t,r,n;return{isLoading:!(l.patient||l.error),patient:l.patient,patientUuid:null===(n=l.patient)||void 0===n?void 0:n.id,error:l.error}}),[a,i,l.patient,l.error])}function qe(){return(qe=Be(Me().mark((function e(t){var r,n;return Me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getSynchronizationItems)(Ve);case 2:return r=e.sent,n=r.find((function(e){var r;return(null===(r=e.fhirPatient)||void 0===r?void 0:r.id)===t})),e.abrupt("return",n.fhirPatient);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $e(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Qe(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){$e(o,n,a,i,s,"next",e)}function s(e){$e(o,n,a,i,s,"throw",e)}i(void 0)}))}}function Xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Re(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Je="visit";function Ke(e){var t=(0,o.useConnectivity)(),r=Xe((0,n.useState)(),2),a=r[0],i=r[1];return(0,n.useEffect)((function(){i((t?o.useVisit:Ye)(e))}),[t,e]),a}function Ye(e){var t=Xe((0,n.useState)({data:null,error:null,isLoading:!0}),2),r=t[0],a=t[1];return(0,n.useEffect)((function(){tt(e).then((function(e){a({error:null,data:e?ot(e):null,isLoading:!1})})).catch((function(e){a({error:e,data:null,isLoading:!1})}))}),[e]),{currentVisit:r.data,isLoading:r.isLoading,isValidating:!1,error:r.error,mutate:function(){}}}function et(e,t){var r,a,i=(0,o.useConnectivity)(),s=null===(r=(0,o.useSession)())||void 0===r||null===(a=r.sessionLocation)||void 0===a?void 0:a.uuid,l=Ye(e),c=l.currentVisit,p=l.isValidating,u=l.error,d=l.mutate;(0,n.useEffect)((function(){i||p||c||u||nt(e,s,t).finally((function(){return d()}))}),[i,c,p,u,d,s,t,e])}function tt(e){return rt.apply(this,arguments)}function rt(){return(rt=Qe(Me().mark((function e(t){var r;return Me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getSynchronizationItems)(Je);case 2:return r=e.sent,e.abrupt("return",r.find((function(e){return e.patient===t})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nt(e,t,r){return at.apply(this,arguments)}function at(){return(at=Qe(Me().mark((function e(t,r,n){var a,i,s,l;return Me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.getSynchronizationItems)(Ve);case 2:return a=e.sent,i=a.some((function(e){return e.fhirPatient.id===t})),s={uuid:(0,Ne.Z)(),patient:t,startDatetime:new Date,location:r,visitType:n},l={id:s.uuid,displayName:"Offline visit",patientUuid:t,dependencies:i?[{type:Ve,id:t}]:[]},e.next=8,(0,o.queueSynchronizationItem)(Je,s,l);case 8:return e.abrupt("return",s);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ot(e){var t,r;return{uuid:e.uuid,startDatetime:null===(t=e.startDatetime)||void 0===t?void 0:t.toString(),stopDatetime:null===(r=e.stopDatetime)||void 0===r?void 0:r.toString(),encounters:[],visitType:{uuid:e.visitType,display:"Offline"},patient:{uuid:e.patient}}}}}]);
package/dist/574.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"actions":"Actions","active":"Active","activePrograms":"Active programs","add":"Add","cancel":"Cancel","carePrograms":"Care Programs","chooseLocation":"Choose a location","chooseProgram":"Choose a program","completedOn":"Completed on","dateCompleted":"Date completed","dateEnrolled":"Date enrolled","discontinue":"Discontinue","enroll":"Enroll","enrollment":"Enrollment","enrollmentLocation":"Enrollment location","enrollmentNowVisible":"It is now visible in the Programs table","enrollmentSaved":"Program enrollment saved","enrollmentUpdated":"Program enrollment updated","enrollmentUpdatesNowVisible":"Changes to the program are now visible in the Programs table","fullyEnrolled":"Enrolled in all programs","location":"Location","noEligibleEnrollments":"There are no more programs left to enroll this patient in","programEnrollments":"Program enrollments","programEnrollmentSaveError":"Error saving program enrollment","programName":"Program name","programs":"programs","required":"Required","saveAndClose":"Save and close","seeAll":"See all","status":"Status"}')}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"actions":"Actions","active":"Active","activePrograms":"Active programs","add":"Add","cancel":"Cancel","carePrograms":"Care Programs","chooseLocation":"Choose a location","chooseProgram":"Choose a program","completedOn":"Completed on","dateCompleted":"Date completed","dateEnrolled":"Date enrolled","discontinue":"Discontinue","enroll":"Enroll","enrollment":"Enrollment","enrollmentLocation":"Enrollment location","enrollmentNowVisible":"It is now visible in the Programs table","enrollmentSaved":"Program enrollment saved","enrollmentUpdated":"Program enrollment updated","enrollmentUpdatesNowVisible":"Changes to the program are now visible in the Programs table","fullyEnrolled":"Enrolled in all programs","location":"Location","noEligibleEnrollments":"There are no more programs left to enroll this patient in","noProgramsConfigured":"No programs configured","programEnrollments":"Program enrollments","programEnrollmentSaveError":"Error saving program enrollment","programName":"Program name","programs":"programs","required":"Required","saveAndClose":"Save and close","seeAll":"See all","status":"Status"}')}}]);
package/dist/733.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[733],{1951:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(9601),o=r.n(n),a=r(2609),l=r.n(a)()(o());l.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__programs-form__loading___KGmNP{margin-left:1rem;width:2rem;min-height:2.5rem}.-esm-patient-programs__programs-form__button___KPSt9{height:4rem;display:flex;align-content:flex-start;align-items:baseline;min-width:50%}.-esm-patient-programs__programs-form__tablet___yw5Wr{padding:1.5rem 1rem;background-color:#fff}.-esm-patient-programs__programs-form__desktop___RnK8C{padding:0rem}.-esm-patient-programs__programs-form__formContainer___lqbdm{margin:1rem}.-esm-patient-programs__programs-form__form___BLqPA{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - 6rem)}",""]),l.locals={loading:"-esm-patient-programs__programs-form__loading___KGmNP",button:"-esm-patient-programs__programs-form__button___KPSt9",tablet:"-esm-patient-programs__programs-form__tablet___yw5Wr",desktop:"-esm-patient-programs__programs-form__desktop___RnK8C",formContainer:"-esm-patient-programs__programs-form__formContainer___lqbdm",form:"-esm-patient-programs__programs-form__form___BLqPA"};const i=l},5733:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var n=r(268),o=r.n(n),a=r(4924),l=r(3565),i=r.n(l),u=r(3863),s=r(8827),c=r(819),m=r(9857),d=r(906),p=r(7047),f=r(4076),g=r(6062),v=r.n(g),b=r(4036),_=r.n(b),y=r(6793),h=r.n(y),E=r(7892),w=r.n(E),O=r(1173),P=r.n(O),Z=r(2464),C=r.n(Z),S=r(1951),j={};j.styleTagTransform=C(),j.setAttributes=w(),j.insert=h().bind(null,"head"),j.domAPI=_(),j.insertStyleElement=P(),v()(S.Z,j);const k=S.Z&&S.Z.locals?S.Z.locals:void 0;function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,o=e}finally{try{l||null==r.return||r.return()}finally{if(i)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const N=function(e){var t,r,n,l,g=e.closeWorkspace,v=e.patientUuid,b=e.programEnrollmentId,_=(0,a.useTranslation)().t,y="tablet"===(0,d.useLayoutType)(),h=(0,d.useSession)(),E=(0,d.useLocations)(),w=(0,m.kY)().mutate,O=(0,f.oI)().data,P=(0,f.Bw)(v).data,Z=b&&P.filter((function(e){return e.uuid==b}))[0],C=Z?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T(e,t,r[t])}))}return e}({display:Z.program.name},Z.program):null,S=C?[C]:(0,u.Z)(O,(function(e){return!(0,s.Z)((0,c.Z)(P,"program.uuid"),e.uuid)})),j=D(o().useState((null==Z?void 0:Z.dateCompleted)?(0,d.parseDate)(Z.dateCompleted):null),2),x=j[0],N=j[1],A=D(o().useState((null==Z?void 0:Z.dateEnrolled)?(0,d.parseDate)(Z.dateEnrolled):new Date),2),I=A[0],L=A[1],F=D(o().useState(null!==(r=null==Z?void 0:Z.program.uuid)&&void 0!==r?r:""),2),q=F[0],K=F[1],V=D(o().useState(null!==(n=null==Z?void 0:Z.location.uuid)&&void 0!==n?n:""),2),H=V[0],U=V[1];!H&&(null==h||null===(t=h.sessionLocation)||void 0===t?void 0:t.uuid)&&U(null==h||null===(l=h.sessionLocation)||void 0===l?void 0:l.uuid);var W=o().useCallback((function(e){if(e.preventDefault(),q){var t={patient:v,program:q,dateEnrolled:I?i()(I).format():null,dateCompleted:x?i()(x).format():null,location:H},r=new AbortController,n=Z?(0,f.YX)(Z.uuid,t,r).subscribe((function(e){200===e.status&&(g(),(0,d.showToast)({critical:!0,kind:"success",description:_("enrollmentUpdatesNowVisible","Changes to the program are now visible in the Programs table"),title:_("enrollmentUpdated","Program enrollment updated")}),w("/ws/rest/v1/programenrollment?patient=".concat(v,"&v=").concat(f.o9)))}),(function(e){(0,d.createErrorHandler)(),(0,d.showNotification)({title:_("programEnrollmentSaveError","Error saving program enrollment"),kind:"error",critical:!0,description:null==e?void 0:e.message})})):(0,f.df)(t,r).subscribe((function(e){201===e.status&&(g(),(0,d.showToast)({critical:!0,kind:"success",description:_("enrollmentNowVisible","It is now visible in the Programs table"),title:_("enrollmentSaved","Program enrollment saved")}),w("/ws/rest/v1/programenrollment?patient=".concat(v,"&v=").concat(f.o9)))}),(function(e){(0,d.createErrorHandler)(),(0,d.showNotification)({title:_("programEnrollmentSaveError","Error saving program enrollment"),kind:"error",critical:!0,description:null==e?void 0:e.message})}));return function(){n.unsubscribe()}}}),[g,x,I,w,v,q,_,H,Z]);return o().createElement(p.l09,{className:k.form,onSubmit:W},o().createElement(p.Kqy,{className:k.formContainer,gap:7},o().createElement(p.cwH,{style:{maxWidth:"50%"},legendText:_("programName","Program name")},o().createElement("div",{className:k.selectContainer},o().createElement(p.PhF,{id:"program",invalidText:_("required","Required"),labelText:"",light:y,onChange:function(e){return K(e.target.value)}},q?null:o().createElement(p.QlF,{text:_("chooseProgram","Choose a program"),value:""}),(null==S?void 0:S.length)>0&&S.map((function(e){return o().createElement(p.QlF,{key:e.uuid,text:e.display,value:e.uuid},e.display)}))))),o().createElement(p.cwH,{style:{maxWidth:"50%"},legendText:_("dateEnrolled","Date enrolled")},o().createElement(p.Mtg,{id:"enrollmentDate",datePickerType:"single",dateFormat:"d/m/Y",light:y,maxDate:(new Date).toISOString(),placeholder:"dd/mm/yyyy",onChange:function(e){var t=D(e,1)[0];return L(t)},value:I},o().createElement(p.aj6,{id:"enrollmentDateInput",labelText:""}))),o().createElement(p.cwH,{style:{width:"50%"},legendText:_("dateCompleted","Date completed")},o().createElement(p.Mtg,{id:"completionDate",datePickerType:"single",dateFormat:"d/m/Y",light:y,minDate:new Date(I).toISOString(),maxDate:(new Date).toISOString(),placeholder:"dd/mm/yyyy",onChange:function(e){var t=D(e,1)[0];return N(t)},value:x},o().createElement(p.aj6,{id:"completionDateInput",labelText:""}))),o().createElement(p.cwH,{style:{width:"50%"},legendText:_("enrollmentLocation","Enrollment location")},o().createElement(p.PhF,{id:"location",invalidText:"Required",labelText:"",light:y,onChange:function(e){return U(e.target.value)},value:H},H?null:o().createElement(p.QlF,{text:_("chooseLocation","Choose a location"),value:""}),(null==E?void 0:E.length)>0&&E.map((function(e){return o().createElement(p.QlF,{key:e.uuid,text:e.display,value:e.uuid},e.display)}))))),o().createElement(p.uVA,{className:y?k.tablet:k.desktop},o().createElement(p.zxk,{className:k.button,kind:"secondary",onClick:function(){return g()}},_("cancel","Cancel")),o().createElement(p.zxk,{className:k.button,kind:"primary",disabled:!q,type:"submit"},_("saveAndClose","Save and close"))))}},4076:(e,t,r)=>{r.d(t,{Bw:()=>m,YX:()=>f,b$:()=>g,df:()=>p,o9:()=>c,oI:()=>d});var n=r(9857),o=r(906),a=r(4200),l=r(3863),i=r(8827),u=r(819);function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c="custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display))";function m(e){var t,r=(0,n.ZP)("/ws/rest/v1/programenrollment?patient=".concat(e,"&v=").concat(c),o.openmrsFetch),l=r.data,i=r.error,u=r.isValidating,s=(null==l||null===(t=l.data)||void 0===t?void 0:t.results.length)>0?null==l?void 0:l.data.results.sort((function(e,t){return t.dateEnrolled>e.dateEnrolled?1:-1})):null,m=null==s?void 0:s.filter((function(e){return!e.dateCompleted}));return{data:l?(0,a.Z)(s,(function(e){var t;return null==e||null===(t=e.program)||void 0===t?void 0:t.uuid})):null,isError:i,isLoading:!l&&!i,isValidating:u,activeEnrollments:m}}function d(e){var t,r,a=(0,n.ZP)("/ws/rest/v1/program?v=custom:(uuid,display,allWorkflows,concept:(uuid,display))",o.openmrsFetch),s=a.data,c=a.error,m=null!==(r=null==s||null===(t=s.data)||void 0===t?void 0:t.results)&&void 0!==r?r:null;return{data:m,isError:c,isLoading:!s&&!c,eligiblePrograms:(0,l.Z)(m,(function(t){return!(0,i.Z)((0,u.Z)(e,"program.uuid"),t.uuid)}))}}function p(e,t){if(!e)return null;var r=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:r,patient:n,dateEnrolled:a,dateCompleted:l,location:i},signal:t.signal})}function f(e,t,r){if(!t&&!t.program)return null;t.program;var n=t.dateEnrolled,a=t.dateCompleted,l=t.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:r.signal})}var g=function(e){var t,r,a=(0,o.useConfig)().customUrl,l=m(e),i=l.data,u=l.isError,c=l.isLoading,p=l.isValidating,f=l.activeEnrollments,g=d(i),v=g.data,b=g.eligiblePrograms,_=function(e){var t,r=(0,o.useConfig)().customUrl,a=(0,n.ZP)(r?"".concat(r).concat(e):null,o.openmrsFetch),l=a.data,i=a.error;return{configurablePrograms:null!==(t=null==l?void 0:l.data)&&void 0!==t?t:[],isLoading:!l&&!i,error:i}}(e),y=_.configurablePrograms,h=_.isLoading,E=_.error;return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){s(e,t,r[t])}))}return e}({enrollments:i},a?{isLoading:h,isError:E}:{isLoading:c,isError:u}),r=null!=(r={isValidating:p,activeEnrollments:f,availablePrograms:v,eligiblePrograms:b,configurablePrograms:y})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})),t}},1154:(e,t,r)=>{r.d(t,{Z:()=>l});const n=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),l=a.length;l--;){var i=a[++n];if(!1===t(o[i],i,o))break}return e};var o=r(6892);var a=r(3282);const l=(i=function(e,t){return e&&n(e,t,o.Z)},function(e,t){if(null==e)return e;if(!(0,a.Z)(e))return i(e,t);for(var r=e.length,n=-1,o=Object(e);++n<r&&!1!==t(o[n],n,o););return e});var i},3863:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(2300),o=r(1154);const a=function(e,t){var r=[];return(0,o.Z)(e,(function(e,n,o){t(e,n,o)&&r.push(e)})),r};var l=r(7954),i=r(7885);const u=function(e,t){return((0,i.Z)(e)?n.Z:a)(e,(0,l.Z)(t,3))}},8827:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(1266),o=r(3282),a=r(9001),l=r(7885),i=r(3391);var u=/\s/;var s=/^\s+/;const c=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&u.test(e.charAt(t)););return t}(e)+1).replace(s,""):e};var m=r(3122),d=r(2758),p=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,g=/^0o[0-7]+$/i,v=parseInt;const b=function(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if((0,d.Z)(e))return NaN;if((0,m.Z)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,m.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=c(e);var r=f.test(e);return r||g.test(e)?v(e.slice(2),r?2:8):p.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var _=r(5598);var y=r(6892);const h=function(e){return null==e?[]:function(e,t){return(0,_.Z)(t,(function(t){return e[t]}))}(e,(0,y.Z)(e))};var E=Math.max;const w=function(e,t,r,u){e=(0,o.Z)(e)?e:h(e),r=r&&!u?function(e){var t=b(e),r=t%1;return t==t?r?t-r:t:0}(r):0;var s=e.length;return r<0&&(r=E(s+r,0)),function(e){return"string"==typeof e||!(0,l.Z)(e)&&(0,i.Z)(e)&&"[object String]"==(0,a.Z)(e)}(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&(0,n.Z)(e,t,r)>-1}},819:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(5598),o=r(7954),a=r(1154),l=r(3282);const i=function(e,t){var r=-1,n=(0,l.Z)(e)?Array(e.length):[];return(0,a.Z)(e,(function(e,o,a){n[++r]=t(e,o,a)})),n};var u=r(7885);const s=function(e,t){return((0,u.Z)(e)?n.Z:i)(e,(0,o.Z)(t,3))}}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[]).push([[733],{1951:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(9601),a=r.n(n),o=r(2609),l=r.n(o)()(a());l.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-programs__programs-form__loading___KGmNP{margin-left:1rem;width:2rem;min-height:2.5rem}.-esm-patient-programs__programs-form__button___KPSt9{height:4rem;display:flex;align-content:flex-start;align-items:baseline;min-width:50%}.-esm-patient-programs__programs-form__tablet___yw5Wr{padding:1.5rem 1rem;background-color:#fff}.-esm-patient-programs__programs-form__desktop___RnK8C{padding:0rem}.-esm-patient-programs__programs-form__formContainer___lqbdm{margin:1rem}.-esm-patient-programs__programs-form__form___BLqPA{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - 6rem)}",""]),l.locals={loading:"-esm-patient-programs__programs-form__loading___KGmNP",button:"-esm-patient-programs__programs-form__button___KPSt9",tablet:"-esm-patient-programs__programs-form__tablet___yw5Wr",desktop:"-esm-patient-programs__programs-form__desktop___RnK8C",formContainer:"-esm-patient-programs__programs-form__formContainer___lqbdm",form:"-esm-patient-programs__programs-form__form___BLqPA"};const i=l},5733:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var n=r(268),a=r.n(n),o=r(4924),l=r(9857),i=r(3565),u=r.n(i),s=r(3863),c=r(8827),m=r(819),d=r(7047),p=r(906),g=r(4076),f=r(6062),v=r.n(f),b=r(4036),y=r.n(b),_=r(6793),h=r.n(_),E=r(7892),w=r.n(E),P=r(1173),O=r.n(P),C=r(2464),x=r.n(C),Z=r(1951),S={};S.styleTagTransform=x(),S.setAttributes=w(),S.insert=h().bind(null,"head"),S.domAPI=y(),S.insertStyleElement=O(),v()(Z.Z,S);const k=Z.Z&&Z.Z.locals?Z.Z.locals:void 0;function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==r.return||r.return()}finally{if(i)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const F=function(e){var t,r,n,i,f=e.closeWorkspace,v=e.patientUuid,b=e.programEnrollmentId,y=(0,o.useTranslation)().t,_="tablet"===(0,p.useLayoutType)(),h=(0,p.useSession)(),E=(0,p.useLocations)(),w=(0,l.kY)().mutate,P=(0,g.oI)().data,O=(0,g.Bw)(v).data,C=b&&O.filter((function(e){return e.uuid==b}))[0],x=C?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){D(e,t,r[t])}))}return e}({display:C.program.name},C.program):null,Z=x?[x]:(0,s.Z)(P,(function(e){return!(0,c.Z)((0,m.Z)(O,"program.uuid"),e.uuid)})),S=T(a().useState((null==C?void 0:C.dateCompleted)?(0,p.parseDate)(C.dateCompleted):null),2),j=S[0],F=S[1],I=T(a().useState((null==C?void 0:C.dateEnrolled)?(0,p.parseDate)(C.dateEnrolled):new Date),2),N=I[0],L=I[1],A=T(a().useState(null!==(r=null==C?void 0:C.program.uuid)&&void 0!==r?r:""),2),q=A[0],K=A[1],Q=T(a().useState(null!==(n=null==C?void 0:C.location.uuid)&&void 0!==n?n:""),2),V=Q[0],W=Q[1];!V&&(null==h||null===(t=h.sessionLocation)||void 0===t?void 0:t.uuid)&&W(null==h||null===(i=h.sessionLocation)||void 0===i?void 0:i.uuid);var Y=a().useCallback((function(e){if(e.preventDefault(),q){var t={patient:v,program:q,dateEnrolled:N?u()(N).format():null,dateCompleted:j?u()(j).format():null,location:V},r=new AbortController,n=C?(0,g.YX)(C.uuid,t,r).subscribe((function(e){200===e.status&&(f(),(0,p.showToast)({critical:!0,kind:"success",description:y("enrollmentUpdatesNowVisible","Changes to the program are now visible in the Programs table"),title:y("enrollmentUpdated","Program enrollment updated")}),w("/ws/rest/v1/programenrollment?patient=".concat(v,"&v=").concat(g.o9)))}),(function(e){(0,p.createErrorHandler)(),(0,p.showNotification)({title:y("programEnrollmentSaveError","Error saving program enrollment"),kind:"error",critical:!0,description:null==e?void 0:e.message})})):(0,g.df)(t,r).subscribe((function(e){201===e.status&&(f(),(0,p.showToast)({critical:!0,kind:"success",description:y("enrollmentNowVisible","It is now visible in the Programs table"),title:y("enrollmentSaved","Program enrollment saved")}),w("/ws/rest/v1/programenrollment?patient=".concat(v,"&v=").concat(g.o9)))}),(function(e){(0,p.createErrorHandler)(),(0,p.showNotification)({title:y("programEnrollmentSaveError","Error saving program enrollment"),kind:"error",critical:!0,description:null==e?void 0:e.message})}));return function(){n.unsubscribe()}}}),[f,j,N,w,v,q,y,V,C]);return a().createElement(d.l09,{className:k.form,onSubmit:Y},a().createElement(d.Kqy,{className:k.formContainer,gap:7},Z.length?null:a().createElement(d.K0D,{style:{minWidth:"100%",margin:"0rem",padding:"0rem"},kind:"error",lowContrast:!0,subtitle:y("configurePrograms","Please configure programs to continue."),title:y("noProgramsConfigured","No programs configured")}),a().createElement(d.cwH,{style:{maxWidth:"50%"},legendText:y("programName","Program name")},a().createElement("div",{className:k.selectContainer},_?a().createElement(d.mh4,null,a().createElement(d.PhF,{id:"program",invalidText:y("required","Required"),labelText:"",onChange:function(e){return K(e.target.value)}},q?null:a().createElement(d.QlF,{text:y("chooseProgram","Choose a program"),value:""}),(null==Z?void 0:Z.length)>0&&Z.map((function(e){return a().createElement(d.QlF,{key:e.uuid,text:e.display,value:e.uuid},e.display)})))):a().createElement(d.PhF,{id:"program",invalidText:y("required","Required"),labelText:"",onChange:function(e){return K(e.target.value)}},q?null:a().createElement(d.QlF,{text:y("chooseProgram","Choose a program"),value:""}),(null==Z?void 0:Z.length)>0&&Z.map((function(e){return a().createElement(d.QlF,{key:e.uuid,text:e.display,value:e.uuid},e.display)}))))),a().createElement(d.cwH,{style:{maxWidth:"50%"},legendText:y("dateEnrolled","Date enrolled")},_?a().createElement(d.mh4,null,a().createElement(d.Mtg,{id:"enrollmentDate",datePickerType:"single",dateFormat:"d/m/Y",maxDate:(new Date).toISOString(),placeholder:"dd/mm/yyyy",onChange:function(e){var t=T(e,1)[0];return L(t)},value:N},a().createElement(d.aj6,{id:"enrollmentDateInput",labelText:""}))):a().createElement(d.Mtg,{id:"enrollmentDate",datePickerType:"single",dateFormat:"d/m/Y",maxDate:(new Date).toISOString(),placeholder:"dd/mm/yyyy",onChange:function(e){var t=T(e,1)[0];return L(t)},value:N},a().createElement(d.aj6,{id:"enrollmentDateInput",labelText:""}))),a().createElement(d.cwH,{style:{width:"50%"},legendText:y("dateCompleted","Date completed")},_?a().createElement(d.mh4,null,a().createElement(d.Mtg,{id:"completionDate",datePickerType:"single",dateFormat:"d/m/Y",minDate:new Date(N).toISOString(),maxDate:(new Date).toISOString(),placeholder:"dd/mm/yyyy",onChange:function(e){var t=T(e,1)[0];return F(t)},value:j},a().createElement(d.aj6,{id:"completionDateInput",labelText:""}))):a().createElement(d.Mtg,{id:"completionDate",datePickerType:"single",dateFormat:"d/m/Y",minDate:new Date(N).toISOString(),maxDate:(new Date).toISOString(),placeholder:"dd/mm/yyyy",onChange:function(e){var t=T(e,1)[0];return F(t)},value:j},a().createElement(d.aj6,{id:"completionDateInput",labelText:""}))),a().createElement(d.cwH,{style:{width:"50%"},legendText:y("enrollmentLocation","Enrollment location")},_?a().createElement(d.mh4,null,a().createElement(d.PhF,{id:"location",invalidText:"Required",labelText:"",onChange:function(e){return W(e.target.value)},value:V},V?null:a().createElement(d.QlF,{text:y("chooseLocation","Choose a location"),value:""}),(null==E?void 0:E.length)>0&&E.map((function(e){return a().createElement(d.QlF,{key:e.uuid,text:e.display,value:e.uuid},e.display)})))):a().createElement(d.PhF,{id:"location",invalidText:"Required",labelText:"",onChange:function(e){return W(e.target.value)},value:V},V?null:a().createElement(d.QlF,{text:y("chooseLocation","Choose a location"),value:""}),(null==E?void 0:E.length)>0&&E.map((function(e){return a().createElement(d.QlF,{key:e.uuid,text:e.display,value:e.uuid},e.display)}))))),a().createElement(d.uVA,{className:_?k.tablet:k.desktop},a().createElement(d.zxk,{className:k.button,kind:"secondary",onClick:function(){return f()}},y("cancel","Cancel")),a().createElement(d.zxk,{className:k.button,kind:"primary",disabled:!q,type:"submit"},y("saveAndClose","Save and close"))))}},4076:(e,t,r)=>{r.d(t,{Bw:()=>m,YX:()=>g,b$:()=>f,df:()=>p,o9:()=>c,oI:()=>d});var n=r(9857),a=r(906),o=r(4200),l=r(3863),i=r(8827),u=r(819);function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c="custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display))";function m(e){var t,r=(0,n.ZP)("/ws/rest/v1/programenrollment?patient=".concat(e,"&v=").concat(c),a.openmrsFetch),l=r.data,i=r.error,u=r.isValidating,s=(null==l||null===(t=l.data)||void 0===t?void 0:t.results.length)>0?null==l?void 0:l.data.results.sort((function(e,t){return t.dateEnrolled>e.dateEnrolled?1:-1})):null,m=null==s?void 0:s.filter((function(e){return!e.dateCompleted}));return{data:l?(0,o.Z)(s,(function(e){var t;return null==e||null===(t=e.program)||void 0===t?void 0:t.uuid})):null,isError:i,isLoading:!l&&!i,isValidating:u,activeEnrollments:m}}function d(e){var t,r,o=(0,n.ZP)("/ws/rest/v1/program?v=custom:(uuid,display,allWorkflows,concept:(uuid,display))",a.openmrsFetch),s=o.data,c=o.error,m=null!==(r=null==s||null===(t=s.data)||void 0===t?void 0:t.results)&&void 0!==r?r:null;return{data:m,isError:c,isLoading:!s&&!c,eligiblePrograms:(0,l.Z)(m,(function(t){return!(0,i.Z)((0,u.Z)(e,"program.uuid"),t.uuid)}))}}function p(e,t){if(!e)return null;var r=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:r,patient:n,dateEnrolled:o,dateCompleted:l,location:i},signal:t.signal})}function g(e,t,r){if(!t&&!t.program)return null;t.program;var n=t.dateEnrolled,o=t.dateCompleted,l=t.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:r.signal})}var f=function(e){var t,r,o=(0,a.useConfig)().customUrl,l=m(e),i=l.data,u=l.isError,c=l.isLoading,p=l.isValidating,g=l.activeEnrollments,f=d(i),v=f.data,b=f.eligiblePrograms,y=function(e){var t,r=(0,a.useConfig)().customUrl,o=(0,n.ZP)(r?"".concat(r).concat(e):null,a.openmrsFetch),l=o.data,i=o.error;return{configurablePrograms:null!==(t=null==l?void 0:l.data)&&void 0!==t?t:[],isLoading:!l&&!i,error:i}}(e),_=y.configurablePrograms,h=y.isLoading,E=y.error;return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){s(e,t,r[t])}))}return e}({enrollments:i},o?{isLoading:h,isError:E}:{isLoading:c,isError:u}),r=null!=(r={isValidating:p,activeEnrollments:g,availablePrograms:v,eligiblePrograms:b,configurablePrograms:_})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})),t}},1154:(e,t,r)=>{r.d(t,{Z:()=>l});const n=function(e,t,r){for(var n=-1,a=Object(e),o=r(e),l=o.length;l--;){var i=o[++n];if(!1===t(a[i],i,a))break}return e};var a=r(6892);var o=r(3282);const l=(i=function(e,t){return e&&n(e,t,a.Z)},function(e,t){if(null==e)return e;if(!(0,o.Z)(e))return i(e,t);for(var r=e.length,n=-1,a=Object(e);++n<r&&!1!==t(a[n],n,a););return e});var i},3863:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(2300),a=r(1154);const o=function(e,t){var r=[];return(0,a.Z)(e,(function(e,n,a){t(e,n,a)&&r.push(e)})),r};var l=r(7954),i=r(7885);const u=function(e,t){return((0,i.Z)(e)?n.Z:o)(e,(0,l.Z)(t,3))}},8827:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(1266),a=r(3282),o=r(9001),l=r(7885),i=r(3391);var u=/\s/;var s=/^\s+/;const c=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&u.test(e.charAt(t)););return t}(e)+1).replace(s,""):e};var m=r(3122),d=r(2758),p=/^[-+]0x[0-9a-f]+$/i,g=/^0b[01]+$/i,f=/^0o[0-7]+$/i,v=parseInt;const b=function(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if((0,d.Z)(e))return NaN;if((0,m.Z)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,m.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=c(e);var r=g.test(e);return r||f.test(e)?v(e.slice(2),r?2:8):p.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var y=r(5598);var _=r(6892);const h=function(e){return null==e?[]:function(e,t){return(0,y.Z)(t,(function(t){return e[t]}))}(e,(0,_.Z)(e))};var E=Math.max;const w=function(e,t,r,u){e=(0,a.Z)(e)?e:h(e),r=r&&!u?function(e){var t=b(e),r=t%1;return t==t?r?t-r:t:0}(r):0;var s=e.length;return r<0&&(r=E(s+r,0)),function(e){return"string"==typeof e||!(0,l.Z)(e)&&(0,i.Z)(e)&&"[object String]"==(0,o.Z)(e)}(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&(0,n.Z)(e,t,r)>-1}},819:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(5598),a=r(7954),o=r(1154),l=r(3282);const i=function(e,t){var r=-1,n=(0,l.Z)(e)?Array(e.length):[];return(0,o.Z)(e,(function(e,a,o){n[++r]=t(e,a,o)})),n};var u=r(7885);const s=function(e,t){return((0,u.Z)(e)?n.Z:i)(e,(0,a.Z)(t,3))}}}]);
@@ -48,7 +48,7 @@
48
48
  "main.js"
49
49
  ],
50
50
  "auxiliaryFiles": [],
51
- "hash": "567ea82361b25f0be8af",
51
+ "hash": "17437efa05d870821eaf",
52
52
  "childrenByOrder": {}
53
53
  },
54
54
  {
@@ -128,9 +128,9 @@
128
128
  "entry": false,
129
129
  "recorded": false,
130
130
  "reason": "reused as split chunk (cache group: default)",
131
- "size": 74970,
131
+ "size": 77072,
132
132
  "sizes": {
133
- "javascript": 74886,
133
+ "javascript": 76988,
134
134
  "consume-shared": 84
135
135
  },
136
136
  "names": [],
@@ -143,7 +143,7 @@
143
143
  "402.js"
144
144
  ],
145
145
  "auxiliaryFiles": [],
146
- "hash": "d600636327b861acc7bd",
146
+ "hash": "29cbdca9bcac4b2e4c34",
147
147
  "childrenByOrder": {}
148
148
  },
149
149
  {
@@ -165,7 +165,7 @@
165
165
  "435.js"
166
166
  ],
167
167
  "auxiliaryFiles": [],
168
- "hash": "a5cd2369d7c892d069f6",
168
+ "hash": "bc6393de0f65f4fa5938",
169
169
  "childrenByOrder": {}
170
170
  },
171
171
  {
@@ -198,9 +198,9 @@
198
198
  "initial": false,
199
199
  "entry": false,
200
200
  "recorded": false,
201
- "size": 1074,
201
+ "size": 1122,
202
202
  "sizes": {
203
- "javascript": 1074
203
+ "javascript": 1122
204
204
  },
205
205
  "names": [],
206
206
  "idHints": [],
@@ -212,7 +212,7 @@
212
212
  "574.js"
213
213
  ],
214
214
  "auxiliaryFiles": [],
215
- "hash": "2c7571f50bf6c04f00cd",
215
+ "hash": "451d31e4b5062ef2b521",
216
216
  "childrenByOrder": {}
217
217
  },
218
218
  {
@@ -287,9 +287,9 @@
287
287
  "initial": false,
288
288
  "entry": false,
289
289
  "recorded": false,
290
- "size": 38663,
290
+ "size": 41884,
291
291
  "sizes": {
292
- "javascript": 38621,
292
+ "javascript": 41842,
293
293
  "consume-shared": 42
294
294
  },
295
295
  "names": [],
@@ -302,7 +302,7 @@
302
302
  "733.js"
303
303
  ],
304
304
  "auxiliaryFiles": [],
305
- "hash": "047804bc6d35380506d1",
305
+ "hash": "8e0205ddb8738e0758d4",
306
306
  "childrenByOrder": {}
307
307
  },
308
308
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-programs-app",
3
- "version": "4.0.1-pre.262",
3
+ "version": "4.0.1-pre.268",
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",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@carbon/react": "^1.9.0",
38
- "@openmrs/esm-patient-common-lib": "^4.0.1-pre.262",
38
+ "@openmrs/esm-patient-common-lib": "^4.0.1-pre.268",
39
39
  "d3": "^7.0.3",
40
40
  "lodash-es": "^4.17.15"
41
41
  },
@@ -48,5 +48,8 @@
48
48
  "react-router-dom": "6.x",
49
49
  "rxjs": "6.x"
50
50
  },
51
- "gitHead": "0d62465f87f63e6a14ab9d10397f65ad8fce0e98"
51
+ "devDependencies": {
52
+ "webpack": "^5.74.0"
53
+ },
54
+ "gitHead": "cfdc3455e0c1434893e51cc862046fe7605cce28"
52
55
  }
@@ -1,19 +1,10 @@
1
1
  import React, { SyntheticEvent } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
+ import { useSWRConfig } from 'swr';
3
4
  import dayjs from 'dayjs';
4
5
  import filter from 'lodash-es/filter';
5
6
  import includes from 'lodash-es/includes';
6
7
  import map from 'lodash-es/map';
7
- import { useSWRConfig } from 'swr';
8
- import {
9
- createErrorHandler,
10
- showNotification,
11
- showToast,
12
- useSession,
13
- useLocations,
14
- useLayoutType,
15
- parseDate,
16
- } from '@openmrs/esm-framework';
17
8
  import {
18
9
  Button,
19
10
  ButtonSet,
@@ -21,10 +12,22 @@ import {
21
12
  DatePickerInput,
22
13
  Form,
23
14
  FormGroup,
15
+ InlineNotification,
16
+ Layer,
24
17
  Select,
25
18
  SelectItem,
26
19
  Stack,
27
20
  } from '@carbon/react';
21
+ import {
22
+ createErrorHandler,
23
+ showNotification,
24
+ showToast,
25
+ useSession,
26
+ useLocations,
27
+ useLayoutType,
28
+ parseDate,
29
+ } from '@openmrs/esm-framework';
30
+ import { DefaultWorkspaceProps } from '@openmrs/esm-patient-common-lib';
28
31
  import {
29
32
  createProgramEnrollment,
30
33
  useAvailablePrograms,
@@ -32,7 +35,6 @@ import {
32
35
  customRepresentation,
33
36
  updateProgramEnrollment,
34
37
  } from './programs.resource';
35
- import { DefaultWorkspaceProps } from '@openmrs/esm-patient-common-lib';
36
38
  import styles from './programs-form.scss';
37
39
 
38
40
  interface ProgramsFormProps extends DefaultWorkspaceProps {
@@ -48,6 +50,7 @@ const ProgramsForm: React.FC<ProgramsFormProps> = ({ closeWorkspace, patientUuid
48
50
 
49
51
  const { data: availablePrograms } = useAvailablePrograms();
50
52
  const { data: enrollments } = useEnrollments(patientUuid);
53
+
51
54
  const currentEnrollment = programEnrollmentId && enrollments.filter((e) => e.uuid == programEnrollmentId)[0];
52
55
  const currentProgram = currentEnrollment
53
56
  ? {
@@ -59,6 +62,7 @@ const ProgramsForm: React.FC<ProgramsFormProps> = ({ closeWorkspace, patientUuid
59
62
  const eligiblePrograms = currentProgram
60
63
  ? [currentProgram]
61
64
  : filter(availablePrograms, (program) => !includes(map(enrollments, 'program.uuid'), program.uuid));
65
+
62
66
  const [completionDate, setCompletionDate] = React.useState<Date>(
63
67
  currentEnrollment?.dateCompleted ? parseDate(currentEnrollment.dateCompleted) : null,
64
68
  );
@@ -163,71 +167,148 @@ const ProgramsForm: React.FC<ProgramsFormProps> = ({ closeWorkspace, patientUuid
163
167
  return (
164
168
  <Form className={styles.form} onSubmit={handleSubmit}>
165
169
  <Stack className={styles.formContainer} gap={7}>
170
+ {!eligiblePrograms.length ? (
171
+ <InlineNotification
172
+ style={{ minWidth: '100%', margin: '0rem', padding: '0rem' }}
173
+ kind={'error'}
174
+ lowContrast
175
+ subtitle={t('configurePrograms', 'Please configure programs to continue.')}
176
+ title={t('noProgramsConfigured', 'No programs configured')}
177
+ />
178
+ ) : null}
166
179
  <FormGroup style={{ maxWidth: '50%' }} legendText={t('programName', 'Program name')}>
167
180
  <div className={styles.selectContainer}>
168
- <Select
169
- id="program"
170
- invalidText={t('required', 'Required')}
171
- labelText=""
172
- light={isTablet}
173
- onChange={(event) => setSelectedProgram(event.target.value)}
174
- >
175
- {!selectedProgram ? <SelectItem text={t('chooseProgram', 'Choose a program')} value="" /> : null}
176
- {eligiblePrograms?.length > 0 &&
177
- eligiblePrograms.map((program) => (
178
- <SelectItem key={program.uuid} text={program.display} value={program.uuid}>
179
- {program.display}
180
- </SelectItem>
181
- ))}
182
- </Select>
181
+ {isTablet ? (
182
+ <Layer>
183
+ <Select
184
+ id="program"
185
+ invalidText={t('required', 'Required')}
186
+ labelText=""
187
+ onChange={(event) => setSelectedProgram(event.target.value)}
188
+ >
189
+ {!selectedProgram ? <SelectItem text={t('chooseProgram', 'Choose a program')} value="" /> : null}
190
+ {eligiblePrograms?.length > 0 &&
191
+ eligiblePrograms.map((program) => (
192
+ <SelectItem key={program.uuid} text={program.display} value={program.uuid}>
193
+ {program.display}
194
+ </SelectItem>
195
+ ))}
196
+ </Select>
197
+ </Layer>
198
+ ) : (
199
+ <Select
200
+ id="program"
201
+ invalidText={t('required', 'Required')}
202
+ labelText=""
203
+ onChange={(event) => setSelectedProgram(event.target.value)}
204
+ >
205
+ {!selectedProgram ? <SelectItem text={t('chooseProgram', 'Choose a program')} value="" /> : null}
206
+ {eligiblePrograms?.length > 0 &&
207
+ eligiblePrograms.map((program) => (
208
+ <SelectItem key={program.uuid} text={program.display} value={program.uuid}>
209
+ {program.display}
210
+ </SelectItem>
211
+ ))}
212
+ </Select>
213
+ )}
183
214
  </div>
184
215
  </FormGroup>
185
216
  <FormGroup style={{ maxWidth: '50%' }} legendText={t('dateEnrolled', 'Date enrolled')}>
186
- <DatePicker
187
- id="enrollmentDate"
188
- datePickerType="single"
189
- dateFormat="d/m/Y"
190
- light={isTablet}
191
- maxDate={new Date().toISOString()}
192
- placeholder="dd/mm/yyyy"
193
- onChange={([date]) => setEnrollmentDate(date)}
194
- value={enrollmentDate}
195
- >
196
- <DatePickerInput id="enrollmentDateInput" labelText="" />
197
- </DatePicker>
217
+ {isTablet ? (
218
+ <Layer>
219
+ <DatePicker
220
+ id="enrollmentDate"
221
+ datePickerType="single"
222
+ dateFormat="d/m/Y"
223
+ maxDate={new Date().toISOString()}
224
+ placeholder="dd/mm/yyyy"
225
+ onChange={([date]) => setEnrollmentDate(date)}
226
+ value={enrollmentDate}
227
+ >
228
+ <DatePickerInput id="enrollmentDateInput" labelText="" />
229
+ </DatePicker>
230
+ </Layer>
231
+ ) : (
232
+ <DatePicker
233
+ id="enrollmentDate"
234
+ datePickerType="single"
235
+ dateFormat="d/m/Y"
236
+ maxDate={new Date().toISOString()}
237
+ placeholder="dd/mm/yyyy"
238
+ onChange={([date]) => setEnrollmentDate(date)}
239
+ value={enrollmentDate}
240
+ >
241
+ <DatePickerInput id="enrollmentDateInput" labelText="" />
242
+ </DatePicker>
243
+ )}
198
244
  </FormGroup>
199
245
  <FormGroup style={{ width: '50%' }} legendText={t('dateCompleted', 'Date completed')}>
200
- <DatePicker
201
- id="completionDate"
202
- datePickerType="single"
203
- dateFormat="d/m/Y"
204
- light={isTablet}
205
- minDate={new Date(enrollmentDate).toISOString()}
206
- maxDate={new Date().toISOString()}
207
- placeholder="dd/mm/yyyy"
208
- onChange={([date]) => setCompletionDate(date)}
209
- value={completionDate}
210
- >
211
- <DatePickerInput id="completionDateInput" labelText="" />
212
- </DatePicker>
246
+ {isTablet ? (
247
+ <Layer>
248
+ <DatePicker
249
+ id="completionDate"
250
+ datePickerType="single"
251
+ dateFormat="d/m/Y"
252
+ minDate={new Date(enrollmentDate).toISOString()}
253
+ maxDate={new Date().toISOString()}
254
+ placeholder="dd/mm/yyyy"
255
+ onChange={([date]) => setCompletionDate(date)}
256
+ value={completionDate}
257
+ >
258
+ <DatePickerInput id="completionDateInput" labelText="" />
259
+ </DatePicker>
260
+ </Layer>
261
+ ) : (
262
+ <DatePicker
263
+ id="completionDate"
264
+ datePickerType="single"
265
+ dateFormat="d/m/Y"
266
+ minDate={new Date(enrollmentDate).toISOString()}
267
+ maxDate={new Date().toISOString()}
268
+ placeholder="dd/mm/yyyy"
269
+ onChange={([date]) => setCompletionDate(date)}
270
+ value={completionDate}
271
+ >
272
+ <DatePickerInput id="completionDateInput" labelText="" />
273
+ </DatePicker>
274
+ )}
213
275
  </FormGroup>
214
276
  <FormGroup style={{ width: '50%' }} legendText={t('enrollmentLocation', 'Enrollment location')}>
215
- <Select
216
- id="location"
217
- invalidText="Required"
218
- labelText=""
219
- light={isTablet}
220
- onChange={(event) => setUserLocation(event.target.value)}
221
- value={userLocation}
222
- >
223
- {!userLocation ? <SelectItem text={t('chooseLocation', 'Choose a location')} value="" /> : null}
224
- {availableLocations?.length > 0 &&
225
- availableLocations.map((location) => (
226
- <SelectItem key={location.uuid} text={location.display} value={location.uuid}>
227
- {location.display}
228
- </SelectItem>
229
- ))}
230
- </Select>
277
+ {isTablet ? (
278
+ <Layer>
279
+ <Select
280
+ id="location"
281
+ invalidText="Required"
282
+ labelText=""
283
+ onChange={(event) => setUserLocation(event.target.value)}
284
+ value={userLocation}
285
+ >
286
+ {!userLocation ? <SelectItem text={t('chooseLocation', 'Choose a location')} value="" /> : null}
287
+ {availableLocations?.length > 0 &&
288
+ availableLocations.map((location) => (
289
+ <SelectItem key={location.uuid} text={location.display} value={location.uuid}>
290
+ {location.display}
291
+ </SelectItem>
292
+ ))}
293
+ </Select>
294
+ </Layer>
295
+ ) : (
296
+ <Select
297
+ id="location"
298
+ invalidText="Required"
299
+ labelText=""
300
+ onChange={(event) => setUserLocation(event.target.value)}
301
+ value={userLocation}
302
+ >
303
+ {!userLocation ? <SelectItem text={t('chooseLocation', 'Choose a location')} value="" /> : null}
304
+ {availableLocations?.length > 0 &&
305
+ availableLocations.map((location) => (
306
+ <SelectItem key={location.uuid} text={location.display} value={location.uuid}>
307
+ {location.display}
308
+ </SelectItem>
309
+ ))}
310
+ </Select>
311
+ )}
231
312
  </FormGroup>
232
313
  </Stack>
233
314
  <ButtonSet className={isTablet ? styles.tablet : styles.desktop}>
@@ -21,6 +21,7 @@
21
21
  "fullyEnrolled": "Enrolled in all programs",
22
22
  "location": "Location",
23
23
  "noEligibleEnrollments": "There are no more programs left to enroll this patient in",
24
+ "noProgramsConfigured": "No programs configured",
24
25
  "programEnrollments": "Program enrollments",
25
26
  "programEnrollmentSaveError": "Error saving program enrollment",
26
27
  "programName": "Program name",