@ampath/esm-dha-workflow-app 4.0.0-next.150 → 4.0.0-next.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/182.js +1 -1
- package/dist/182.js.map +1 -1
- package/dist/4517.js.map +1 -1
- package/dist/7258.js +1 -1
- package/dist/7258.js.map +1 -1
- package/dist/8235.js +1 -1
- package/dist/8235.js.map +1 -1
- package/dist/esm-dha-workflow-app.js.buildmanifest.json +10 -10
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +17 -3
- package/src/registry/registry.component.tsx +47 -10
- package/src/registry/registry.resource.ts +3 -1
- package/src/registry/types/index.ts +1 -0
- package/src/shared/services/eligibility.resource.ts +2 -1
package/dist/8235.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_ampath_esm_dha_workflow_app=globalThis.webpackChunk_ampath_esm_dha_workflow_app||[]).push([[8235],{3754:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__send-to-triage-modal__formSection___8euyX{display:flex;flex-direction:column;width:100%;row-gap:5px;margin-top:15px}.-esm-dha-workflow__send-to-triage-modal__formRow___Hf27O{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__send-to-triage-modal__formControl___Gmnpd{display:flex;flex-direction:column;width:45%;row-gap:5px}.-esm-dha-workflow__send-to-triage-modal__actionSection___Dlgbe{display:flex;flex-direction:row;column-gap:5px;margin-top:15px}.-esm-dha-workflow__send-to-triage-modal__patientAction___ECxUB{display:flex;flex-direction:row;column-gap:5px;margin-top:15px}.-esm-dha-workflow__send-to-triage-modal__greenBtn___wFmfq{background-color:#28a745}.-esm-dha-workflow__send-to-triage-modal__patientBills___ZTQ03{display:flex;flex-direction:column;width:100%}","",{version:3,sources:["webpack://./src/registry/modal/send-to-triage/send-to-triage.modal.scss"],names:[],mappings:"AAAA,8DACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CAEJ,0DACG,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEH,8DACG,YAAA,CACA,qBAAA,CACA,SAAA,CACA,WAAA,CAEH,gEACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,eAAA,CAEJ,gEACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,eAAA,CAEJ,2DACI,wBAAA,CAEJ,+DACI,YAAA,CACA,qBAAA,CACA,UAAA",sourcesContent:[".formSection{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n margin-top: 15px;\n}\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.formControl{\n display: flex;\n flex-direction: column;\n width: 45%;\n row-gap: 5px;\n}\n.actionSection{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n margin-top: 15px;\n}\n.patientAction{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n margin-top: 15px;\n}\n.greenBtn{\n background-color: #28a745;\n}\n.patientBills{\n display: flex;\n flex-direction: column;\n width: 100%;\n}"],sourceRoot:""}]),i.locals={formSection:"-esm-dha-workflow__send-to-triage-modal__formSection___8euyX",formRow:"-esm-dha-workflow__send-to-triage-modal__formRow___Hf27O",formControl:"-esm-dha-workflow__send-to-triage-modal__formControl___Gmnpd",actionSection:"-esm-dha-workflow__send-to-triage-modal__actionSection___Dlgbe",patientAction:"-esm-dha-workflow__send-to-triage-modal__patientAction___ECxUB",greenBtn:"-esm-dha-workflow__send-to-triage-modal__greenBtn___wFmfq",patientBills:"-esm-dha-workflow__send-to-triage-modal__patientBills___ZTQ03"};const l=i},4405:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__otp-input-component__otpDataInput___hnFAW{width:3rem;height:3rem;text-align:center}.-esm-dha-workflow__otp-input-component__otpInputContainer___HV3nG{display:flex;flex-direction:row;column-gap:5px}.-esm-dha-workflow__otp-input-component__otpDataInputContainer___73DPe{width:4rem;height:4rem}","",{version:3,sources:["webpack://./src/shared/ui/otp-input/otp-input.component.scss"],names:[],mappings:"AAAA,8DACE,UAAA,CACA,WAAA,CACA,iBAAA,CAEF,mEACG,YAAA,CACA,kBAAA,CACA,cAAA,CAEH,uEACI,UAAA,CACA,WAAA",sourcesContent:[".otpDataInput{\n width: 3rem;\n height: 3rem;\n text-align: center;\n}\n.otpInputContainer{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n}\n.otpDataInputContainer{\n width: 4rem;\n height: 4rem;\n}"],sourceRoot:""}]),i.locals={otpDataInput:"-esm-dha-workflow__otp-input-component__otpDataInput___hnFAW",otpInputContainer:"-esm-dha-workflow__otp-input-component__otpInputContainer___HV3nG",otpDataInputContainer:"-esm-dha-workflow__otp-input-component__otpDataInputContainer___73DPe"};const l=i},6293:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn{display:flex;flex-direction:column;row-gap:10px;width:100%;padding:15px 15px}.-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn .-esm-dha-workflow__eligibility-details-modal__sectionHeader___hMD54{display:flex;flex-direction:row;width:100%}.-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn .-esm-dha-workflow__eligibility-details-modal__sectionContent___VgS8V{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__eligibility-details-modal__clientDetails___4IEV\\+{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.-esm-dha-workflow__eligibility-details-modal__detailData___TbBdG{display:flex;gap:1rem;margin-bottom:.75rem}.-esm-dha-workflow__eligibility-details-modal__detailText___UiRvJ{min-width:150px}.-esm-dha-workflow__eligibility-details-modal__schemeTable___iwuKx{display:flex;flex-direction:row;min-width:80vw;overflow-x:scroll}","",{version:3,sources:["webpack://./src/registry/eligibility/modal/eligibility-details.modal.scss"],names:[],mappings:"AAAA,sFACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CACA,iBAAA,CACA,2JACI,YAAA,CACA,kBAAA,CACA,UAAA,CAEJ,4JACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAIR,sEACI,YAAA,CACA,6BAAA,CACA,QAAA,CAEJ,kEACI,YAAA,CACA,QAAA,CACA,oBAAA,CAEJ,kEACI,eAAA,CAEJ,mEACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,iBAAA",sourcesContent:[".clientEligibilityDetailsLayout{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n padding: 15px 15px;\n .sectionHeader{\n display: flex;\n flex-direction: row;\n width: 100%;\n }\n .sectionContent{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n }\n}\n\n.clientDetails{\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n}\n.detailData{\n display: flex;\n gap: 1rem;\n margin-bottom: 0.75rem\n}\n.detailText{\n min-width: 150px;\n}\n.schemeTable{\n display: flex;\n flex-direction: row;\n min-width: 80vw;\n overflow-x: scroll;\n}"],sourceRoot:""}]),i.locals={clientEligibilityDetailsLayout:"-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn",sectionHeader:"-esm-dha-workflow__eligibility-details-modal__sectionHeader___hMD54",sectionContent:"-esm-dha-workflow__eligibility-details-modal__sectionContent___VgS8V",clientDetails:"-esm-dha-workflow__eligibility-details-modal__clientDetails___4IEV+",detailData:"-esm-dha-workflow__eligibility-details-modal__detailData___TbBdG",detailText:"-esm-dha-workflow__eligibility-details-modal__detailText___UiRvJ",schemeTable:"-esm-dha-workflow__eligibility-details-modal__schemeTable___iwuKx"};const l=i},6842:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__registry-component__registryLayout___PF4WP{display:flex;flex-direction:row;width:100%;row-gap:10px;padding:2% 2%}.-esm-dha-workflow__registry-component__mainContent___qOmrp{display:flex;flex-direction:column;width:100%}.-esm-dha-workflow__registry-component__registryHeader___YIQ62{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__registry-component__registryContent___W1b-9{display:flex;flex-direction:column;width:100%}.-esm-dha-workflow__registry-component__formRow___qlwjG{display:flex;flex-direction:row;width:100%;column-gap:5px;margin-top:10px}.-esm-dha-workflow__registry-component__formControl___R5c2A{width:30%}.-esm-dha-workflow__registry-component__hieData___jx5gt{margin-top:15px;display:flex;flex-direction:column;width:80%;row-gap:10px}.-esm-dha-workflow__registry-component__btnContainer___aXZfC{padding:5px 5px}.-esm-dha-workflow__registry-component__selectionHeader___-zRam{display:flex;flex-direction:column;width:100%;row-gap:5px}.-esm-dha-workflow__registry-component__patientSelect___wgPYw{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__registry-component__patientSelectRadio___3aGYW{width:70%}.-esm-dha-workflow__registry-component__patientConfirmSelection___Py9-y{display:flex;flex-direction:row;width:30%;column-gap:5px}.-esm-dha-workflow__registry-component__formBtn___ok0W6{display:flex;flex-direction:row;column-gap:5px}.-esm-dha-workflow__registry-component__registrySearchBtn___jHA2M{height:30px}.-esm-dha-workflow__registry-component__principalDependantSection___y\\+Uv2{display:flex;flex-direction:row;width:100%;margin-top:15px}.-esm-dha-workflow__registry-component__dependantCard___BUkYp{display:flex;flex-direction:row;width:30%}.-esm-dha-workflow__registry-component__dependantDetails___ylUb4{display:flex;flex-direction:column;width:100%;row-gap:10px}","",{version:3,sources:["webpack://./src/registry/registry.component.scss"],names:[],mappings:"AAAA,+DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,YAAA,CACA,aAAA,CAEJ,4DACE,YAAA,CACA,qBAAA,CACA,UAAA,CAEF,+DACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,UAAA,CAEJ,wDACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CAEJ,4DACI,SAAA,CAEJ,wDACI,eAAA,CACA,YAAA,CACA,qBAAA,CACA,SAAA,CACA,YAAA,CAEJ,6DACI,eAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CAEJ,8DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEJ,mEACI,SAAA,CAEJ,wEACI,YAAA,CACA,kBAAA,CACA,SAAA,CACA,cAAA,CAEJ,wDACI,YAAA,CACA,kBAAA,CACA,cAAA,CAEJ,kEACI,WAAA,CAEJ,2EACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,eAAA,CAEJ,8DACI,YAAA,CACA,kBAAA,CACA,SAAA,CAEJ,iEACE,YAAA,CACA,qBAAA,CACA,UAAA,CACA,YAAA",sourcesContent:[".registryLayout{\n display: flex;\n flex-direction: row;\n width: 100%;\n row-gap: 10px;\n padding: 2% 2%;\n}\n.mainContent{\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.registryHeader{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n}\n.registryContent{\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n margin-top: 10px;\n}\n.formControl{\n width: 30%;\n}\n.hieData{\n margin-top: 15px;\n display: flex;\n flex-direction: column;\n width: 80%;\n row-gap: 10px;\n}\n.btnContainer{\n padding: 5px 5px;\n}\n.selectionHeader{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n}\n.patientSelect{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.patientSelectRadio{\n width: 70%;\n}\n.patientConfirmSelection{\n display: flex;\n flex-direction: row;\n width: 30%;\n column-gap: 5px;\n}\n.formBtn{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n}\n.registrySearchBtn{\n height: 30px;\n}\n.principalDependantSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n margin-top: 15px;\n}\n.dependantCard{\n display: flex;\n flex-direction: row;\n width: 30%;\n}\n.dependantDetails{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 10px;\n}"],sourceRoot:""}]),i.locals={registryLayout:"-esm-dha-workflow__registry-component__registryLayout___PF4WP",mainContent:"-esm-dha-workflow__registry-component__mainContent___qOmrp",registryHeader:"-esm-dha-workflow__registry-component__registryHeader___YIQ62",registryContent:"-esm-dha-workflow__registry-component__registryContent___W1b-9",formRow:"-esm-dha-workflow__registry-component__formRow___qlwjG",formControl:"-esm-dha-workflow__registry-component__formControl___R5c2A",hieData:"-esm-dha-workflow__registry-component__hieData___jx5gt",btnContainer:"-esm-dha-workflow__registry-component__btnContainer___aXZfC",selectionHeader:"-esm-dha-workflow__registry-component__selectionHeader___-zRam",patientSelect:"-esm-dha-workflow__registry-component__patientSelect___wgPYw",patientSelectRadio:"-esm-dha-workflow__registry-component__patientSelectRadio___3aGYW",patientConfirmSelection:"-esm-dha-workflow__registry-component__patientConfirmSelection___Py9-y",formBtn:"-esm-dha-workflow__registry-component__formBtn___ok0W6",registrySearchBtn:"-esm-dha-workflow__registry-component__registrySearchBtn___jHA2M",principalDependantSection:"-esm-dha-workflow__registry-component__principalDependantSection___y+Uv2",dependantCard:"-esm-dha-workflow__registry-component__dependantCard___BUkYp",dependantDetails:"-esm-dha-workflow__registry-component__dependantDetails___ylUb4"};const l=i},9036:(e,t,n)=>{n.d(t,{A:()=>U});var r=n(16072),a=n.n(r),o=n(93323),i=n(2364),l=n(62801);function c(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function u(e){return(t=function(){var t,n;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(r){switch(r.label){case 0:return[4,(0,l.bo)()];case 1:return t=r.sent(),n="".concat(t,"/eligibility"),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})];case 2:return[2,r.sent().json()]}}))},function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(e){c(o,r,a,i,l,"next",e)}function l(e){c(o,r,a,i,l,"throw",e)}i(void 0)}))})();var t}var s=n(85072),d=n.n(s),f=n(97825),m=n.n(f),p=n(77659),A=n.n(p),h=n(55056),_=n.n(h),y=n(10540),b=n.n(y),v=n(41113),g=n.n(v),w=n(62214),C={};C.styleTagTransform=g(),C.setAttributes=_(),C.insert=A().bind(null,"head"),C.domAPI=m(),C.insertStyleElement=b(),d()(w.A,C);const E=w.A&&w.A.locals?w.A.locals:void 0;var x=n(6293),S={};S.styleTagTransform=g(),S.setAttributes=_(),S.insert=A().bind(null,"head"),S.domAPI=m(),S.insertStyleElement=b(),d()(x.A,S);const I=x.A&&x.A.locals?x.A.locals:void 0,T=function(e){var t=e.hieClientEligibility,n=e.open,r=e.onModalClose;return e.onSubmit,t?a().createElement(a().Fragment,null,a().createElement(i.aFV,{open:n,size:"lg",onSecondarySubmit:r,onRequestClose:r,onRequestSubmit:r,primaryButtonText:"Done",secondaryButtonText:"Cancel"},a().createElement(i.cwr,null,a().createElement("div",{className:I.clientEligibilityDetailsLayout},a().createElement("div",{className:I.sectionHeader},a().createElement("h4",{className:I.sectionTitle},"Patient Eligibilty Details")),a().createElement("div",{className:I.sectionContent},a().createElement("div",{className:I.clientDetails},a().createElement("div",null,a().createElement("div",{className:I.detailData},a().createElement("strong",{className:I.detailText},"Full Name"),a().createElement("span",null,t.fullName)),a().createElement("div",{className:I.detailData},a().createElement("strong",{className:I.detailText},"ID Number"),a().createElement("span",null,t.requestIdNumber)),a().createElement("div",{className:I.detailData},a().createElement("strong",{className:I.detailText},"CR No"),a().createElement("span",null,t.memberCrNumber)),a().createElement("div",{className:I.detailData},a().createElement("strong",{className:I.detailText},"Status"),a().createElement("span",null,t.statusDesc)))),a().createElement("div",{className:I.schemeSection},a().createElement("div",{className:I.sectionHeader},a().createElement("h4",{className:I.sectionTitle},"Scheme Details")),a().createElement("div",{className:I.schemeTable},a().createElement(i.XIK,null,a().createElement(i.ndF,null,a().createElement(i.Hjg,null,a().createElement(i.A0N,null,"No"),a().createElement(i.A0N,null,"Name"),a().createElement(i.A0N,null,"Member Type"),a().createElement(i.A0N,null,"Policy"),a().createElement(i.A0N,null,"Coverage"),a().createElement(i.A0N,null,"Coverage Period"),a().createElement(i.A0N,null,"Coverage Status"),a().createElement(i.A0N,null,"Coverage Reason"),a().createElement(i.A0N,null,"Principal Contributor"),a().createElement(i.A0N,null,"Principal Contributor Employment Type"))),a().createElement(i.BFY,null,t.schemes.map((function(e,t){return a().createElement(i.Hjg,{key:t},a().createElement(i.nA6,null,t+1),a().createElement(i.nA6,null,e.schemeName),a().createElement(i.nA6,null,e.memberType),a().createElement(i.nA6,null,e.policy?a().createElement(a().Fragment,null,e.policy.number," (",e.policy.startDate," - ",e.policy.endDate,")"):a().createElement(a().Fragment,null)),a().createElement(i.nA6,null,a().createElement(i.vwO,{className:"some-class",size:"lg",title:"Status",type:(0,o.HT)(e.coverage.status)},"1"===e.coverage.status?"Active":"Not Active")),a().createElement(i.nA6,null,e.coverage.startDate," - ",e.coverage.endDate),a().createElement(i.nA6,null,e.coverage.message),a().createElement(i.nA6,null,e.coverage.reason),a().createElement(i.nA6,null,e.principalContributor.crNumber," : ",e.principalContributor.name,",",e.principalContributor.relationship),a().createElement(i.nA6,null,e.principalContributor.employmentType))}))))))))))):a().createElement(a().Fragment,null,"No Client data")};var N=n(25987);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(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 U=function(e){var t=e.crId,n=e.locationUuid,l=function(){return(e=function(){var e,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(a){switch(a.label){case 0:if(h(!0),e=function(){var e={requestIdNumber:"",requestIdType:"",locationUuid:n};return t&&(e.requestIdNumber=t,e.requestIdType="3"),e}(),!c(e))return h(!1),[2];a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,u(e)];case 2:return r=a.sent(),m(r),[3,5];case 3:return a.sent(),(0,N.showSnackbar)({kind:"error",title:"Failed getting eligibility status",subtitle:"An error occurred while fetching eligibility status. Please try again or contact support"}),[3,5];case 4:return h(!1),[7];case 5:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){D(o,r,a,i,l,"next",e)}function l(e){D(o,r,a,i,l,"throw",e)}i(void 0)}))})();var e},c=function(e){return!!e.locationUuid&&!!e.requestIdNumber&&!!e.requestIdType},s=function(){b(!1)},d=P((0,r.useState)(),2),f=d[0],m=d[1],p=P((0,r.useState)(!1),2),A=p[0],h=p[1],_=P((0,r.useState)(!1),2),y=_[0],b=_[1];return(0,r.useEffect)((function(){l()}),[t]),t?a().createElement(a().Fragment,null,a().createElement("div",{className:E.eligibilityTagsLayout},A?a().createElement(a().Fragment,null,a().createElement(i.OuH,{description:"Fetching Eligibility data..."})):a().createElement(a().Fragment,null,f?a().createElement(a().Fragment,null,f.schemes&&f.schemes.length>0?a().createElement(a().Fragment,null,f.schemes.map((function(e){return a().createElement("div",null,a().createElement(i.vwO,{className:"some-class",size:"md",title:"Status",type:(0,o.HT)(e.coverage.status)},e.schemeName," : ","1"===e.coverage.status?"Active":"Not Active"))})),a().createElement("div",null,a().createElement(i.$nd,{kind:"ghost",size:"sm",onClick:function(){b(!0)}},"View"))):a().createElement("div",null,a().createElement(i.vwO,{className:"some-class",size:"md",title:"Status",type:"gray"},"No Insurance schemes found"))):a().createElement(a().Fragment,null)),y?a().createElement(a().Fragment,null,a().createElement(T,{onModalClose:s,onSubmit:s,open:y,hieClientEligibility:f})):a().createElement(a().Fragment,null))):a().createElement(a().Fragment,null)}},18548:(e,t,n)=>{n.d(t,{B2:()=>l,lr:()=>s,un:()=>c,zB:()=>u});var r=n(62801);function a(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)}))}}function i(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function l(e,t){return o((function(){var n,r;return i(this,(function(a){switch(a.label){case 0:return[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return(n=a.sent()).ok?[3,3]:[4,n.text()];case 2:throw r=a.sent(),new Error("Request failed with ".concat(n.status,": ").concat(r));case 3:return[2,n.json()]}}))}))()}function c(e){return o((function(){var t,n,a;return i(this,(function(o){switch(o.label){case 0:return[4,(0,r.bo)()];case 1:return t=o.sent(),n="".concat(t,"/client/send-custom-otp"),a={identificationNumber:e.identificationNumber,identificationType:e.identificationType,locationUuid:e.locationUuid},[2,l(n,a)]}}))}))()}function u(e){return o((function(){var t,n,a;return i(this,(function(o){switch(o.label){case 0:return[4,(0,r.bo)()];case 1:return t=o.sent(),n="".concat(t,"/client/validate-custom-otp"),a={sessionId:e.sessionId,otp:e.otp,locationUuid:e.locationUuid},[2,l(n,a)]}}))}))()}function s(e){return o((function(){var t,n,a;return i(this,(function(o){switch(o.label){case 0:return[4,(0,r.bo)()];case 1:return t=o.sent(),n="".concat(t,"/client/search"),a={identificationNumber:e.identificationNumber,identificationType:e.identificationType,locationUuid:e.locationUuid},[2,l(n,a)]}}))}))()}},31577:(e,t,n)=>{n.d(t,{Ar:()=>l,E$:()=>r,GI:()=>a,LQ:()=>i,sF:()=>o});var r=["National ID","Alien ID","Passport","Mandate Number","Refugee ID"],a=function(e){return e.Draft="DRAFT",e.Sent="SENT",e.Verified="VERIFIED",e}({}),o=function(e){return e.Skip="SKIP",e.NoOverride="NO OVERRIDE",e.Override="OVERRIDE",e}({}),i=function(e){return e.NationalID="National ID",e.SHANumber="SHA Number",e.HouseholdNumber="Household Number",e.RefugeeID="Refugee ID",e.AlienID="Alien ID",e.MandateNumber="Mandate Number",e.Cr="id",e.TemporaryDependantID="Temporary Dependant ID",e.BirthCertificate="Birth Certificate",e.BirthNotification="Birth Notification",e}({}),l=function(e){return e.Paying="Paying",e.NonPaying="Non-Paying",e}({})},47455:(e,t,n)=>{n.d(t,{H:()=>r});var r={WALK_IN_UUID:"1671c96d-f281-49bf-b246-c0698f200871",SELF_RERERRAL_UUID:"a8a17d80-1350-11df-a1f1-0026b9348838",REFERRAL_FROM_ANOTHER_FACILITY_UUID:"a095f6aa-9d15-442e-8b21-d9306b82983f",REFERRED_BY_COMMUNITY_HEALTH_WORKER_UUID:"1d54b745-0afc-4568-a9ba-17ba3fc1dda0"}},61978:(e,t,n)=>{n.d(t,{iw:()=>u,xH:()=>l,yn:()=>c});var r=n(25987);function a(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)}))}}function i(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function l(e,t){return o((function(){var n,a;return i(this,(function(o){switch(o.label){case 0:return[4,(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/encounter?patient=").concat(e,"&encounterType=").concat(t,"&v=full"))];case 1:return n=o.sent(),[2,null!==(a=n.data.results)&&void 0!==a?a:[]]}}))}))()}function c(e){return o((function(){var t,n;return i(this,(function(a){switch(a.label){case 0:return[4,(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/encounter?patient=").concat(e,"&v=full"))];case 1:return t=a.sent(),[2,null!==(n=t.data.results)&&void 0!==n?n:[]]}}))}))()}function u(e){return o((function(){var t,n;return i(this,(function(a){switch(a.label){case 0:return t="".concat(r.restBaseUrl,"/encounter"),[4,(0,r.openmrsFetch)(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})];case 1:return[4,a.sent().json()];case 2:return[2,null!=(n=a.sent())?n:null]}}))}))()}},62214:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__eligibility-tags__eligibilityTagsLayout___VNY4e{display:flex;flex-direction:row;width:100%;column-gap:5px}","",{version:3,sources:["webpack://./src/registry/eligibility/eliigibility-tags/eligibility-tags.scss"],names:[],mappings:"AAAA,oEACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA",sourcesContent:[".eligibilityTagsLayout{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}"],sourceRoot:""}]),i.locals={eligibilityTagsLayout:"-esm-dha-workflow__eligibility-tags__eligibilityTagsLayout___VNY4e"};const l=i},68235:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ke});var r=n(2364),a=n(16072),o=n.n(a),i=n(85072),l=n.n(i),c=n(97825),u=n.n(c),s=n(77659),d=n.n(s),f=n(55056),m=n.n(f),p=n(10540),A=n.n(p),h=n(41113),_=n.n(h),y=n(6842),b={};b.styleTagTransform=_(),b.setAttributes=m(),b.insert=d().bind(null,"head"),b.domAPI=u(),b.insertStyleElement=A(),l()(y.A,b);const v=y.A&&y.A.locals?y.A.locals:void 0;var g=n(31577),w=n(18548),C=n(25987),E=n(84497),x={};x.styleTagTransform=_(),x.setAttributes=m(),x.insert=d().bind(null,"head"),x.domAPI=u(),x.insertStyleElement=A(),l()(E.A,x);const S=E.A&&E.A.locals?E.A.locals:void 0;var I=function(e){for(var t=e.split(""),n=0;n<e.length;n++)n%2==0&&(t[n]="*");return t.join("")},T=function(e){for(var t=e.split(""),n=0;n<e.length;n++)0!=n&&n!==e.length-1&&(t[n]="*");return t.join("")},N=function(e){for(var t=e.split(""),n=0;n<e.length;n++)n>3&&n<e.length-3&&(t[n]="*");return t.join("")},k=n(4405),D={};D.styleTagTransform=_(),D.setAttributes=m(),D.insert=d().bind(null,"head"),D.domAPI=u(),D.insertStyleElement=A(),l()(k.A,D);const P=k.A&&k.A.locals?k.A.locals:void 0;function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||R(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.")}()}function R(e,t){if(e){if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}const F=function(e){var t,n,i=e.onChange,l=e.otpLength,c=(t=(0,a.useState)(Array(l).fill("")),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(t,n)||R(t,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.")}()),u=c[0],s=c[1],d=(0,a.useRef)([]);if(!l)return o().createElement(o().Fragment,null,"OTP Length not defined");var f=function(e){d.current[e]&&d.current[e].focus()};return o().createElement("div",{className:P.otpInputContainer,onPaste:function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(t){var n=O(u);t.split("").forEach((function(e,t){n[t]=e})),s(n),null==i||i(n.join("")),f(t.length-1)}}},u.map((function(e,t){return o().createElement("div",{className:P.otpDataInputContainer},o().createElement(r.ksK,{className:P.otpDataInput,key:t,id:"otp-".concat(t),value:e,labelText:"",hideLabel:!0,maxLength:1,inputMode:"numeric",pattern:"[0-9]*",ref:function(e){return d.current[t]=e},onChange:function(e){return function(e,t){if(/^\d?$/.test(e)){var n=O(u);n[t]=e,s(n),e&&t<l-1&&f(t+1),null==i||i(n.join(""))}}(e.target.value,t)},onKeyDown:function(e){return function(e,t){"Backspace"===e.key&&!u[t]&&t>0&&f(t-1)}(e,t)},style:{height:"4rem",width:"4rem",borderStyle:"solid grey",backgroundColor:"#e5ebf7"}}))})))};var B=n(75485),j={};j.styleTagTransform=_(),j.setAttributes=m(),j.insert=d().bind(null,"head"),j.domAPI=u(),j.insertStyleElement=A(),l()(B.A,j);const L=B.A&&B.A.locals?B.A.locals:void 0;function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Y=function(e){var t,n,r,i,l,c,u,s=e.durationInSeconds,d=(e.resetTimer,e.onTimeUp),f=(t=(0,a.useState)(s),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(t,n)||function(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}(t,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.")}()),m=f[0],p=f[1];return(0,a.useEffect)((function(){if(!(m<=0)){var e=setInterval((function(){p((function(e){return e-1}))}),1e3);return function(){return clearInterval(e)}}null==d||d()}),[m]),o().createElement(o().Fragment,null,o().createElement("div",{className:L.timerData},o().createElement("b",null,(l=(r=m)%60,c=(i=Math.floor(r/60))>9?i:"0".concat(i),u=l>9?l:"0".concat(l),"".concat(c,":").concat(u)))))};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function G(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){q(o,r,a,i,l,"next",e)}function l(e){q(o,r,a,i,l,"throw",e)}i(void 0)}))}}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(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 Q(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const W=function(e){var t=e.requestCustomOtpDto,n=e.phoneNumber,i=e.open,l=e.onModalClose,c=e.onOtpSuccessfullVerification,u=J((0,a.useState)(""),2),s=u[0],d=u[1],f=J((0,a.useState)(g.GI.Draft),2),m=f[0],p=f[1],A=J((0,a.useState)(!1),2),h=A[0],_=A[1],y=J((0,a.useState)(""),2),b=y[0],v=y[1],E=J((0,a.useState)(g.sF.NoOverride),2),x=E[0],I=E[1],T=J((0,a.useState)(),2),k=T[0],D=T[1],P=function(){var e,n,r;return e=x===g.sF.Override?(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){V(e,t,n[t])}))}return e}({},t),r=null!=(r={identificationNumber:k})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})),n):t,e},U=function(e,t,n){(0,C.showSnackbar)({kind:e,title:t,subtitle:n})};return o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:i,size:"md",onSecondarySubmit:l,onRequestClose:l,onRequestSubmit:function(){return m===g.GI.Draft?G((function(){var e,n,r;return Q(this,(function(a){switch(a.label){case 0:if(!t.identificationNumber&&!k)return U("error","Invalid Identification Value","Please enter a valid ID value"),[2];_(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,w.un)(P())];case 2:return e=a.sent(),v(e.sessionId),p(g.GI.Sent),U("success","OTP sent successfully","A code was sent to ".concat(e.maskedPhone)),[3,5];case 3:return n=a.sent(),r=n.message||"Failed to send OTP",U("error","Error sending OTP",r),[3,5];case 4:return _(!1),[7];case 5:return[2]}}))}))():m===g.GI.Sent?G((function(){var e,n,r;return Q(this,(function(a){switch(a.label){case 0:if(!s.trim())return U("error","Please enter the OTP code",""),[2];_(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),e={sessionId:b,otp:s,locationUuid:t.locationUuid},[4,(0,w.zB)(e)];case 2:return a.sent(),p(g.GI.Verified),(0,C.showSnackbar)({kind:"success",title:"OTP Verified",subtitle:"You can now fetch data from Client Registry."}),[3,5];case 3:return n=a.sent(),r=n.message||"OTP verification failed",(0,C.showSnackbar)({kind:"error",title:"OTP Verification Failed",subtitle:r}),[3,5];case 4:return _(!1),[7];case 5:return[2]}}))}))():m===g.GI.Verified?c():void 0},primaryButtonText:m===g.GI.Draft?h?"Sending OTP...":"Send OTP":m===g.GI.Sent?h?"Verifying OTP...":"Verify":m===g.GI.Verified?h?"loading...":"Continue":"",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:S.modalVerificationLayout},o().createElement("div",{className:S.sectionHeader},o().createElement("h4",{className:S.sectionTitle},"One Time Password (OTP)")),o().createElement("div",{className:S.sectionContent},o().createElement("div",{className:S.contentHeader},m===g.GI.Draft?o().createElement(o().Fragment,null,o().createElement(r.zWQ,{defaultSelected:g.sF.NoOverride,legendText:"OTP Override",onChange:function(e){return I(t=e),void(t===g.sF.Skip&&p(g.GI.Verified));var t},name:"override-button-default-group"},o().createElement(r.aaP,{id:"no-override",labelText:"Send Code to Phone ".concat(N(n),"?"),value:g.sF.NoOverride}),o().createElement(r.aaP,{id:"override",labelText:"Send OTP to alternative contact",value:g.sF.Override}),o().createElement(r.aaP,{id:"skip",labelText:"Skip OTP",value:g.sF.Skip})),x===g.sF.Override?o().createElement(o().Fragment,null,o().createElement("div",{className:S.formControl},o().createElement(r.ksK,{id:"override-number",labelText:"Use alternative ID number and OTP will be sent to their phone number",onChange:function(e){return t=e.target.value,void D(t);var t},required:!0,placeholder:"Enter National ID"}))):o().createElement(o().Fragment,null)):o().createElement(o().Fragment,null),m===g.GI.Verified?o().createElement(o().Fragment,null,x===g.sF.Skip?o().createElement(o().Fragment,null,o().createElement("h6",null,"OTP Verification Skipped! Continue")):o().createElement(o().Fragment,null,o().createElement("h6",null,"OTP Verification Successfull!"))):o().createElement(o().Fragment,null)),o().createElement("div",{className:S.otpSection},m===g.GI.Sent?o().createElement(o().Fragment,null,o().createElement("div",{className:S.otpForm},o().createElement("h6",null,"(Enter one time password to proceed)"),o().createElement(r.lRv,null,"Enter OTP"),o().createElement(F,{otpLength:5,onChange:function(e){return d(e)}})),o().createElement("div",{className:S.otpTimer},o().createElement(Y,{durationInSeconds:60,resetTimer:function(){},onTimeUp:function(){g.GI.Sent&&p(g.GI.Draft)}}))):o().createElement(o().Fragment,null))),o().createElement("div",{className:S.sectionAction})))))};var z=n(86575),K={};K.styleTagTransform=_(),K.setAttributes=m(),K.insert=d().bind(null,"head"),K.domAPI=u(),K.insertStyleElement=A(),l()(z.A,K);const $=z.A&&z.A.locals?z.A.locals:void 0;function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=["id","other_identifications","first_name","middle_name","last_name","gender","date_of_birth","is_alive","deceased_datetime","phone","email","civil_status","place_of_birth","citizenship","country","county","sub_county","ward","village_estate","longitude","latitude","identification_type"];const ee=function(e){var t=e.client,n=(0,a.useMemo)((function(){return e=t,n={},Object.keys(e).filter((function(e){return Z.includes(e)})).forEach((function(t){if("other_identifications"===t){var r=(o=e[t],i={},o.forEach((function(e){i[e.identification_type]=e.identification_number})),i);n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){X(e,t,n[t])}))}return e}({},n,r)}else if("identification_type"===t)n[e.identification_type]=e.identification_number;else{var a=e[t];n[t]=a}var o,i})),n;var e,n}),[t]);return t&&n?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Field"),o().createElement(r.A0N,null,"Value"))),o().createElement(r.BFY,null,Object.keys(n).map((function(e){return o().createElement(r.Hjg,null,o().createElement(r.nA6,null,e),o().createElement(r.nA6,null,n[e]))}))))):o().createElement(o().Fragment,null,o().createElement("h4",null,"No patient Data to Display"))},te=function(e){var t=e.client,n=e.open,a=e.onModalClose,i=(e.onSubmit,e.onSendClientToTriage);return t?o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:n,size:"lg",onSecondarySubmit:a,onRequestClose:a,onRequestSubmit:function(){return i(t.id)},primaryButtonText:"Send To Triage",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:$.clientDetailsLayout},o().createElement("div",{className:$.sectionHeader},o().createElement("h4",{className:$.sectionTitle},"Patient Details")),o().createElement("div",{className:$.sectionContent},o().createElement(r.tUM,null,o().createElement(r.wbY,{contained:!0},o().createElement(r.ozo,null,"Patient Details")),o().createElement(r.T2N,null,o().createElement(r.KpK,null,o().createElement(ee,{client:t}))))))))):o().createElement(o().Fragment,null,"No Client data")};function ne(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function re(e){return(t=function(){var t,n,r,a;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(o){switch(o.label){case 0:return t="".concat(C.restBaseUrl,"/patient"),n=new URLSearchParams({q:e,v:"full",includeDead:"true",limit:"10",totalCount:"true"}).toString(),[4,(0,C.openmrsFetch)("".concat(t,"?").concat(n))];case 1:return(r=o.sent()).ok?[3,3]:[4,r.text()];case 2:throw a=o.sent(),new Error("Request failed with ".concat(r.status,": ").concat(a));case 3:return[2,r.json()]}}))},function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(e){ne(o,r,a,i,l,"next",e)}function l(e){ne(o,r,a,i,l,"throw",e)}i(void 0)}))})();var t}var ae=n(3754),oe={};oe.styleTagTransform=_(),oe.setAttributes=m(),oe.insert=d().bind(null,"head"),oe.domAPI=u(),oe.insertStyleElement=A(),l()(ae.A,oe);const ie=ae.A&&ae.A.locals?ae.A.locals:void 0;function le(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function ce(e){return(t=function(){var t,n,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(a){switch(a.label){case 0:return t="".concat(C.restBaseUrl,"/location"),n="".concat(t,"/").concat(e),[4,(0,C.openmrsFetch)(n)];case 1:return[4,a.sent().json()];case 2:return[2,null!=(r=a.sent())?r:null]}}))},function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(e){le(o,r,a,i,l,"next",e)}function l(e){le(o,r,a,i,l,"throw",e)}i(void 0)}))})();var t}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function se(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){se(o,r,a,i,l,"next",e)}function l(e){se(o,r,a,i,l,"throw",e)}i(void 0)}))}}function fe(e){return function(e){if(Array.isArray(e))return ue(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 ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(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.")}()}function me(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function pe(e){return de((function(){var t,n,r,a;return me(this,(function(o){switch(o.label){case 0:return t="".concat(C.restBaseUrl,"/queue"),n=new URLSearchParams({v:"custom:(uuid,display,name,description,service:(uuid,display),allowedPriorities:(uuid,display),allowedStatuses:(uuid,display),location:(uuid,display))",location:e}).toString(),[4,(0,C.openmrsFetch)("".concat(t,"?").concat(n))];case 1:return(r=o.sent()).ok?[3,3]:[4,r.text()];case 2:throw a=o.sent(),new Error("Request failed with ".concat(r.status,": ").concat(a));case 3:return[2,r.json()]}}))}))()}function Ae(e){return de((function(){var t,n,r,a,o,i,l,c,u,s;return me(this,(function(d){switch(d.label){case 0:return[4,ce(e)];case 1:return(t=d.sent())&&(n=t.parentLocation)?[4,ce(n.uuid)]:[2];case 2:if(r=d.sent(),o=null!==(a=r.childLocations)&&void 0!==a?a:[],l=null!==(i=o.map((function(e){return e.uuid})))&&void 0!==i?i:[],c=[],!(l.length>0))return[3,6];u=0,d.label=3;case 3:return u<l.length?[4,pe(l[u])]:[3,6];case 4:s=d.sent(),c=fe(c).concat(fe(s.results)),d.label=5;case 5:return u++,[3,3];case 6:return[2,c]}}))}))()}var he=n(75862),_e=n(25838),ye=n(83983),be=n(73143);function ve(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}var ge=n(11314),we=n(61978),Ce=n(47455);function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){xe(o,r,a,i,l,"next",e)}function l(e){xe(o,r,a,i,l,"throw",e)}i(void 0)}))}}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(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 Te(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const Ne=function(e){var t=e.patients,n=e.open,i=e.onModalClose,l=(e.onSubmit,e.client),c=e.onCreateAmrsPatient,u=e.onManualRegistration,s=function(e){var t=e.name.toLowerCase().trim();return t.includes("cash")?Je:t.includes("sha")?Qe:""},d=Ie((0,a.useState)(),2),f=d[0],m=d[1],p=Ie((0,a.useState)(),2),A=p[0],h=p[1],_=Ie((0,a.useState)(),2),y=_[0],b=_[1],v=Ie((0,a.useState)(),2),w=v[0],E=v[1],x=Ie((0,a.useState)(),2),S=x[0],I=x[1],T=Ie((0,a.useState)([]),2),N=T[0],k=T[1],D=Ie((0,a.useState)([]),2),P=D[0],U=D[1],O=Ie((0,a.useState)(null),2),R=O[0],F=O[1],B=Ie((0,a.useState)(null),2),j=B[0],L=B[1],H=Ie((0,a.useState)(""),2),Y=H[0],M=H[1],q=Ie((0,a.useState)(),2),G=q[0],V=q[1],J=Ie((0,a.useState)([]),2),Q=(J[0],J[1]),W=Ie((0,a.useState)([]),2),z=W[0],K=W[1],$=Ie((0,a.useState)(null),2),X=$[0],Z=$[1],ee=Ie((0,a.useState)(null),2),te=ee[0],ne=ee[1],re=Ie((0,a.useState)(""),2),ae=re[0],oe=re[1],le=Ie((0,a.useState)(""),2),ce=le[0],ue=le[1],se=Ie((0,a.useState)(""),2),fe=se[0],pe=se[1],Ee=Ie((0,a.useState)(),2),xe=Ee[0],Ne=Ee[1],ke=Ie((0,a.useState)([]),2),De=ke[0],Pe=ke[1],Ue=Ie((0,a.useState)(!1),2),Oe=Ue[0],Re=Ue[1],Fe=Ie((0,a.useState)(!1),2),Be=Fe[0],je=Fe[1],Le=Ie((0,a.useState)(!1),2),He=Le[0],Ye=Le[1],Me=(0,C.useSession)(),qe=Me.sessionLocation.uuid,Ge=(0,C.useConfig)(),Ve=Ge.registrationBillableServices,Je=Ge.cashConsulationConceptUuid,Qe=Ge.shaConsulationConceptUuid,We=Ge.outPatientCareSettingUuid,ze=Ge.orderEncounterTypeUuid,Ke=Ge.registrationServicequeues,$e=(0,a.useMemo)((function(){return P.filter((function(e){var t;return e&&(null===(t=e.location)||void 0===t?void 0:t.uuid)===qe}))}),[P,qe]),Xe=(0,a.useMemo)((function(){return[{text:"OPD",id:"57d7f623-6a5c-47b2-a1b0-0238b92bea95"},{text:"Inpatient",id:"be7c422a-9f7d-4817-95d0-0e4d451ad153"}]}),[l]),Ze=(0,a.useMemo)((function(){return[{text:"Walk-In",id:Ce.H.WALK_IN_UUID},{text:"Self-Referral",id:Ce.H.SELF_RERERRAL_UUID},{text:"Referral from another Facility",id:Ce.H.REFERRAL_FROM_ANOTHER_FACILITY_UUID},{text:"Referral from Community",id:Ce.H.REFERRED_BY_COMMUNITY_HEALTH_WORKER_UUID}]}),[l]),et=Object.values(g.Ar).map((function(e){return{id:e,label:e}}));if((0,a.useEffect)((function(){Se((function(){var e,t,n,r;return Te(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,Ae(qe)];case 1:return(e=a.sent())&&e.length>0&&(t=function(e){return e.filter((function(e){var t;return Ke.includes(null!==(t=e.uuid)&&void 0!==t?t:"")}))}(e),E(t)),[3,3];case 2:return n=a.sent(),(0,C.showSnackbar)({kind:"error",title:"An error occurred while fetching service queues",subtitle:null!==(r=n.message)&&void 0!==r?r:"An error occurred while fetching service queues, please try agin"}),[3,3];case 3:return[2]}}))}))(),Se((function(){var e;return Te(this,(function(t){switch(t.label){case 0:return[4,(0,ye.x_)()];case 1:return e=t.sent(),k(e),[2]}}))}))(),Se((function(){var e;return Te(this,(function(t){switch(t.label){case 0:return[4,(0,ye.EI)()];case 1:return e=t.sent(),Q(e),function(e){var t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l=o.value;if(l.servicePrices){var c=l.servicePrices,u=!0,s=!1,d=void 0;try{for(var f,m=c[Symbol.iterator]();!(u=(f=m.next()).done);u=!0){var p=f.value;t.push(p)}}catch(e){s=!0,d=e}finally{try{u||null==m.return||m.return()}finally{if(s)throw d}}}}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}K(t)}(e),[2]}}))}))(),Se((function(){var e;return Te(this,(function(t){switch(t.label){case 0:return[4,(0,ye.B3)()];case 1:return e=t.sent(),U(e),[2]}}))}))(),Se((function(){var e,n,r;return Te(this,(function(a){switch(a.label){case 0:if(!t)return[3,4];Pe([]),e=0,a.label=1;case 1:return e<t.length?[4,(c=t[e].uuid,(l=function(){var e,t,n;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(r){switch(r.label){case 0:return e="".concat(C.restBaseUrl,"/billing/bill?v=full&patientUuid=").concat(c),[4,(0,C.openmrsFetch)(e)];case 1:return[4,r.sent().json()];case 2:return t=r.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))},function(){var e=this,t=arguments;return new Promise((function(n,r){var a=l.apply(e,t);function o(e){ve(a,n,r,o,i,"next",e)}function i(e){ve(a,n,r,o,i,"throw",e)}o(void 0)}))})())]:[3,4];case 2:n=a.sent(),o=n,i=new Date,r=o.filter((function(e){var t=new Date(e.dateCreated);return t.getFullYear()===i.getFullYear()&&t.getMonth()===i.getMonth()&&t.getDate()===i.getDate()})),Pe(r),a.label=3;case 3:return e++,[3,1];case 4:return[2]}var o,i,l,c}))}))(),Se((function(){var e,n;return Te(this,(function(r){switch(r.label){case 0:if(!(t&&t.length>0))return[3,4];e=t[0],r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,ge.j3)(e.uuid)];case 2:return n=r.sent(),Ne(n.length>0?n[0]:null),[3,4];case 3:return r.sent(),at("error","Error getting patient active queue",""),[3,4];case 4:return[2]}}))}))()}),[t]),!t)return o().createElement(o().Fragment,null,"No Client data");var tt=function(){return!xe||!xe.queue.uuid||(at("error","Patient already in queue","Patient is already in the ".concat(xe.queue.display," queue, remove them first or contact support")),!1)},nt=function(e){return e.location?e.patient?e.visitType?!!y||(at("error","Please select a patient type",""),!1):(at("error","Please select a visit",""),!1):(at("error","Please select a patient",""),!1):(at("error","Missing location in create visits",""),!1)},rt=function(){var e,t=(e=[],ae&&e.push({attributeType:"3a988e33-a6c0-4b76-b924-01abb998944b",value:ae}),ce&&e.push({attributeType:"aac48226-d143-4274-80e0-264db4e368ee",value:ce}),j&&e.push({attributeType:"8553afa0-bdb9-4d3c-8a98-05fa9350aa85",value:j.uuid}),y&&e.push({attributeType:"fbc0702d-b4c9-4968-be63-af8ad3ad6239",value:y}),G===g.Ar.NonPaying&&e.push({attributeType:"df0362f9-782e-4d92-8bb2-3112e9e9eb3c",value:"true"}),e),n={visitType:A,location:qe,startDatetime:null,stopDatetime:null,patient:null==f?void 0:f.uuid};return t.length>0&&(n.attributes=t),n},at=function(e,t,n){(0,C.showSnackbar)({kind:e,title:t,subtitle:n})};return o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:n,size:"md",onSecondarySubmit:function(){return i({success:!1})},onRequestClose:function(){return i({success:!1})},onRequestSubmit:function(){return Se((function(){var e,t,n,r,a,o,l;return Te(this,(function(c){switch(c.label){case 0:if(Be)return at("error","Form already Submitted","Form has already been submitted, please wait for the visit,queue and bill to be created"),[2];if(je(!0),!function(){if(!f)return at("error","Please select a patient",""),!1;if(!G)return at("error","Please select a paying or non paying option",""),!1;if(!tt())return!1;if(G===g.Ar.Paying){if(!j)return at("error","Please select a payment method",""),!1;if(!te)return at("error","Please select a billable service",""),!1;if(!R)return at("error","Please select a cashpoint",""),!1}return G!==g.Ar.NonPaying||fe?A?S?!!Y||(at("error","Please select a service queue priority",""),!1):(at("error","Please select a service queue",""),!1):(at("error","Please select a visit type",""),!1):(at("error","Please select a patient category",""),!1)}())return je(!1),[2];Ye(!0),c.label=1;case 1:return c.trys.push([1,9,10,11]),[4,Se((function(){var e,t;return Te(this,(function(n){switch(n.label){case 0:return e=rt(),nt(e)?[4,(0,_e._)(e)]:[2,!1];case 1:if(t=n.sent())return at("success","Visit has been created succesfully",""),[2,t];throw at("error","Error creating patient visit",""),new Error("Error creating patient visit")}}))}))()];case 2:return(e=c.sent())?(t=function(e){return{visit:{uuid:e.uuid},queueEntry:{status:{uuid:he.cn.WAITING_UUID},priority:{uuid:null!=Y?Y:he.i3.NORMAL_PRIORITY_UUID},queue:{uuid:S},patient:{uuid:f.uuid},startedAt:e.startDatetime,sortWeight:0}}}(e),[4,(m=t,de((function(){var e,t,n;return me(this,(function(r){switch(r.label){case 0:return e="".concat(C.restBaseUrl,"/visit-queue-entry"),[4,(0,C.openmrsFetch)(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(m)})];case 1:return(t=r.sent()).ok?[3,3]:[4,t.text()];case 2:throw n=r.sent(),new Error("Request failed with ".concat(t.status,": ").concat(n));case 3:return[2,t.json()]}}))}))())]):[3,8];case 3:return(n=c.sent())&&at("success","Patient has succesfully been moved to the Triage queue",""),r=null,G!==g.Ar.Paying?[3,7]:!function(e){return e.patient?e.status?e.cashPoint?!(!e.lineItems||0===e.lineItems.length)||(at("error","Please select a valid billable service",""),!1):(at("error","Please select a valid cashpoint",""),!1):(at("error","Bill does not have a status",""),!1):(at("error","Please select a patient",""),!1)}(a={lineItems:[{billableService:te.billableService.uuid,quantity:1,price:te.price,priceName:te.name,priceUuid:te.uuid,lineItemOrder:0,paymentStatus:"PENDING"}],cashPoint:R.uuid,patient:f.uuid,status:"PENDING",payments:[]})||Oe?[3,6]:[4,(0,ye.Uv)(a)];case 4:return(r=c.sent())&&(Re(!0),at("success","Bill succesfully created","")),[4,(u=f.uuid,d=e.uuid,Se((function(){var e;return Te(this,(function(t){switch(t.label){case 0:e=function(e,t){var n;return{patient:e,location:qe,encounterType:ze,visit:t,obs:[],orders:[{action:"NEW",type:"order",patient:e,careSetting:We,orderer:null!==(n=Me.currentProvider.uuid)&&void 0!==n?n:"pd25871c-1359-11df-a1f1-0026b9348838",encounter:null,concept:s(j),accessionNumber:null,urgency:"ROUTINE",scheduledDate:null}]}}(u,d),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(0,we.iw)(e)];case 2:return t.sent()&&at("success","Consultation order created","Consultation order has been succesfully created"),[3,4];case 3:return t.sent(),at("error","Error creating consulation order","An error occurred while generating the consultation order. Please contact support"),[3,4];case 4:return[2]}}))}))())];case 5:return c.sent(),[3,7];case 6:return[2,!1];case 7:(n&&g.Ar.Paying&&(r||Oe)||n&&g.Ar.NonPaying)&&i({success:!0}),c.label=8;case 8:return[3,11];case 9:return o=c.sent(),je(!1),at("error",null!==(l=o.message)&&void 0!==l?l:"Error creating visit",""),[3,11];case 10:return Ye(!1),[7];case 11:return[2]}var u,d,m}))}))()},primaryButtonText:He?"Sending...please wait":"Send to Triage",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:ie.clientDetailsLayout},o().createElement("div",{className:ie.sectionHeader},o().createElement("h4",{className:ie.sectionTitle},"Send To Triage")),t.length>0?o().createElement("div",{className:ie.sectionContent},o().createElement("div",{className:ie.patientSelect},o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"No"),o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"Gender"),o().createElement(r.A0N,null,"Select Patient"))),o().createElement(r.BFY,null,t.map((function(e,t){return o().createElement(r.Hjg,{key:e.uuid},o().createElement(r.nA6,null,t+1),o().createElement(r.nA6,null,e.person.preferredName.display),o().createElement(r.nA6,null,e.person.gender),o().createElement(r.nA6,null,o().createElement(r.Sc0,{id:e.uuid,labelText:"",onChange:function(){m(e)}})))}))))),o().createElement("div",{className:ie.formSection},o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.a32,{onChange:function(e){var t=e.selectedItem.id;b(t)},id:"patient-type-combobox",items:Ze,itemToString:function(e){return e?e.text:""},titleText:"Patient Type"})),o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"payment-details",labelText:"Payment Details",onChange:function(e){return t=e.target.value,void V(t);var t}},o().createElement(r.ebT,{value:"",text:"Select"}),";",et.map((function(e){return o().createElement(r.ebT,{value:e.id,text:e.label})})))))),o().createElement("div",{className:ie.formSection},G===g.Ar.Paying?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"payment-method",labelText:"Payment Method",onChange:function(e){return function(e){var t=N.find((function(t){return t.uuid===e}));L(t);var n=function(e){var t=[];return z.forEach((function(n){n.paymentMode&&n.paymentMode.uuid===e.uuid&&Ve.includes(n.billableService.uuid)&&t.push(n)})),t}(t);Z(n),oe(""),ue(""),M("")}(e.target.value)}},o().createElement(r.ebT,{value:"",text:"Select"}),";",N&&N.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:e.name})})))),o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"billable-service",labelText:"Billable Services",onChange:function(e){return function(e){var t,n,r=z.find((function(t){return t.uuid===e}));t=r,n=!0,De.forEach((function(e){e.lineItems.forEach((function(e){e.billableService===t.billableService.display&&(n=!1)}))})),n?ne(r):(ne(null),at("error","Existing bill","Patient has a similar bill"))}(e.target.value)}},o().createElement(r.ebT,{value:"",text:"Select"}),";",X&&X.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:"".concat(e.billableService.display,"(").concat(e.name,":").concat(e.price,")")})}))))),j&&j.name.trim().toLowerCase().includes("insurance".trim().toLowerCase())?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.ksK,{id:"insurance-scheme",labelText:"Insurance scheme",onChange:function(e){return function(e){oe(e)}(e.target.value)}})),o().createElement("div",{className:ie.formControl},o().createElement(r.ksK,{id:"policy-number",labelText:"Policy number",onChange:function(e){return function(e){ue(e)}(e.target.value)}})))):o().createElement(o().Fragment,null),o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"cash-point",labelText:"Cash Point",onChange:function(e){return function(e){var t=P.find((function(t){return t.uuid===e}));F(t)}(e.target.value)}},o().createElement(r.ebT,{value:"",text:"Select"}),";",$e&&$e.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:e.name})})))))):o().createElement(o().Fragment,null),G===g.Ar.NonPaying?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"patient-category",labelText:"Patient Category",onChange:function(e){return t=e.target.value,void pe(t);var t}},o().createElement(r.ebT,{value:"",text:"Select"}),";",o().createElement(r.ebT,{value:be.Q.CCC_PATIENT_UUID,text:"CCC"}),";",o().createElement(r.ebT,{value:be.Q.MCH_PATIENT_UUID,text:"MCH"}),";")))):o().createElement(o().Fragment,null)),o().createElement("div",{className:ie.formSection},o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.a32,{onChange:function(e){var t=e.selectedItem.id;h(t)},id:"visit-type-combobox",items:Xe,itemToString:function(e){return e?e.text:""},titleText:"Visit Type"})),o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"service",labelText:"Select a Queue Service",onChange:function(e){if(tt()){var t=e.target.value;I(t)}}},o().createElement(r.ebT,{value:"",text:"Select"}),";",w&&w.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:"".concat(e.display)})}))))),o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"priority",labelText:"Select Priority",onChange:function(e){return t=e.target.value,void M(t);var t}},o().createElement(r.ebT,{value:"",text:"Select"}),";",o().createElement(r.ebT,{value:he.i3.NORMAL_PRIORITY_UUID,text:"PRIORITY"}),";",o().createElement(r.ebT,{value:he.i3.NOT_URGENT_PRIORITY_UUID,text:"NON URGENT"}),";",o().createElement(r.ebT,{value:he.i3.EMERGENCY_PRIORITY_UUID,text:"EMERGENCY"}),";"))))):o().createElement(o().Fragment,null),o().createElement("div",{className:ie.actionSection},0===t.length?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.patientAction},o().createElement("div",{className:ie.btnContainer},o().createElement(r.$nd,{kind:"primary",onClick:function(){return c(l)}},"Automatically Register in AMRS")),o().createElement("div",{className:ie.btnContainer},o().createElement(r.$nd,{kind:"secondary",onClick:u},"Manually Register")))):o().createElement(o().Fragment,null))))))};function ke(e,t){return"".concat(e.first_name," ").concat(T(e.middle_name)," (").concat(e.gender,") (DOB: ").concat(e.date_of_birth,") (").concat(t,") (CR: ").concat(e.id,")")}var De=n(96622);function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ue(e){return function(e){if(Array.isArray(e))return Pe(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 Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(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 Oe=Ue([g.LQ.Cr,g.LQ.SHANumber,g.LQ.HouseholdNumber,g.LQ.RefugeeID,g.LQ.MandateNumber,g.LQ.AlienID,g.LQ.NationalID,g.LQ.TemporaryDependantID]).concat(Ue(["first_name","middle_name","last_name"]),Ue(["gender","date_of_birth","is_alive","deceased_datetime"]),Ue(["phone","email","civil_status","place_of_birth","citizenship"]),Ue(["country","county","sub_county","ward","village_estate","longitude","latitude"]));function Re(e){var t="";switch(e){case"Divorced":t="a899ad58-1350-11df-a1f1-0026b9348838";break;case"Married":t="a8aa76b0-1350-11df-a1f1-0026b9348838";break;case"Single":t="a899ac7c-1350-11df-a1f1-0026b9348838";break;default:t="a89ad3a4-1350-11df-a1f1-0026b9348838"}return t}function Fe(e){var t;switch(e){case g.LQ.NationalID:t=De.N.NATIONAL_ID_UUID;break;case g.LQ.HouseholdNumber:t=De.N.HOUSE_HOLD_NUMBER_UUID;break;case g.LQ.AlienID:t=De.N.ALIEN_ID_UUID;break;case g.LQ.SHANumber:t=De.N.SHA_UUID;break;case g.LQ.MandateNumber:t=De.N.MANDATE_NUMBER_UUID;break;case g.LQ.RefugeeID:t=De.N.REFUGEE_ID_UUID;break;case g.LQ.Cr:t=De.N.CLIENT_REGISTRY_NO_UUID;break;case g.LQ.BirthCertificate:t=De.N.BIRTH_CERTIFICATE_NUMBER_UUID;break;case g.LQ.TemporaryDependantID:t=De.N.TEMPORARY_DEPENDANT_ID_UUID;break;case g.LQ.BirthNotification:t=De.N.BIRTH_NOTIFICATION_UUID}return t}var Be=n(62801);function je(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Le(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){je(o,r,a,i,l,"next",e)}function l(e){je(o,r,a,i,l,"throw",e)}i(void 0)}))}}function He(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}var Ye=function(e,t){return Le((function(){var n,r;return He(this,(function(a){switch(a.label){case 0:return[4,Le((function(){var e,t,n,r;return He(this,(function(a){switch(a.label){case 0:return[4,(0,Be.E$)()];case 1:return e=a.sent(),t=new AbortController,[4,(0,C.openmrsFetch)("".concat(e,"/amrs-id-generator/generateidentifier"),{headers:{"Content-Type":"application/json"},method:"POST",body:{user:1},signal:t.signal})];case 2:return[4,a.sent().json()];case 3:return n=a.sent(),[2,null!==(r=n.identifier)&&void 0!==r?r:""]}}))}))()];case 1:return n=a.sent(),r=function(e,t){var n=[];return n.push({identifierType:Fe(g.LQ.Cr),identifier:e.id,location:t}),n.push({identifierType:Fe(e.identification_type),identifier:e.identification_number,location:t}),n}(t,e),r.push({identifierType:De.N.AMRS_UNIVERSAL_ID_UUID,identifier:n,location:e,preferred:!0}),[2,r]}}))}))()};function Me(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function qe(e,t){return(n=function(){var n,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(a){switch(a.label){case 0:return n=function(e){var t={},n={},r={},a=[];Oe.forEach((function(o){"first_name"===o&&(n.givenName=e.first_name),"middle_name"===o&&(n.middleName=e.middle_name),"last_name"===o&&(n.familyName=e.last_name),"gender"===o&&(t.gender="Male"===e.gender?"M":"F"),"date_of_birth"===o&&(t.birthdate=e.date_of_birth,t.birthdateEstimated=!1),"is_alive"===o&&(t.dead=0===e.is_alive),"deceased_datetime"===o&&e.deceased_datetime.length>0&&(t.deathDate=e.deceased_datetime),"country"===o&&e.country.length>0&&(r.country=e.country,r.address1=e.country),"place_of_birth"===o&&e.place_of_birth.length>0&&(r.address10=e.place_of_birth),"county"===o&&e.county.length>0&&(r.countyDistrict=e.county),"sub_county"===o&&e.sub_county.length>0&&(r.address2=e.sub_county,r.stateProvince=e.sub_county),"ward"===o&&e.sub_county.length>0&&(r.address7=e.sub_county,r.address4=e.sub_county),"village_estate"===o&&e.village_estate.length>0&&(r.cityVillage=e.village_estate),"longitude"===o&&e.longitude.length>0&&(r.longitude=e.longitude),"latitude"===o&&e.latitude.length>0&&(r.latitude=e.latitude),"place_of_birth"===o&&e.place_of_birth.length>0&&a.push({value:e.place_of_birth,attributeType:"8d8718c2-c2cc-11de-8d13-0010c6dffd0f"}),"phone"===o&&e.phone.length>0&&a.push({value:e.phone,attributeType:"72a759a8-1359-11df-a1f1-0026b9348838"}),"email"===o&&e.email.length>0&&a.push({value:e.email,attributeType:"2f65dbcb-3e58-45a3-8be7-fd1dc9aa0faa"}),"civil_status"===o&&e.civil_status.length>0&&a.push({value:Re(e.civil_status),attributeType:"8d871f2a-c2cc-11de-8d13-0010c6dffd0f"}),"id"===o&&e.id&&a.push({value:e.id,attributeType:"e068e02b-faac-4baf-bd58-fe6e0c29a81f"}),"citizenship"===o&&e.citizenship&&a.push({value:e.citizenship,attributeType:"8d871afc-c2cc-11de-8d13-0010c6dffd0f"})}));var o=function(e){var t=[],n=e.find((function(e){return"Alternative Phone Number"===e.relationship})),r=e.find((function(e){return"Next Of Kin"===e.remarks}));return n&&"Phone"===n.contact_type&&t.push({value:n.contact_id,attributeType:"c725f524-c14a-4468-ac19-4a0e6661c930"}),r&&("Phone"===r.contact_type&&t.push({value:r.contact_id,attributeType:"a657a4f1-9c0f-444b-a1fd-445bb91dd12d"}),t.push({value:r.relationship,attributeType:"5730994e-c267-426b-87b6-c152b606973d"}),t.push({value:r.contact_name,attributeType:"72a75bec-1359-11df-a1f1-0026b9348838"})),t}(e.alternative_contacts);return a=Ue(a).concat(Ue(o)),Object.keys(n).length>0&&(t.names=[n]),Object.keys(r).length>0&&(t.addresses=[r]),a.length>0&&(t.attributes=a),t}(e),[4,Ye(t,e)];case 1:return r=a.sent(),[4,(o={person:n,identifiers:r},Le((function(){return He(this,(function(e){switch(e.label){case 0:return[4,(0,C.openmrsFetch)("".concat(C.restBaseUrl,"/patient"),{method:"POST",headers:{"Content-Type":"application/json"},body:o})];case 1:return[2,e.sent()]}}))}))())];case 2:return[4,a.sent().json()];case 3:return[2,a.sent()]}var o}))},function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(e){Me(o,r,a,i,l,"next",e)}function l(e){Me(o,r,a,i,l,"throw",e)}i(void 0)}))})();var n}var Ge=n(9036);function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Je(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Qe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Je(o,r,a,i,l,"next",e)}function l(e){Je(o,r,a,i,l,"throw",e)}i(void 0)}))}}function We(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ve(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 ze(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const Ke=function(){var e=We((0,a.useState)("National ID"),2),t=e[0],n=e[1],i=We((0,a.useState)(""),2),l=i[0],c=i[1],u=We((0,a.useState)(!1),2),s=u[0],d=u[1],f=We((0,a.useState)(),2),m=f[0],p=f[1],A=We((0,a.useState)(),2),h=A[0],_=A[1],y=We((0,a.useState)([]),2),b=y[0],E=y[1],x=We((0,a.useState)("principal"),2),S=x[0],N=x[1],k=We((0,a.useState)(!1),2),D=k[0],P=k[1],U=We((0,a.useState)(!1),2),O=U[0],R=U[1],F=We((0,a.useState)(!1),2),B=F[0],j=F[1],L=We((0,a.useState)(),2),H=L[0],Y=L[1],M=(0,C.useSession)().sessionLocation.uuid,q=function(e,t,n){(0,C.showSnackbar)({kind:e,title:t,subtitle:n})},G=function(){R(!1)},V=function(){window.location.href="".concat(window.spaBase,"/patient-registration")},J=function(){return"principal"===S?m:"dependants"===S?h:m},Q=function(){p(null),_(null),E([]),N(null),c(""),n("National ID"),R(!1),P(!1),j(!1),N("principal")};return o().createElement(o().Fragment,null,o().createElement("div",{className:v.registryLayout},o().createElement("div",{className:v.mainContent},o().createElement("div",{className:v.registryHeader},o().createElement("h4",null,"Client Registry"),o().createElement("p",null,"Please enter identification number to begin")),o().createElement("div",{className:v.registryContent},o().createElement("div",{className:v.formRow},o().createElement("div",{className:v.formControl},o().createElement(r.msM,{id:"identifier-type-dropdown",label:"Identifier Type",titleText:"Select Identifier Type",items:g.E$,selectedItem:t,onChange:function(e){var t=e.selectedItem;return n(t)}})),o().createElement("div",{className:v.formControl},o().createElement(r.ksK,{id:"identifier-value",labelText:"".concat(t," Value"),value:l,onChange:function(e){return c(e.target.value)},placeholder:"Enter ".concat(t.toLowerCase()," value")}))),o().createElement("div",{className:v.formRow},o().createElement("div",{className:v.formControl},o().createElement("div",{className:v.formBtn},o().createElement(r.$nd,{className:v.registrySearchBtn,kind:"primary",onClick:function(){return Qe((function(){var e,n,r,a,o,i;return ze(this,(function(c){switch(c.label){case 0:d(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),function(e){return e.identificationNumber?e.identificationType?!!e.locationUuid||(q("error","No default location selected",""),!1):(q("error","Please enter a valid identification type",""),!1):(q("error","Please enter a valid identification number",""),!1)}(e={identificationNumber:l,identificationType:t,locationUuid:M})?(Y(e),[4,(0,w.lr)(e)]):[2,!1];case 2:if(n=c.sent(),0===(r=Array.isArray(n)?n:[]).length)throw Q(),new Error("No matching patient found in Client Registry.");return a=r[0],p(a),q("success","Client Data Loaded","Patient fetched successfully"),[3,5];case 3:return o=c.sent(),i=o.message||"Failed to fetch client data",Q(),q("error","Fetch Failed",i),[3,5];case 4:return d(!1),[7];case 5:return[2]}}))}))()},disabled:s},s?o().createElement(r.OuH,{description:"Searching..."}):"Search"),o().createElement(r.$nd,{className:v.registrySearchBtn,kind:"secondary",onClick:V},"Emergency Registration"),m?o().createElement(o().Fragment,null):o().createElement(r.$nd,{className:v.registrySearchBtn,kind:"tertiary",onClick:function(){window.open("https://afyayangu.go.ke/","_blank")}},"Register on Afya Yangu")))),m?o().createElement("div",{className:v.formRow},o().createElement("div",{className:v.hieData},o().createElement("div",{className:v.selectionHeader},o().createElement("h5",null,"Please select one patient and request patient to share the OTP sent")),o().createElement("div",{className:v.patientSelect},o().createElement("div",{className:v.patientSelectRadio},o().createElement(r.zWQ,{defaultSelected:"principal",legendText:"Patient",onChange:function(e){N(e)},name:"radio-button-default-group"},o().createElement(r.aaP,{id:"principal",labelText:"Principal",value:"principal"}),o().createElement(r.aaP,{id:"dependants",labelText:"Dependants",value:"dependants"}))),o().createElement("div",{className:v.patientConfirmSelection},o().createElement("div",{className:v.btnContainer},o().createElement(r.$nd,{kind:"primary",onClick:function(){P(!0)}}," ","Confirm")),o().createElement("div",{className:v.btnContainer},o().createElement(r.$nd,{kind:"secondary",onClick:Q},"Cancel")))),o().createElement("div",{className:v.principalDependantSection},"principal"===S?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"CR"),o().createElement(r.A0N,null,"Phone No"),o().createElement(r.A0N,null,"ID No"),o().createElement(r.A0N,null,"Eligibility Status"))),o().createElement(r.BFY,null,o().createElement(r.Hjg,null,o().createElement(r.nA6,null,m.first_name," ",T(m.middle_name)," ",T(m.last_name)),o().createElement(r.nA6,null,I(m.id)),o().createElement(r.nA6,null,I(m.phone)),o().createElement(r.nA6,null,I(m.identification_number)),o().createElement(r.nA6,null,o().createElement(Ge.A,{crId:m.id,locationUuid:M})))))):o().createElement(o().Fragment,null),"dependants"===S?o().createElement(o().Fragment,null,o().createElement("div",{className:v.dependantDetails},o().createElement("div",null,o().createElement(r.zWQ,{defaultSelected:"",helperText:"",invalidText:"",legendText:"",name:"dependant-group",onChange:function(e){return function(e){var t=m.dependants;if(t.length>0){var n=t.find((function(t){return t.result[0].id===e}));n&&_(n.result[0])}}(e)}},m.dependants.map((function(e){var t=e.result[0],n=e.relationship;return o().createElement(r.aaP,{id:t.id,labelText:ke(t,n),value:t.id})})))),o().createElement("div",null,h?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"CR"),o().createElement(r.A0N,null,"Eligibility Status"))),o().createElement(r.BFY,null,o().createElement(r.Hjg,null,o().createElement(r.nA6,null,h.first_name," ",T(h.middle_name)," ",T(h.last_name)),o().createElement(r.nA6,null,I(h.id)),o().createElement(r.nA6,null,o().createElement(Ge.A,{crId:h.id,locationUuid:M})))))):o().createElement(o().Fragment,null)))):o().createElement(o().Fragment,null),D?o().createElement(W,{requestCustomOtpDto:H,phoneNumber:m.phone,open:D,onModalClose:function(){P(!1)},onOtpSuccessfullVerification:function(){P(!1),R(!0)}}):o().createElement(o().Fragment,null),m&&O?o().createElement(o().Fragment,null,o().createElement(te,{client:J(),open:O,onModalClose:G,onSubmit:function(){},onSendClientToTriage:function(e){return Qe((function(){var t,n,r;return ze(this,(function(a){switch(a.label){case 0:return G(),[4,re(e)];case 1:return(t=a.sent()).totalCount>0?(q("success","".concat(t.totalCount," ").concat(t.totalCount>0?"Patients":"Patient"," found in the system with ").concat(e),""),o=e,i=null!==(n=t.results)&&void 0!==n?n:[],r=i.filter((function(e){return e.identifiers.some((function(e){return e.identifier===o&&e.identifierType.uuid===De.N.CLIENT_REGISTRY_NO_UUID}))})),E(r),j(!0)):(q("error","Patient not found in the system",""),E([]),j(!0)),[2]}var o,i}))}))()}})," "):o().createElement(o().Fragment,null),m&&B?o().createElement(o().Fragment,null,o().createElement(Ne,{client:J(),patients:b,open:B,onModalClose:function(e){j(!1),e&&e.success&&(window.location.href="".concat(window.spaBase,"/home/triage"))},onSubmit:function(){},onCreateAmrsPatient:function(){return Qe((function(){var e,t,n,r,a,o,i,l,c,u,s,d;return ze(this,(function(f){switch(f.label){case 0:if(!(e=J()))return q("error","Principal or dependant not selected",""),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,qe(e,M)];case 2:return(t=f.sent())&&(q("success","Patient created succesfully",""),E([t])),[3,4];case 3:if(n=f.sent(),a=null!==(r=n.responseBody)&&void 0!==r?r:n.message,q("error","Error Creating Patient",""),o=function(e){var t=[];if(e&&e.error)if(e.error.error){var n=e.error.error.globalErrors||null;if(n){var r=!0,a=!1,o=void 0;try{for(var i,l=n[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var c=i.value;t.push(c.message)}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}}}else if(e.error)if(e.error.globalErrors){var u=e.error.globalErrors||null;if(u){var s=!0,d=!1,f=void 0;try{for(var m,p=u[Symbol.iterator]();!(s=(m=p.next()).done);s=!0){var A=m.value;t.push(A.message)}}catch(e){d=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(d)throw f}}}}else e.error.message&&t.push(e.error.message);else t.push(e.error.error.message||"An error occurred while creating the patient. Please try again or contact support");return t}(a),o&&o.length>0){i=!0,l=!1,c=void 0;try{for(u=o[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)d=s.value,q("error",d,"")}catch(e){l=!0,c=e}finally{try{i||null==u.return||u.return()}finally{if(l)throw c}}}return[3,4];case 4:return[2]}}))}))()},onManualRegistration:function(){j(!1),V()}})):o().createElement(o().Fragment,null)))):o().createElement(o().Fragment,null)))))}},73143:(e,t,n)=>{n.d(t,{Q:()=>r});var r={CCC_PATIENT_UUID:"a8a3899a-1350-11df-a1f1-0026b9348838",MCH_PATIENT_UUID:"a8a17d80-1350-11df-a1f1-0026b9348838"}},75485:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__timer-component__timerData___FgxzS{height:3rem;font-size:30px;color:#0055a5}","",{version:3,sources:["webpack://./src/shared/ui/timer/timer.component.scss"],names:[],mappings:"AAAA,uDACG,WAAA,CACA,cAAA,CACA,aAAA",sourcesContent:[".timerData{\n height: 3rem;\n font-size: 30px;\n color: #0055a5;\n}"],sourceRoot:""}]),i.locals={timerData:"-esm-dha-workflow__timer-component__timerData___FgxzS"};const l=i},83983:(e,t,n)=>{n.d(t,{B3:()=>s,EI:()=>c,Uv:()=>u,x_:()=>l});var r=n(25987);function a(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)}))}}function i(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function l(){return o((function(){var e,t,n;return i(this,(function(a){switch(a.label){case 0:return e="".concat(r.restBaseUrl,"/billing/paymentMode"),[4,(0,r.openmrsFetch)(e)];case 1:return[4,a.sent().json()];case 2:return t=a.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))}))()}function c(){return o((function(){var e,t,n;return i(this,(function(a){switch(a.label){case 0:return e="".concat(r.restBaseUrl,"/billing/billableService"),[4,(0,r.openmrsFetch)("".concat(e,"?v=").concat("full"))];case 1:return[4,a.sent().json()];case 2:return t=a.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))}))()}function u(e){return o((function(){var t,n,a;return i(this,(function(o){switch(o.label){case 0:return t="".concat(r.restBaseUrl,"/billing/bill"),[4,(0,r.openmrsFetch)(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})];case 1:return[4,o.sent().json()];case 2:return n=o.sent(),[2,null!==(a=n.results)&&void 0!==a?a:[]]}}))}))()}function s(){return o((function(){var e,t,n;return i(this,(function(a){switch(a.label){case 0:return e="".concat(r.restBaseUrl,"/billing/cashPoint?v=").concat("full"),[4,(0,r.openmrsFetch)(e)];case 1:return[4,a.sent().json()];case 2:return t=a.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))}))()}},84497:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__otp-verification-modal__modalVerificationLayout___MST8n{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__otp-verification-modal__sectionHeader___g62oo{display:flex;flex-direction:column;column-gap:5px;margin-top:5px;margin-bottom:5px}.-esm-dha-workflow__otp-verification-modal__otpSection___R\\+cLH{display:flex;flex-direction:row;width:100%;column-gap:15px}.-esm-dha-workflow__otp-verification-modal__otpForm___6EDu\\+{display:flex;flex-direction:column;width:60%;row-gap:20px}.-esm-dha-workflow__otp-verification-modal__otpTimer___ckBNm{display:flex;flex-direction:column;width:50%;padding-top:15%}.-esm-dha-workflow__otp-verification-modal__formRow___8sAxU{display:flex;flex-direction:row;width:100%;column-gap:5px;margin-top:10px}.-esm-dha-workflow__otp-verification-modal__formControl___nN1HY{width:70%;margin-top:10px}","",{version:3,sources:["webpack://./src/registry/modal/otp-verification-modal/otp-verification-modal.scss"],names:[],mappings:"AAAA,4EACE,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAEF,kEACE,YAAA,CACA,qBAAA,CACA,cAAA,CACA,cAAA,CACA,iBAAA,CAEF,gEACE,YAAA,CACA,kBAAA,CACA,UAAA,CACA,eAAA,CAEF,6DACE,YAAA,CACA,qBAAA,CACA,SAAA,CACA,YAAA,CAEF,6DACE,YAAA,CACA,qBAAA,CACA,SAAA,CACA,eAAA,CAGF,4DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CAEJ,gEACI,SAAA,CACA,eAAA",sourcesContent:[".modalVerificationLayout {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n}\n.sectionHeader{\n display: flex;\n flex-direction: column;\n column-gap: 5px;\n margin-top: 5px;\n margin-bottom: 5px;\n}\n.otpSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 15px;\n}\n.otpForm{\n display: flex;\n flex-direction: column;\n width: 60%;\n row-gap: 20px;\n}\n.otpTimer{\n display: flex;\n flex-direction: column;\n width: 50%;\n padding-top: 15%;\n}\n\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n margin-top: 10px;\n}\n.formControl{\n width: 70%;\n margin-top: 10px;\n}\n"],sourceRoot:""}]),i.locals={modalVerificationLayout:"-esm-dha-workflow__otp-verification-modal__modalVerificationLayout___MST8n",sectionHeader:"-esm-dha-workflow__otp-verification-modal__sectionHeader___g62oo",otpSection:"-esm-dha-workflow__otp-verification-modal__otpSection___R+cLH",otpForm:"-esm-dha-workflow__otp-verification-modal__otpForm___6EDu+",otpTimer:"-esm-dha-workflow__otp-verification-modal__otpTimer___ckBNm",formRow:"-esm-dha-workflow__otp-verification-modal__formRow___8sAxU",formControl:"-esm-dha-workflow__otp-verification-modal__formControl___nN1HY"};const l=i},86575:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__client-details-modal__clientDetailsLayout___r5WF\\+{display:flex;flex-direction:column;width:100%;row-gap:5px}.-esm-dha-workflow__client-details-modal__sectionHeader___lH-gL{display:flex;flex-direction:column;row-gap:5px;margin-top:5px;margin-bottom:10px}.-esm-dha-workflow__client-details-modal__sectionContent___QDFT7{display:flex;flex-direction:column;row-gap:5px}.-esm-dha-workflow__client-details-modal__actionSection___okVDp{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__client-details-modal__btnContainer___ETNEk{margin-top:2px;margin-bottom:2px}","",{version:3,sources:["webpack://./src/registry/modal/client-details-modal/client-details-modal.scss"],names:[],mappings:"AAAA,uEACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,WAAA,CACA,cAAA,CACA,kBAAA,CAEJ,iEACI,YAAA,CACA,qBAAA,CACA,WAAA,CAEJ,gEACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEJ,+DACI,cAAA,CACA,iBAAA",sourcesContent:[".clientDetailsLayout{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n}\n.sectionHeader{\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n margin-top: 5px;\n margin-bottom: 10px;\n}\n.sectionContent{\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n}\n.actionSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.btnContainer{\n margin-top: 2px;\n margin-bottom: 2px;\n}"],sourceRoot:""}]),i.locals={clientDetailsLayout:"-esm-dha-workflow__client-details-modal__clientDetailsLayout___r5WF+",sectionHeader:"-esm-dha-workflow__client-details-modal__sectionHeader___lH-gL",sectionContent:"-esm-dha-workflow__client-details-modal__sectionContent___QDFT7",actionSection:"-esm-dha-workflow__client-details-modal__actionSection___okVDp",btnContainer:"-esm-dha-workflow__client-details-modal__btnContainer___ETNEk"};const l=i},96622:(e,t,n)=>{n.d(t,{N:()=>r});var r={HOUSE_HOLD_NUMBER_UUID:"bb74b20e-dcee-4f59-bdf1-2dffc3abf106",SHA_UUID:"cf5362b2-8049-4442-b3c6-36f870e320cb",CLIENT_REGISTRY_NO_UUID:"e88dc246-3614-4ee3-8141-1f2a83054e72",NATIONAL_ID_UUID:"58a47054-1359-11df-a1f1-0026b9348838",PROVIDER_NATIONAL_ID_UUID:"4550df92-c684-4597-8ab8-d6b10eabdcfb",REFUGEE_ID_UUID:"465e81af-8d69-47e9-9127-53a94adc75fb",MANDATE_NUMBER_UUID:"aae2d097-20ba-43ca-9b71-fd8296068f39",ALIEN_ID_UUID:"12f5b147-3403-4a73-913d-7ded9ffec094",TEMPORARY_DEPENDANT_ID_UUID:"a3d34214-93e8-4faf-bf4d-0272eee079eb",AMRS_UNIVERSAL_ID_UUID:"58a4732e-1359-11df-a1f1-0026b9348838",UPI_NUMBER_UUID:"cba702b9-4664-4b43-83f1-9ab473cbd64d",BIRTH_CERTIFICATE_NUMBER_UUID:"7924e13b-131a-4da8-8efa-e294184a1b0d",BIRTH_NOTIFICATION_UUID:"10a4349d-dd1b-4b0c-bd35-a00a22394266"}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_ampath_esm_dha_workflow_app=globalThis.webpackChunk_ampath_esm_dha_workflow_app||[]).push([[8235],{3754:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__send-to-triage-modal__formSection___8euyX{display:flex;flex-direction:column;width:100%;row-gap:5px;margin-top:15px}.-esm-dha-workflow__send-to-triage-modal__formRow___Hf27O{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__send-to-triage-modal__formControl___Gmnpd{display:flex;flex-direction:column;width:45%;row-gap:5px}.-esm-dha-workflow__send-to-triage-modal__actionSection___Dlgbe{display:flex;flex-direction:row;column-gap:5px;margin-top:15px}.-esm-dha-workflow__send-to-triage-modal__patientAction___ECxUB{display:flex;flex-direction:row;column-gap:5px;margin-top:15px}.-esm-dha-workflow__send-to-triage-modal__greenBtn___wFmfq{background-color:#28a745}.-esm-dha-workflow__send-to-triage-modal__patientBills___ZTQ03{display:flex;flex-direction:column;width:100%}","",{version:3,sources:["webpack://./src/registry/modal/send-to-triage/send-to-triage.modal.scss"],names:[],mappings:"AAAA,8DACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CAEJ,0DACG,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEH,8DACG,YAAA,CACA,qBAAA,CACA,SAAA,CACA,WAAA,CAEH,gEACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,eAAA,CAEJ,gEACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,eAAA,CAEJ,2DACI,wBAAA,CAEJ,+DACI,YAAA,CACA,qBAAA,CACA,UAAA",sourcesContent:[".formSection{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n margin-top: 15px;\n}\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.formControl{\n display: flex;\n flex-direction: column;\n width: 45%;\n row-gap: 5px;\n}\n.actionSection{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n margin-top: 15px;\n}\n.patientAction{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n margin-top: 15px;\n}\n.greenBtn{\n background-color: #28a745;\n}\n.patientBills{\n display: flex;\n flex-direction: column;\n width: 100%;\n}"],sourceRoot:""}]),i.locals={formSection:"-esm-dha-workflow__send-to-triage-modal__formSection___8euyX",formRow:"-esm-dha-workflow__send-to-triage-modal__formRow___Hf27O",formControl:"-esm-dha-workflow__send-to-triage-modal__formControl___Gmnpd",actionSection:"-esm-dha-workflow__send-to-triage-modal__actionSection___Dlgbe",patientAction:"-esm-dha-workflow__send-to-triage-modal__patientAction___ECxUB",greenBtn:"-esm-dha-workflow__send-to-triage-modal__greenBtn___wFmfq",patientBills:"-esm-dha-workflow__send-to-triage-modal__patientBills___ZTQ03"};const l=i},4405:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__otp-input-component__otpDataInput___hnFAW{width:3rem;height:3rem;text-align:center}.-esm-dha-workflow__otp-input-component__otpInputContainer___HV3nG{display:flex;flex-direction:row;column-gap:5px}.-esm-dha-workflow__otp-input-component__otpDataInputContainer___73DPe{width:4rem;height:4rem}","",{version:3,sources:["webpack://./src/shared/ui/otp-input/otp-input.component.scss"],names:[],mappings:"AAAA,8DACE,UAAA,CACA,WAAA,CACA,iBAAA,CAEF,mEACG,YAAA,CACA,kBAAA,CACA,cAAA,CAEH,uEACI,UAAA,CACA,WAAA",sourcesContent:[".otpDataInput{\n width: 3rem;\n height: 3rem;\n text-align: center;\n}\n.otpInputContainer{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n}\n.otpDataInputContainer{\n width: 4rem;\n height: 4rem;\n}"],sourceRoot:""}]),i.locals={otpDataInput:"-esm-dha-workflow__otp-input-component__otpDataInput___hnFAW",otpInputContainer:"-esm-dha-workflow__otp-input-component__otpInputContainer___HV3nG",otpDataInputContainer:"-esm-dha-workflow__otp-input-component__otpDataInputContainer___73DPe"};const l=i},6293:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn{display:flex;flex-direction:column;row-gap:10px;width:100%;padding:15px 15px}.-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn .-esm-dha-workflow__eligibility-details-modal__sectionHeader___hMD54{display:flex;flex-direction:row;width:100%}.-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn .-esm-dha-workflow__eligibility-details-modal__sectionContent___VgS8V{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__eligibility-details-modal__clientDetails___4IEV\\+{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.-esm-dha-workflow__eligibility-details-modal__detailData___TbBdG{display:flex;gap:1rem;margin-bottom:.75rem}.-esm-dha-workflow__eligibility-details-modal__detailText___UiRvJ{min-width:150px}.-esm-dha-workflow__eligibility-details-modal__schemeTable___iwuKx{display:flex;flex-direction:row;min-width:80vw;overflow-x:scroll}","",{version:3,sources:["webpack://./src/registry/eligibility/modal/eligibility-details.modal.scss"],names:[],mappings:"AAAA,sFACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CACA,iBAAA,CACA,2JACI,YAAA,CACA,kBAAA,CACA,UAAA,CAEJ,4JACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAIR,sEACI,YAAA,CACA,6BAAA,CACA,QAAA,CAEJ,kEACI,YAAA,CACA,QAAA,CACA,oBAAA,CAEJ,kEACI,eAAA,CAEJ,mEACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,iBAAA",sourcesContent:[".clientEligibilityDetailsLayout{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n padding: 15px 15px;\n .sectionHeader{\n display: flex;\n flex-direction: row;\n width: 100%;\n }\n .sectionContent{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n }\n}\n\n.clientDetails{\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n}\n.detailData{\n display: flex;\n gap: 1rem;\n margin-bottom: 0.75rem\n}\n.detailText{\n min-width: 150px;\n}\n.schemeTable{\n display: flex;\n flex-direction: row;\n min-width: 80vw;\n overflow-x: scroll;\n}"],sourceRoot:""}]),i.locals={clientEligibilityDetailsLayout:"-esm-dha-workflow__eligibility-details-modal__clientEligibilityDetailsLayout___1TkAn",sectionHeader:"-esm-dha-workflow__eligibility-details-modal__sectionHeader___hMD54",sectionContent:"-esm-dha-workflow__eligibility-details-modal__sectionContent___VgS8V",clientDetails:"-esm-dha-workflow__eligibility-details-modal__clientDetails___4IEV+",detailData:"-esm-dha-workflow__eligibility-details-modal__detailData___TbBdG",detailText:"-esm-dha-workflow__eligibility-details-modal__detailText___UiRvJ",schemeTable:"-esm-dha-workflow__eligibility-details-modal__schemeTable___iwuKx"};const l=i},6842:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__registry-component__registryLayout___PF4WP{display:flex;flex-direction:row;width:100%;row-gap:10px;padding:2% 2%}.-esm-dha-workflow__registry-component__mainContent___qOmrp{display:flex;flex-direction:column;width:100%}.-esm-dha-workflow__registry-component__registryHeader___YIQ62{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__registry-component__registryContent___W1b-9{display:flex;flex-direction:column;width:100%}.-esm-dha-workflow__registry-component__formRow___qlwjG{display:flex;flex-direction:row;width:100%;column-gap:5px;margin-top:10px}.-esm-dha-workflow__registry-component__formControl___R5c2A{width:30%}.-esm-dha-workflow__registry-component__hieData___jx5gt{margin-top:15px;display:flex;flex-direction:column;width:80%;row-gap:10px}.-esm-dha-workflow__registry-component__btnContainer___aXZfC{padding:5px 5px}.-esm-dha-workflow__registry-component__selectionHeader___-zRam{display:flex;flex-direction:column;width:100%;row-gap:5px}.-esm-dha-workflow__registry-component__patientSelect___wgPYw{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__registry-component__patientSelectRadio___3aGYW{width:70%}.-esm-dha-workflow__registry-component__patientConfirmSelection___Py9-y{display:flex;flex-direction:row;width:30%;column-gap:5px}.-esm-dha-workflow__registry-component__formBtn___ok0W6{display:flex;flex-direction:row;column-gap:5px}.-esm-dha-workflow__registry-component__registrySearchBtn___jHA2M{height:30px}.-esm-dha-workflow__registry-component__principalDependantSection___y\\+Uv2{display:flex;flex-direction:row;width:100%;margin-top:15px}.-esm-dha-workflow__registry-component__dependantCard___BUkYp{display:flex;flex-direction:row;width:30%}.-esm-dha-workflow__registry-component__dependantDetails___ylUb4{display:flex;flex-direction:column;width:100%;row-gap:10px}","",{version:3,sources:["webpack://./src/registry/registry.component.scss"],names:[],mappings:"AAAA,+DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,YAAA,CACA,aAAA,CAEJ,4DACE,YAAA,CACA,qBAAA,CACA,UAAA,CAEF,+DACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,UAAA,CAEJ,wDACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CAEJ,4DACI,SAAA,CAEJ,wDACI,eAAA,CACA,YAAA,CACA,qBAAA,CACA,SAAA,CACA,YAAA,CAEJ,6DACI,eAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CAEJ,8DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEJ,mEACI,SAAA,CAEJ,wEACI,YAAA,CACA,kBAAA,CACA,SAAA,CACA,cAAA,CAEJ,wDACI,YAAA,CACA,kBAAA,CACA,cAAA,CAEJ,kEACI,WAAA,CAEJ,2EACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,eAAA,CAEJ,8DACI,YAAA,CACA,kBAAA,CACA,SAAA,CAEJ,iEACE,YAAA,CACA,qBAAA,CACA,UAAA,CACA,YAAA",sourcesContent:[".registryLayout{\n display: flex;\n flex-direction: row;\n width: 100%;\n row-gap: 10px;\n padding: 2% 2%;\n}\n.mainContent{\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.registryHeader{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n}\n.registryContent{\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n margin-top: 10px;\n}\n.formControl{\n width: 30%;\n}\n.hieData{\n margin-top: 15px;\n display: flex;\n flex-direction: column;\n width: 80%;\n row-gap: 10px;\n}\n.btnContainer{\n padding: 5px 5px;\n}\n.selectionHeader{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n}\n.patientSelect{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.patientSelectRadio{\n width: 70%;\n}\n.patientConfirmSelection{\n display: flex;\n flex-direction: row;\n width: 30%;\n column-gap: 5px;\n}\n.formBtn{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n}\n.registrySearchBtn{\n height: 30px;\n}\n.principalDependantSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n margin-top: 15px;\n}\n.dependantCard{\n display: flex;\n flex-direction: row;\n width: 30%;\n}\n.dependantDetails{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 10px;\n}"],sourceRoot:""}]),i.locals={registryLayout:"-esm-dha-workflow__registry-component__registryLayout___PF4WP",mainContent:"-esm-dha-workflow__registry-component__mainContent___qOmrp",registryHeader:"-esm-dha-workflow__registry-component__registryHeader___YIQ62",registryContent:"-esm-dha-workflow__registry-component__registryContent___W1b-9",formRow:"-esm-dha-workflow__registry-component__formRow___qlwjG",formControl:"-esm-dha-workflow__registry-component__formControl___R5c2A",hieData:"-esm-dha-workflow__registry-component__hieData___jx5gt",btnContainer:"-esm-dha-workflow__registry-component__btnContainer___aXZfC",selectionHeader:"-esm-dha-workflow__registry-component__selectionHeader___-zRam",patientSelect:"-esm-dha-workflow__registry-component__patientSelect___wgPYw",patientSelectRadio:"-esm-dha-workflow__registry-component__patientSelectRadio___3aGYW",patientConfirmSelection:"-esm-dha-workflow__registry-component__patientConfirmSelection___Py9-y",formBtn:"-esm-dha-workflow__registry-component__formBtn___ok0W6",registrySearchBtn:"-esm-dha-workflow__registry-component__registrySearchBtn___jHA2M",principalDependantSection:"-esm-dha-workflow__registry-component__principalDependantSection___y+Uv2",dependantCard:"-esm-dha-workflow__registry-component__dependantCard___BUkYp",dependantDetails:"-esm-dha-workflow__registry-component__dependantDetails___ylUb4"};const l=i},9036:(e,t,n)=>{n.d(t,{A:()=>U});var r=n(16072),a=n.n(r),o=n(93323),i=n(2364),l=n(25987),c=n(62801);function u(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function s(e){return(t=function(){var t,n;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(r){switch(r.label){case 0:return[4,(0,c.bo)()];case 1:return t=r.sent(),n="".concat(t,"/eligibility"),[4,(0,l.openmrsFetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})];case 2:return[2,r.sent().json()]}}))},function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(e){u(o,r,a,i,l,"next",e)}function l(e){u(o,r,a,i,l,"throw",e)}i(void 0)}))})();var t}var d=n(85072),f=n.n(d),m=n(97825),p=n.n(m),A=n(77659),h=n.n(A),_=n(55056),y=n.n(_),b=n(10540),v=n.n(b),g=n(41113),w=n.n(g),C=n(62214),E={};E.styleTagTransform=w(),E.setAttributes=y(),E.insert=h().bind(null,"head"),E.domAPI=p(),E.insertStyleElement=v(),f()(C.A,E);const x=C.A&&C.A.locals?C.A.locals:void 0;var S=n(6293),I={};I.styleTagTransform=w(),I.setAttributes=y(),I.insert=h().bind(null,"head"),I.domAPI=p(),I.insertStyleElement=v(),f()(S.A,I);const N=S.A&&S.A.locals?S.A.locals:void 0,T=function(e){var t=e.hieClientEligibility,n=e.open,r=e.onModalClose;return e.onSubmit,t?a().createElement(a().Fragment,null,a().createElement(i.aFV,{open:n,size:"lg",onSecondarySubmit:r,onRequestClose:r,onRequestSubmit:r,primaryButtonText:"Done",secondaryButtonText:"Cancel"},a().createElement(i.cwr,null,a().createElement("div",{className:N.clientEligibilityDetailsLayout},a().createElement("div",{className:N.sectionHeader},a().createElement("h4",{className:N.sectionTitle},"Patient Eligibilty Details")),a().createElement("div",{className:N.sectionContent},a().createElement("div",{className:N.clientDetails},a().createElement("div",null,a().createElement("div",{className:N.detailData},a().createElement("strong",{className:N.detailText},"Full Name"),a().createElement("span",null,t.fullName)),a().createElement("div",{className:N.detailData},a().createElement("strong",{className:N.detailText},"ID Number"),a().createElement("span",null,t.requestIdNumber)),a().createElement("div",{className:N.detailData},a().createElement("strong",{className:N.detailText},"CR No"),a().createElement("span",null,t.memberCrNumber)),a().createElement("div",{className:N.detailData},a().createElement("strong",{className:N.detailText},"Status"),a().createElement("span",null,t.statusDesc)))),a().createElement("div",{className:N.schemeSection},a().createElement("div",{className:N.sectionHeader},a().createElement("h4",{className:N.sectionTitle},"Scheme Details")),a().createElement("div",{className:N.schemeTable},a().createElement(i.XIK,null,a().createElement(i.ndF,null,a().createElement(i.Hjg,null,a().createElement(i.A0N,null,"No"),a().createElement(i.A0N,null,"Name"),a().createElement(i.A0N,null,"Member Type"),a().createElement(i.A0N,null,"Policy"),a().createElement(i.A0N,null,"Coverage"),a().createElement(i.A0N,null,"Coverage Period"),a().createElement(i.A0N,null,"Coverage Status"),a().createElement(i.A0N,null,"Coverage Reason"),a().createElement(i.A0N,null,"Principal Contributor"),a().createElement(i.A0N,null,"Principal Contributor Employment Type"))),a().createElement(i.BFY,null,t.schemes.map((function(e,t){return a().createElement(i.Hjg,{key:t},a().createElement(i.nA6,null,t+1),a().createElement(i.nA6,null,e.schemeName),a().createElement(i.nA6,null,e.memberType),a().createElement(i.nA6,null,e.policy?a().createElement(a().Fragment,null,e.policy.number," (",e.policy.startDate," - ",e.policy.endDate,")"):a().createElement(a().Fragment,null)),a().createElement(i.nA6,null,a().createElement(i.vwO,{className:"some-class",size:"lg",title:"Status",type:(0,o.HT)(e.coverage.status)},"1"===e.coverage.status?"Active":"Not Active")),a().createElement(i.nA6,null,e.coverage.startDate," - ",e.coverage.endDate),a().createElement(i.nA6,null,e.coverage.message),a().createElement(i.nA6,null,e.coverage.reason),a().createElement(i.nA6,null,e.principalContributor.crNumber," : ",e.principalContributor.name,",",e.principalContributor.relationship),a().createElement(i.nA6,null,e.principalContributor.employmentType))}))))))))))):a().createElement(a().Fragment,null,"No Client data")};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(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 U=function(e){var t=e.crId,n=e.locationUuid,c=function(){return(e=function(){var e,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(a){switch(a.label){case 0:if(_(!0),e=function(){var e={requestIdNumber:"",requestIdType:"",locationUuid:n};return t&&(e.requestIdNumber=t,e.requestIdType="3"),e}(),!u(e))return _(!1),[2];a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,s(e)];case 2:return r=a.sent(),p(r),[3,5];case 3:return a.sent(),(0,l.showSnackbar)({kind:"error",title:"Failed getting eligibility status",subtitle:"An error occurred while fetching eligibility status. Please try again or contact support"}),[3,5];case 4:return _(!1),[7];case 5:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){D(o,r,a,i,l,"next",e)}function l(e){D(o,r,a,i,l,"throw",e)}i(void 0)}))})();var e},u=function(e){return!!e.locationUuid&&!!e.requestIdNumber&&!!e.requestIdType},d=function(){v(!1)},f=P((0,r.useState)(),2),m=f[0],p=f[1],A=P((0,r.useState)(!1),2),h=A[0],_=A[1],y=P((0,r.useState)(!1),2),b=y[0],v=y[1];return(0,r.useEffect)((function(){c()}),[t]),t?a().createElement(a().Fragment,null,a().createElement("div",{className:x.eligibilityTagsLayout},h?a().createElement(a().Fragment,null,a().createElement(i.OuH,{description:"Fetching Eligibility data..."})):a().createElement(a().Fragment,null,m?a().createElement(a().Fragment,null,m.schemes&&m.schemes.length>0?a().createElement(a().Fragment,null,m.schemes.map((function(e){return a().createElement("div",null,a().createElement(i.vwO,{className:"some-class",size:"md",title:"Status",type:(0,o.HT)(e.coverage.status)},e.schemeName," : ","1"===e.coverage.status?"Active":"Not Active"))})),a().createElement("div",null,a().createElement(i.$nd,{kind:"ghost",size:"sm",onClick:function(){v(!0)}},"View"))):a().createElement("div",null,a().createElement(i.vwO,{className:"some-class",size:"md",title:"Status",type:"gray"},"No Insurance schemes found"))):a().createElement(a().Fragment,null)),b?a().createElement(a().Fragment,null,a().createElement(T,{onModalClose:d,onSubmit:d,open:b,hieClientEligibility:m})):a().createElement(a().Fragment,null))):a().createElement(a().Fragment,null)}},18548:(e,t,n)=>{n.d(t,{B2:()=>c,lr:()=>d,un:()=>u,zB:()=>s});var r=n(25987),a=n(62801);function o(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function l(e){o(i,r,a,l,c,"next",e)}function c(e){o(i,r,a,l,c,"throw",e)}l(void 0)}))}}function l(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function c(e,t){return i((function(){var n,a;return l(this,(function(o){switch(o.label){case 0:return[4,(0,r.openmrsFetch)(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return(n=o.sent()).ok?[3,3]:[4,n.text()];case 2:throw a=o.sent(),new Error("Request failed with ".concat(n.status,": ").concat(a));case 3:return[2,n.json()]}}))}))()}function u(e){return i((function(){var t,n,r;return l(this,(function(o){switch(o.label){case 0:return[4,(0,a.bo)()];case 1:return t=o.sent(),n="".concat(t,"/client/send-custom-otp"),r={identificationNumber:e.identificationNumber,identificationType:e.identificationType,locationUuid:e.locationUuid,phoneNumber:e.phoneNumber},[2,c(n,r)]}}))}))()}function s(e){return i((function(){var t,n,r;return l(this,(function(o){switch(o.label){case 0:return[4,(0,a.bo)()];case 1:return t=o.sent(),n="".concat(t,"/client/validate-custom-otp"),r={sessionId:e.sessionId,otp:e.otp,locationUuid:e.locationUuid},[2,c(n,r)]}}))}))()}function d(e){return i((function(){var t,n,r;return l(this,(function(o){switch(o.label){case 0:return[4,(0,a.bo)()];case 1:return t=o.sent(),n="".concat(t,"/client/search"),r={identificationNumber:e.identificationNumber,identificationType:e.identificationType,locationUuid:e.locationUuid},[2,c(n,r)]}}))}))()}},31577:(e,t,n)=>{n.d(t,{Ar:()=>l,E$:()=>r,GI:()=>a,LQ:()=>i,sF:()=>o});var r=["National ID","Alien ID","Passport","Mandate Number","Refugee ID"],a=function(e){return e.Draft="DRAFT",e.Sent="SENT",e.Verified="VERIFIED",e}({}),o=function(e){return e.Skip="SKIP",e.NoOverride="NO OVERRIDE",e.Override="OVERRIDE",e}({}),i=function(e){return e.NationalID="National ID",e.SHANumber="SHA Number",e.HouseholdNumber="Household Number",e.RefugeeID="Refugee ID",e.AlienID="Alien ID",e.MandateNumber="Mandate Number",e.Cr="id",e.TemporaryDependantID="Temporary Dependant ID",e.BirthCertificate="Birth Certificate",e.BirthNotification="Birth Notification",e}({}),l=function(e){return e.Paying="Paying",e.NonPaying="Non-Paying",e}({})},47455:(e,t,n)=>{n.d(t,{H:()=>r});var r={WALK_IN_UUID:"1671c96d-f281-49bf-b246-c0698f200871",SELF_RERERRAL_UUID:"a8a17d80-1350-11df-a1f1-0026b9348838",REFERRAL_FROM_ANOTHER_FACILITY_UUID:"a095f6aa-9d15-442e-8b21-d9306b82983f",REFERRED_BY_COMMUNITY_HEALTH_WORKER_UUID:"1d54b745-0afc-4568-a9ba-17ba3fc1dda0"}},61978:(e,t,n)=>{n.d(t,{iw:()=>u,xH:()=>l,yn:()=>c});var r=n(25987);function a(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)}))}}function i(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function l(e,t){return o((function(){var n,a;return i(this,(function(o){switch(o.label){case 0:return[4,(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/encounter?patient=").concat(e,"&encounterType=").concat(t,"&v=full"))];case 1:return n=o.sent(),[2,null!==(a=n.data.results)&&void 0!==a?a:[]]}}))}))()}function c(e){return o((function(){var t,n;return i(this,(function(a){switch(a.label){case 0:return[4,(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/encounter?patient=").concat(e,"&v=full"))];case 1:return t=a.sent(),[2,null!==(n=t.data.results)&&void 0!==n?n:[]]}}))}))()}function u(e){return o((function(){var t,n;return i(this,(function(a){switch(a.label){case 0:return t="".concat(r.restBaseUrl,"/encounter"),[4,(0,r.openmrsFetch)(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})];case 1:return[4,a.sent().json()];case 2:return[2,null!=(n=a.sent())?n:null]}}))}))()}},62214:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__eligibility-tags__eligibilityTagsLayout___VNY4e{display:flex;flex-direction:row;width:100%;column-gap:5px}","",{version:3,sources:["webpack://./src/registry/eligibility/eliigibility-tags/eligibility-tags.scss"],names:[],mappings:"AAAA,oEACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA",sourcesContent:[".eligibilityTagsLayout{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}"],sourceRoot:""}]),i.locals={eligibilityTagsLayout:"-esm-dha-workflow__eligibility-tags__eligibilityTagsLayout___VNY4e"};const l=i},68235:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ke});var r=n(2364),a=n(16072),o=n.n(a),i=n(85072),l=n.n(i),c=n(97825),u=n.n(c),s=n(77659),d=n.n(s),f=n(55056),m=n.n(f),p=n(10540),A=n.n(p),h=n(41113),_=n.n(h),y=n(6842),b={};b.styleTagTransform=_(),b.setAttributes=m(),b.insert=d().bind(null,"head"),b.domAPI=u(),b.insertStyleElement=A(),l()(y.A,b);const v=y.A&&y.A.locals?y.A.locals:void 0;var g=n(31577),w=n(18548),C=n(25987),E=n(84497),x={};x.styleTagTransform=_(),x.setAttributes=m(),x.insert=d().bind(null,"head"),x.domAPI=u(),x.insertStyleElement=A(),l()(E.A,x);const S=E.A&&E.A.locals?E.A.locals:void 0;var I=function(e){for(var t=e.split(""),n=0;n<e.length;n++)n%2==0&&(t[n]="*");return t.join("")},N=function(e){for(var t=e.split(""),n=0;n<e.length;n++)0!=n&&n!==e.length-1&&(t[n]="*");return t.join("")},T=function(e){for(var t=e.split(""),n=0;n<e.length;n++)n>3&&n<e.length-3&&(t[n]="*");return t.join("")},k=n(4405),D={};D.styleTagTransform=_(),D.setAttributes=m(),D.insert=d().bind(null,"head"),D.domAPI=u(),D.insertStyleElement=A(),l()(k.A,D);const P=k.A&&k.A.locals?k.A.locals:void 0;function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||R(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.")}()}function R(e,t){if(e){if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}const F=function(e){var t,n,i=e.onChange,l=e.otpLength,c=(t=(0,a.useState)(Array(l).fill("")),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(t,n)||R(t,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.")}()),u=c[0],s=c[1],d=(0,a.useRef)([]);if(!l)return o().createElement(o().Fragment,null,"OTP Length not defined");var f=function(e){d.current[e]&&d.current[e].focus()};return o().createElement("div",{className:P.otpInputContainer,onPaste:function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(t){var n=O(u);t.split("").forEach((function(e,t){n[t]=e})),s(n),null==i||i(n.join("")),f(t.length-1)}}},u.map((function(e,t){return o().createElement("div",{className:P.otpDataInputContainer},o().createElement(r.ksK,{className:P.otpDataInput,key:t,id:"otp-".concat(t),value:e,labelText:"",hideLabel:!0,maxLength:1,inputMode:"numeric",pattern:"[0-9]*",ref:function(e){return d.current[t]=e},onChange:function(e){return function(e,t){if(/^\d?$/.test(e)){var n=O(u);n[t]=e,s(n),e&&t<l-1&&f(t+1),null==i||i(n.join(""))}}(e.target.value,t)},onKeyDown:function(e){return function(e,t){"Backspace"===e.key&&!u[t]&&t>0&&f(t-1)}(e,t)},style:{height:"4rem",width:"4rem",borderStyle:"solid grey",backgroundColor:"#e5ebf7"}}))})))};var B=n(75485),j={};j.styleTagTransform=_(),j.setAttributes=m(),j.insert=d().bind(null,"head"),j.domAPI=u(),j.insertStyleElement=A(),l()(B.A,j);const L=B.A&&B.A.locals?B.A.locals:void 0;function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Y=function(e){var t,n,r,i,l,c,u,s=e.durationInSeconds,d=(e.resetTimer,e.onTimeUp),f=(t=(0,a.useState)(s),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(t,n)||function(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}(t,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.")}()),m=f[0],p=f[1];return(0,a.useEffect)((function(){if(!(m<=0)){var e=setInterval((function(){p((function(e){return e-1}))}),1e3);return function(){return clearInterval(e)}}null==d||d()}),[m]),o().createElement(o().Fragment,null,o().createElement("div",{className:L.timerData},o().createElement("b",null,(l=(r=m)%60,c=(i=Math.floor(r/60))>9?i:"0".concat(i),u=l>9?l:"0".concat(l),"".concat(c,":").concat(u)))))};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function G(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){q(o,r,a,i,l,"next",e)}function l(e){q(o,r,a,i,l,"throw",e)}i(void 0)}))}}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(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 Q(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const W=function(e){var t=e.requestCustomOtpDto,n=e.phoneNumber,i=e.open,l=e.onModalClose,c=e.onOtpSuccessfullVerification,u=J((0,a.useState)(""),2),s=u[0],d=u[1],f=J((0,a.useState)(g.GI.Draft),2),m=f[0],p=f[1],A=J((0,a.useState)(!1),2),h=A[0],_=A[1],y=J((0,a.useState)(""),2),b=y[0],v=y[1],E=J((0,a.useState)(g.sF.NoOverride),2),x=E[0],I=E[1],N=J((0,a.useState)(),2),k=N[0],D=N[1],P=J((0,a.useState)(),2),U=P[0],O=P[1],R=function(){var e,n,r;return e=x===g.sF.Override?(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){V(e,t,n[t])}))}return e}({},t),r=null!=(r={identificationNumber:null!=k?k:"",phoneNumber:null!=U?U:""})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})),n):t,e},B=function(e,t,n){(0,C.showSnackbar)({kind:e,title:t,subtitle:n})};return o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:i,size:"md",onSecondarySubmit:l,onRequestClose:l,onRequestSubmit:function(){return m===g.GI.Draft?G((function(){var e,n,r;return Q(this,(function(a){switch(a.label){case 0:if(!t.identificationNumber&&!k)return B("error","Invalid Identification Value","Please enter a valid ID value"),[2];_(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,w.un)(R())];case 2:return e=a.sent(),v(e.sessionId),p(g.GI.Sent),B("success","OTP sent successfully","A code was sent to ".concat(e.maskedPhone)),[3,5];case 3:return n=a.sent(),r=n.message||"Failed to send OTP",B("error","Error sending OTP",r),[3,5];case 4:return _(!1),[7];case 5:return[2]}}))}))():m===g.GI.Sent?G((function(){var e,n,r;return Q(this,(function(a){switch(a.label){case 0:if(!s.trim())return B("error","Please enter the OTP code",""),[2];_(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),e={sessionId:b,otp:s,locationUuid:t.locationUuid},[4,(0,w.zB)(e)];case 2:return a.sent(),p(g.GI.Verified),(0,C.showSnackbar)({kind:"success",title:"OTP Verified",subtitle:"You can now fetch data from Client Registry."}),[3,5];case 3:return n=a.sent(),r=n.message||"OTP verification failed",(0,C.showSnackbar)({kind:"error",title:"OTP Verification Failed",subtitle:r}),[3,5];case 4:return _(!1),[7];case 5:return[2]}}))}))():m===g.GI.Verified?c():void 0},primaryButtonText:m===g.GI.Draft?h?"Sending OTP...":"Send OTP":m===g.GI.Sent?h?"Verifying OTP...":"Verify":m===g.GI.Verified?h?"loading...":"Continue":"",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:S.modalVerificationLayout},o().createElement("div",{className:S.sectionHeader},o().createElement("h4",{className:S.sectionTitle},"One Time Password (OTP)")),o().createElement("div",{className:S.sectionContent},o().createElement("div",{className:S.contentHeader},m===g.GI.Draft?o().createElement(o().Fragment,null,o().createElement(r.zWQ,{defaultSelected:g.sF.NoOverride,legendText:"OTP Override",onChange:function(e){return I(t=e),void(t===g.sF.Skip&&p(g.GI.Verified));var t},name:"override-button-default-group"},o().createElement(r.aaP,{id:"no-override",labelText:"Send Code to Phone ".concat(T(n),"?"),value:g.sF.NoOverride}),o().createElement(r.aaP,{id:"override",labelText:"Send OTP to alternative contact",value:g.sF.Override}),o().createElement(r.aaP,{id:"skip",labelText:"Skip OTP",value:g.sF.Skip})),x===g.sF.Override?o().createElement(o().Fragment,null,o().createElement("div",{className:S.formControl},o().createElement(r.ksK,{id:"override-number",labelText:"Alternative ID number",onChange:function(e){return t=e.target.value,void D(t);var t},required:!0,placeholder:"Enter National ID"})),o().createElement("div",{className:S.formControl},o().createElement(r.ksK,{id:"override-phone",labelText:"Alternative Phone number",onChange:function(e){return function(e){O(e)}(e.target.value)},required:!0,placeholder:"Enter Phone Number"}))):o().createElement(o().Fragment,null)):o().createElement(o().Fragment,null),m===g.GI.Verified?o().createElement(o().Fragment,null,x===g.sF.Skip?o().createElement(o().Fragment,null,o().createElement("h6",null,"OTP Verification Skipped! Continue")):o().createElement(o().Fragment,null,o().createElement("h6",null,"OTP Verification Successfull!"))):o().createElement(o().Fragment,null)),o().createElement("div",{className:S.otpSection},m===g.GI.Sent?o().createElement(o().Fragment,null,o().createElement("div",{className:S.otpForm},o().createElement("h6",null,"(Enter one time password to proceed)"),o().createElement(r.lRv,null,"Enter OTP"),o().createElement(F,{otpLength:5,onChange:function(e){return d(e)}})),o().createElement("div",{className:S.otpTimer},o().createElement(Y,{durationInSeconds:60,resetTimer:function(){},onTimeUp:function(){g.GI.Sent&&p(g.GI.Draft)}}))):o().createElement(o().Fragment,null))),o().createElement("div",{className:S.sectionAction})))))};var z=n(86575),K={};K.styleTagTransform=_(),K.setAttributes=m(),K.insert=d().bind(null,"head"),K.domAPI=u(),K.insertStyleElement=A(),l()(z.A,K);const $=z.A&&z.A.locals?z.A.locals:void 0;function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=["id","other_identifications","first_name","middle_name","last_name","gender","date_of_birth","is_alive","deceased_datetime","phone","email","civil_status","place_of_birth","citizenship","country","county","sub_county","ward","village_estate","longitude","latitude","identification_type"];const ee=function(e){var t=e.client,n=(0,a.useMemo)((function(){return e=t,n={},Object.keys(e).filter((function(e){return Z.includes(e)})).forEach((function(t){if("other_identifications"===t){var r=(o=e[t],i={},o.forEach((function(e){i[e.identification_type]=e.identification_number})),i);n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){X(e,t,n[t])}))}return e}({},n,r)}else if("identification_type"===t)n[e.identification_type]=e.identification_number;else{var a=e[t];n[t]=a}var o,i})),n;var e,n}),[t]);return t&&n?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Field"),o().createElement(r.A0N,null,"Value"))),o().createElement(r.BFY,null,Object.keys(n).map((function(e){return o().createElement(r.Hjg,null,o().createElement(r.nA6,null,e),o().createElement(r.nA6,null,n[e]))}))))):o().createElement(o().Fragment,null,o().createElement("h4",null,"No patient Data to Display"))},te=function(e){var t=e.client,n=e.open,a=e.onModalClose,i=(e.onSubmit,e.onSendClientToTriage);return t?o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:n,size:"lg",onSecondarySubmit:a,onRequestClose:a,onRequestSubmit:function(){return i(t.id)},primaryButtonText:"Send To Triage",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:$.clientDetailsLayout},o().createElement("div",{className:$.sectionHeader},o().createElement("h4",{className:$.sectionTitle},"Patient Details")),o().createElement("div",{className:$.sectionContent},o().createElement(r.tUM,null,o().createElement(r.wbY,{contained:!0},o().createElement(r.ozo,null,"Patient Details")),o().createElement(r.T2N,null,o().createElement(r.KpK,null,o().createElement(ee,{client:t}))))))))):o().createElement(o().Fragment,null,"No Client data")};function ne(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function re(e){return(t=function(){var t,n,r,a;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(o){switch(o.label){case 0:return t="".concat(C.restBaseUrl,"/patient"),n=new URLSearchParams({q:e,v:"full",includeDead:"true",limit:"10",totalCount:"true"}).toString(),[4,(0,C.openmrsFetch)("".concat(t,"?").concat(n))];case 1:return(r=o.sent()).ok?[3,3]:[4,r.text()];case 2:throw a=o.sent(),new Error("Request failed with ".concat(r.status,": ").concat(a));case 3:return[2,r.json()]}}))},function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(e){ne(o,r,a,i,l,"next",e)}function l(e){ne(o,r,a,i,l,"throw",e)}i(void 0)}))})();var t}var ae=n(3754),oe={};oe.styleTagTransform=_(),oe.setAttributes=m(),oe.insert=d().bind(null,"head"),oe.domAPI=u(),oe.insertStyleElement=A(),l()(ae.A,oe);const ie=ae.A&&ae.A.locals?ae.A.locals:void 0;function le(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function ce(e){return(t=function(){var t,n,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(a){switch(a.label){case 0:return t="".concat(C.restBaseUrl,"/location"),n="".concat(t,"/").concat(e),[4,(0,C.openmrsFetch)(n)];case 1:return[4,a.sent().json()];case 2:return[2,null!=(r=a.sent())?r:null]}}))},function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(e){le(o,r,a,i,l,"next",e)}function l(e){le(o,r,a,i,l,"throw",e)}i(void 0)}))})();var t}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function se(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){se(o,r,a,i,l,"next",e)}function l(e){se(o,r,a,i,l,"throw",e)}i(void 0)}))}}function fe(e){return function(e){if(Array.isArray(e))return ue(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 ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(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.")}()}function me(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function pe(e){return de((function(){var t,n,r,a;return me(this,(function(o){switch(o.label){case 0:return t="".concat(C.restBaseUrl,"/queue"),n=new URLSearchParams({v:"custom:(uuid,display,name,description,service:(uuid,display),allowedPriorities:(uuid,display),allowedStatuses:(uuid,display),location:(uuid,display))",location:e}).toString(),[4,(0,C.openmrsFetch)("".concat(t,"?").concat(n))];case 1:return(r=o.sent()).ok?[3,3]:[4,r.text()];case 2:throw a=o.sent(),new Error("Request failed with ".concat(r.status,": ").concat(a));case 3:return[2,r.json()]}}))}))()}function Ae(e){return de((function(){var t,n,r,a,o,i,l,c,u,s;return me(this,(function(d){switch(d.label){case 0:return[4,ce(e)];case 1:return(t=d.sent())&&(n=t.parentLocation)?[4,ce(n.uuid)]:[2];case 2:if(r=d.sent(),o=null!==(a=r.childLocations)&&void 0!==a?a:[],l=null!==(i=o.map((function(e){return e.uuid})))&&void 0!==i?i:[],c=[],!(l.length>0))return[3,6];u=0,d.label=3;case 3:return u<l.length?[4,pe(l[u])]:[3,6];case 4:s=d.sent(),c=fe(c).concat(fe(s.results)),d.label=5;case 5:return u++,[3,3];case 6:return[2,c]}}))}))()}var he=n(75862),_e=n(25838),ye=n(83983),be=n(73143);function ve(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}var ge=n(11314),we=n(61978),Ce=n(47455);function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){xe(o,r,a,i,l,"next",e)}function l(e){xe(o,r,a,i,l,"throw",e)}i(void 0)}))}}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(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 Ne(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const Te=function(e){var t=e.patients,n=e.open,i=e.onModalClose,l=(e.onSubmit,e.client),c=e.onCreateAmrsPatient,u=e.onManualRegistration,s=function(e){var t=e.name.toLowerCase().trim();return t.includes("cash")?Je:t.includes("sha")?Qe:""},d=Ie((0,a.useState)(),2),f=d[0],m=d[1],p=Ie((0,a.useState)(),2),A=p[0],h=p[1],_=Ie((0,a.useState)(),2),y=_[0],b=_[1],v=Ie((0,a.useState)(),2),w=v[0],E=v[1],x=Ie((0,a.useState)(),2),S=x[0],I=x[1],N=Ie((0,a.useState)([]),2),T=N[0],k=N[1],D=Ie((0,a.useState)([]),2),P=D[0],U=D[1],O=Ie((0,a.useState)(null),2),R=O[0],F=O[1],B=Ie((0,a.useState)(null),2),j=B[0],L=B[1],H=Ie((0,a.useState)(""),2),Y=H[0],M=H[1],q=Ie((0,a.useState)(),2),G=q[0],V=q[1],J=Ie((0,a.useState)([]),2),Q=(J[0],J[1]),W=Ie((0,a.useState)([]),2),z=W[0],K=W[1],$=Ie((0,a.useState)(null),2),X=$[0],Z=$[1],ee=Ie((0,a.useState)(null),2),te=ee[0],ne=ee[1],re=Ie((0,a.useState)(""),2),ae=re[0],oe=re[1],le=Ie((0,a.useState)(""),2),ce=le[0],ue=le[1],se=Ie((0,a.useState)(""),2),fe=se[0],pe=se[1],Ee=Ie((0,a.useState)(),2),xe=Ee[0],Te=Ee[1],ke=Ie((0,a.useState)([]),2),De=ke[0],Pe=ke[1],Ue=Ie((0,a.useState)(!1),2),Oe=Ue[0],Re=Ue[1],Fe=Ie((0,a.useState)(!1),2),Be=Fe[0],je=Fe[1],Le=Ie((0,a.useState)(!1),2),He=Le[0],Ye=Le[1],Me=(0,C.useSession)(),qe=Me.sessionLocation.uuid,Ge=(0,C.useConfig)(),Ve=Ge.registrationBillableServices,Je=Ge.cashConsulationConceptUuid,Qe=Ge.shaConsulationConceptUuid,We=Ge.outPatientCareSettingUuid,ze=Ge.orderEncounterTypeUuid,Ke=Ge.registrationServicequeues,$e=(0,a.useMemo)((function(){return P.filter((function(e){var t;return e&&(null===(t=e.location)||void 0===t?void 0:t.uuid)===qe}))}),[P,qe]),Xe=(0,a.useMemo)((function(){return[{text:"OPD",id:"57d7f623-6a5c-47b2-a1b0-0238b92bea95"},{text:"Inpatient",id:"be7c422a-9f7d-4817-95d0-0e4d451ad153"}]}),[l]),Ze=(0,a.useMemo)((function(){return[{text:"Walk-In",id:Ce.H.WALK_IN_UUID},{text:"Self-Referral",id:Ce.H.SELF_RERERRAL_UUID},{text:"Referral from another Facility",id:Ce.H.REFERRAL_FROM_ANOTHER_FACILITY_UUID},{text:"Referral from Community",id:Ce.H.REFERRED_BY_COMMUNITY_HEALTH_WORKER_UUID}]}),[l]),et=Object.values(g.Ar).map((function(e){return{id:e,label:e}}));if((0,a.useEffect)((function(){Se((function(){var e,t,n,r;return Ne(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,Ae(qe)];case 1:return(e=a.sent())&&e.length>0&&(t=function(e){return e.filter((function(e){var t;return Ke.includes(null!==(t=e.uuid)&&void 0!==t?t:"")}))}(e),E(t)),[3,3];case 2:return n=a.sent(),(0,C.showSnackbar)({kind:"error",title:"An error occurred while fetching service queues",subtitle:null!==(r=n.message)&&void 0!==r?r:"An error occurred while fetching service queues, please try agin"}),[3,3];case 3:return[2]}}))}))(),Se((function(){var e;return Ne(this,(function(t){switch(t.label){case 0:return[4,(0,ye.x_)()];case 1:return e=t.sent(),k(e),[2]}}))}))(),Se((function(){var e;return Ne(this,(function(t){switch(t.label){case 0:return[4,(0,ye.EI)()];case 1:return e=t.sent(),Q(e),function(e){var t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var l=o.value;if(l.servicePrices){var c=l.servicePrices,u=!0,s=!1,d=void 0;try{for(var f,m=c[Symbol.iterator]();!(u=(f=m.next()).done);u=!0){var p=f.value;t.push(p)}}catch(e){s=!0,d=e}finally{try{u||null==m.return||m.return()}finally{if(s)throw d}}}}}catch(e){r=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw a}}K(t)}(e),[2]}}))}))(),Se((function(){var e;return Ne(this,(function(t){switch(t.label){case 0:return[4,(0,ye.B3)()];case 1:return e=t.sent(),U(e),[2]}}))}))(),Se((function(){var e,n,r;return Ne(this,(function(a){switch(a.label){case 0:if(!t)return[3,4];Pe([]),e=0,a.label=1;case 1:return e<t.length?[4,(c=t[e].uuid,(l=function(){var e,t,n;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(r){switch(r.label){case 0:return e="".concat(C.restBaseUrl,"/billing/bill?v=full&patientUuid=").concat(c),[4,(0,C.openmrsFetch)(e)];case 1:return[4,r.sent().json()];case 2:return t=r.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))},function(){var e=this,t=arguments;return new Promise((function(n,r){var a=l.apply(e,t);function o(e){ve(a,n,r,o,i,"next",e)}function i(e){ve(a,n,r,o,i,"throw",e)}o(void 0)}))})())]:[3,4];case 2:n=a.sent(),o=n,i=new Date,r=o.filter((function(e){var t=new Date(e.dateCreated);return t.getFullYear()===i.getFullYear()&&t.getMonth()===i.getMonth()&&t.getDate()===i.getDate()})),Pe(r),a.label=3;case 3:return e++,[3,1];case 4:return[2]}var o,i,l,c}))}))(),Se((function(){var e,n;return Ne(this,(function(r){switch(r.label){case 0:if(!(t&&t.length>0))return[3,4];e=t[0],r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,ge.j3)(e.uuid)];case 2:return n=r.sent(),Te(n.length>0?n[0]:null),[3,4];case 3:return r.sent(),at("error","Error getting patient active queue",""),[3,4];case 4:return[2]}}))}))()}),[t]),!t)return o().createElement(o().Fragment,null,"No Client data");var tt=function(){return!xe||!xe.queue.uuid||(at("error","Patient already in queue","Patient is already in the ".concat(xe.queue.display," queue, remove them first or contact support")),!1)},nt=function(e){return e.location?e.patient?e.visitType?!!y||(at("error","Please select a patient type",""),!1):(at("error","Please select a visit",""),!1):(at("error","Please select a patient",""),!1):(at("error","Missing location in create visits",""),!1)},rt=function(){var e,t=(e=[],ae&&e.push({attributeType:"3a988e33-a6c0-4b76-b924-01abb998944b",value:ae}),ce&&e.push({attributeType:"aac48226-d143-4274-80e0-264db4e368ee",value:ce}),j&&e.push({attributeType:"8553afa0-bdb9-4d3c-8a98-05fa9350aa85",value:j.uuid}),y&&e.push({attributeType:"fbc0702d-b4c9-4968-be63-af8ad3ad6239",value:y}),G===g.Ar.NonPaying&&e.push({attributeType:"df0362f9-782e-4d92-8bb2-3112e9e9eb3c",value:"true"}),e),n={visitType:A,location:qe,startDatetime:null,stopDatetime:null,patient:null==f?void 0:f.uuid};return t.length>0&&(n.attributes=t),n},at=function(e,t,n){(0,C.showSnackbar)({kind:e,title:t,subtitle:n})};return o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:n,size:"md",onSecondarySubmit:function(){return i({success:!1})},onRequestClose:function(){return i({success:!1})},onRequestSubmit:function(){return Se((function(){var e,t,n,r,a,o,l;return Ne(this,(function(c){switch(c.label){case 0:if(Be)return at("error","Form already Submitted","Form has already been submitted, please wait for the visit,queue and bill to be created"),[2];if(je(!0),!function(){if(!f)return at("error","Please select a patient",""),!1;if(!G)return at("error","Please select a paying or non paying option",""),!1;if(!tt())return!1;if(G===g.Ar.Paying){if(!j)return at("error","Please select a payment method",""),!1;if(!te)return at("error","Please select a billable service",""),!1;if(!R)return at("error","Please select a cashpoint",""),!1}return G!==g.Ar.NonPaying||fe?A?S?!!Y||(at("error","Please select a service queue priority",""),!1):(at("error","Please select a service queue",""),!1):(at("error","Please select a visit type",""),!1):(at("error","Please select a patient category",""),!1)}())return je(!1),[2];Ye(!0),c.label=1;case 1:return c.trys.push([1,9,10,11]),[4,Se((function(){var e,t;return Ne(this,(function(n){switch(n.label){case 0:return e=rt(),nt(e)?[4,(0,_e._)(e)]:[2,!1];case 1:if(t=n.sent())return at("success","Visit has been created succesfully",""),[2,t];throw at("error","Error creating patient visit",""),new Error("Error creating patient visit")}}))}))()];case 2:return(e=c.sent())?(t=function(e){return{visit:{uuid:e.uuid},queueEntry:{status:{uuid:he.cn.WAITING_UUID},priority:{uuid:null!=Y?Y:he.i3.NORMAL_PRIORITY_UUID},queue:{uuid:S},patient:{uuid:f.uuid},startedAt:e.startDatetime,sortWeight:0}}}(e),[4,(m=t,de((function(){var e,t,n;return me(this,(function(r){switch(r.label){case 0:return e="".concat(C.restBaseUrl,"/visit-queue-entry"),[4,(0,C.openmrsFetch)(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(m)})];case 1:return(t=r.sent()).ok?[3,3]:[4,t.text()];case 2:throw n=r.sent(),new Error("Request failed with ".concat(t.status,": ").concat(n));case 3:return[2,t.json()]}}))}))())]):[3,8];case 3:return(n=c.sent())&&at("success","Patient has succesfully been moved to the Triage queue",""),r=null,G!==g.Ar.Paying?[3,7]:!function(e){return e.patient?e.status?e.cashPoint?!(!e.lineItems||0===e.lineItems.length)||(at("error","Please select a valid billable service",""),!1):(at("error","Please select a valid cashpoint",""),!1):(at("error","Bill does not have a status",""),!1):(at("error","Please select a patient",""),!1)}(a={lineItems:[{billableService:te.billableService.uuid,quantity:1,price:te.price,priceName:te.name,priceUuid:te.uuid,lineItemOrder:0,paymentStatus:"PENDING"}],cashPoint:R.uuid,patient:f.uuid,status:"PENDING",payments:[]})||Oe?[3,6]:[4,(0,ye.Uv)(a)];case 4:return(r=c.sent())&&(Re(!0),at("success","Bill succesfully created","")),[4,(u=f.uuid,d=e.uuid,Se((function(){var e;return Ne(this,(function(t){switch(t.label){case 0:e=function(e,t){var n;return{patient:e,location:qe,encounterType:ze,visit:t,obs:[],orders:[{action:"NEW",type:"order",patient:e,careSetting:We,orderer:null!==(n=Me.currentProvider.uuid)&&void 0!==n?n:"pd25871c-1359-11df-a1f1-0026b9348838",encounter:null,concept:s(j),accessionNumber:null,urgency:"ROUTINE",scheduledDate:null}]}}(u,d),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(0,we.iw)(e)];case 2:return t.sent()&&at("success","Consultation order created","Consultation order has been succesfully created"),[3,4];case 3:return t.sent(),at("error","Error creating consulation order","An error occurred while generating the consultation order. Please contact support"),[3,4];case 4:return[2]}}))}))())];case 5:return c.sent(),[3,7];case 6:return[2,!1];case 7:(n&&g.Ar.Paying&&(r||Oe)||n&&g.Ar.NonPaying)&&i({success:!0}),c.label=8;case 8:return[3,11];case 9:return o=c.sent(),je(!1),at("error",null!==(l=o.message)&&void 0!==l?l:"Error creating visit",""),[3,11];case 10:return Ye(!1),[7];case 11:return[2]}var u,d,m}))}))()},primaryButtonText:He?"Sending...please wait":"Send to Triage",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:ie.clientDetailsLayout},o().createElement("div",{className:ie.sectionHeader},o().createElement("h4",{className:ie.sectionTitle},"Send To Triage")),t.length>0?o().createElement("div",{className:ie.sectionContent},o().createElement("div",{className:ie.patientSelect},o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"No"),o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"Gender"),o().createElement(r.A0N,null,"Select Patient"))),o().createElement(r.BFY,null,t.map((function(e,t){return o().createElement(r.Hjg,{key:e.uuid},o().createElement(r.nA6,null,t+1),o().createElement(r.nA6,null,e.person.preferredName.display),o().createElement(r.nA6,null,e.person.gender),o().createElement(r.nA6,null,o().createElement(r.Sc0,{id:e.uuid,labelText:"",onChange:function(){m(e)}})))}))))),o().createElement("div",{className:ie.formSection},o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.a32,{onChange:function(e){var t=e.selectedItem.id;b(t)},id:"patient-type-combobox",items:Ze,itemToString:function(e){return e?e.text:""},titleText:"Patient Type"})),o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"payment-details",labelText:"Payment Details",onChange:function(e){return t=e.target.value,void V(t);var t}},o().createElement(r.ebT,{value:"",text:"Select"}),";",et.map((function(e){return o().createElement(r.ebT,{value:e.id,text:e.label})})))))),o().createElement("div",{className:ie.formSection},G===g.Ar.Paying?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"payment-method",labelText:"Payment Method",onChange:function(e){return function(e){var t=T.find((function(t){return t.uuid===e}));L(t);var n=function(e){var t=[];return z.forEach((function(n){n.paymentMode&&n.paymentMode.uuid===e.uuid&&Ve.includes(n.billableService.uuid)&&t.push(n)})),t}(t);Z(n),oe(""),ue(""),M("")}(e.target.value)}},o().createElement(r.ebT,{value:"",text:"Select"}),";",T&&T.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:e.name})})))),o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"billable-service",labelText:"Billable Services",onChange:function(e){return function(e){var t,n,r=z.find((function(t){return t.uuid===e}));t=r,n=!0,De.forEach((function(e){e.lineItems.forEach((function(e){e.billableService===t.billableService.display&&(n=!1)}))})),n?ne(r):(ne(null),at("error","Existing bill","Patient has a similar bill"))}(e.target.value)}},o().createElement(r.ebT,{value:"",text:"Select"}),";",X&&X.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:"".concat(e.billableService.display,"(").concat(e.name,":").concat(e.price,")")})}))))),j&&j.name.trim().toLowerCase().includes("insurance".trim().toLowerCase())?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.ksK,{id:"insurance-scheme",labelText:"Insurance scheme",onChange:function(e){return function(e){oe(e)}(e.target.value)}})),o().createElement("div",{className:ie.formControl},o().createElement(r.ksK,{id:"policy-number",labelText:"Policy number",onChange:function(e){return function(e){ue(e)}(e.target.value)}})))):o().createElement(o().Fragment,null),o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"cash-point",labelText:"Cash Point",onChange:function(e){return function(e){var t=P.find((function(t){return t.uuid===e}));F(t)}(e.target.value)}},o().createElement(r.ebT,{value:"",text:"Select"}),";",$e&&$e.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:e.name})})))))):o().createElement(o().Fragment,null),G===g.Ar.NonPaying?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"patient-category",labelText:"Patient Category",onChange:function(e){return t=e.target.value,void pe(t);var t}},o().createElement(r.ebT,{value:"",text:"Select"}),";",o().createElement(r.ebT,{value:be.Q.CCC_PATIENT_UUID,text:"CCC"}),";",o().createElement(r.ebT,{value:be.Q.MCH_PATIENT_UUID,text:"MCH"}),";")))):o().createElement(o().Fragment,null)),o().createElement("div",{className:ie.formSection},o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.a32,{onChange:function(e){var t=e.selectedItem.id;h(t)},id:"visit-type-combobox",items:Xe,itemToString:function(e){return e?e.text:""},titleText:"Visit Type"})),o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"service",labelText:"Select a Queue Service",onChange:function(e){if(tt()){var t=e.target.value;I(t)}}},o().createElement(r.ebT,{value:"",text:"Select"}),";",w&&w.map((function(e){return o().createElement(r.ebT,{value:e.uuid,text:"".concat(e.display)})}))))),o().createElement("div",{className:ie.formRow},o().createElement("div",{className:ie.formControl},o().createElement(r.l6P,{id:"priority",labelText:"Select Priority",onChange:function(e){return t=e.target.value,void M(t);var t}},o().createElement(r.ebT,{value:"",text:"Select"}),";",o().createElement(r.ebT,{value:he.i3.NORMAL_PRIORITY_UUID,text:"PRIORITY"}),";",o().createElement(r.ebT,{value:he.i3.NOT_URGENT_PRIORITY_UUID,text:"NON URGENT"}),";",o().createElement(r.ebT,{value:he.i3.EMERGENCY_PRIORITY_UUID,text:"EMERGENCY"}),";"))))):o().createElement(o().Fragment,null),o().createElement("div",{className:ie.actionSection},0===t.length?o().createElement(o().Fragment,null,o().createElement("div",{className:ie.patientAction},o().createElement("div",{className:ie.btnContainer},o().createElement(r.$nd,{kind:"primary",onClick:function(){return c(l)}},"Automatically Register in AMRS")),o().createElement("div",{className:ie.btnContainer},o().createElement(r.$nd,{kind:"secondary",onClick:u},"Manually Register")))):o().createElement(o().Fragment,null))))))};function ke(e,t){return"".concat(e.first_name," ").concat(N(e.middle_name)," (").concat(e.gender,") (DOB: ").concat(e.date_of_birth,") (").concat(t,") (CR: ").concat(e.id,")")}var De=n(96622);function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ue(e){return function(e){if(Array.isArray(e))return Pe(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 Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(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 Oe=Ue([g.LQ.Cr,g.LQ.SHANumber,g.LQ.HouseholdNumber,g.LQ.RefugeeID,g.LQ.MandateNumber,g.LQ.AlienID,g.LQ.NationalID,g.LQ.TemporaryDependantID]).concat(Ue(["first_name","middle_name","last_name"]),Ue(["gender","date_of_birth","is_alive","deceased_datetime"]),Ue(["phone","email","civil_status","place_of_birth","citizenship"]),Ue(["country","county","sub_county","ward","village_estate","longitude","latitude"]));function Re(e){var t="";switch(e){case"Divorced":t="a899ad58-1350-11df-a1f1-0026b9348838";break;case"Married":t="a8aa76b0-1350-11df-a1f1-0026b9348838";break;case"Single":t="a899ac7c-1350-11df-a1f1-0026b9348838";break;default:t="a89ad3a4-1350-11df-a1f1-0026b9348838"}return t}function Fe(e){var t;switch(e){case g.LQ.NationalID:t=De.N.NATIONAL_ID_UUID;break;case g.LQ.HouseholdNumber:t=De.N.HOUSE_HOLD_NUMBER_UUID;break;case g.LQ.AlienID:t=De.N.ALIEN_ID_UUID;break;case g.LQ.SHANumber:t=De.N.SHA_UUID;break;case g.LQ.MandateNumber:t=De.N.MANDATE_NUMBER_UUID;break;case g.LQ.RefugeeID:t=De.N.REFUGEE_ID_UUID;break;case g.LQ.Cr:t=De.N.CLIENT_REGISTRY_NO_UUID;break;case g.LQ.BirthCertificate:t=De.N.BIRTH_CERTIFICATE_NUMBER_UUID;break;case g.LQ.TemporaryDependantID:t=De.N.TEMPORARY_DEPENDANT_ID_UUID;break;case g.LQ.BirthNotification:t=De.N.BIRTH_NOTIFICATION_UUID}return t}var Be=n(62801);function je(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Le(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){je(o,r,a,i,l,"next",e)}function l(e){je(o,r,a,i,l,"throw",e)}i(void 0)}))}}function He(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}var Ye=function(e,t){return Le((function(){var n,r;return He(this,(function(a){switch(a.label){case 0:return[4,Le((function(){var e,t,n,r;return He(this,(function(a){switch(a.label){case 0:return[4,(0,Be.E$)()];case 1:return e=a.sent(),t=new AbortController,[4,(0,C.openmrsFetch)("".concat(e,"/amrs-id-generator/generateidentifier"),{headers:{"Content-Type":"application/json"},method:"POST",body:{user:1},signal:t.signal})];case 2:return[4,a.sent().json()];case 3:return n=a.sent(),[2,null!==(r=n.identifier)&&void 0!==r?r:""]}}))}))()];case 1:return n=a.sent(),r=function(e,t){var n=[];return n.push({identifierType:Fe(g.LQ.Cr),identifier:e.id,location:t}),n.push({identifierType:Fe(e.identification_type),identifier:e.identification_number,location:t}),n}(t,e),r.push({identifierType:De.N.AMRS_UNIVERSAL_ID_UUID,identifier:n,location:e,preferred:!0}),[2,r]}}))}))()};function Me(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function qe(e,t){return(n=function(){var n,r;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(a){switch(a.label){case 0:return n=function(e){var t={},n={},r={},a=[];Oe.forEach((function(o){"first_name"===o&&(n.givenName=e.first_name),"middle_name"===o&&(n.middleName=e.middle_name),"last_name"===o&&(n.familyName=e.last_name),"gender"===o&&(t.gender="Male"===e.gender?"M":"F"),"date_of_birth"===o&&(t.birthdate=e.date_of_birth,t.birthdateEstimated=!1),"is_alive"===o&&(t.dead=0===e.is_alive),"deceased_datetime"===o&&e.deceased_datetime.length>0&&(t.deathDate=e.deceased_datetime),"country"===o&&e.country.length>0&&(r.country=e.country,r.address1=e.country),"place_of_birth"===o&&e.place_of_birth.length>0&&(r.address10=e.place_of_birth),"county"===o&&e.county.length>0&&(r.countyDistrict=e.county),"sub_county"===o&&e.sub_county.length>0&&(r.address2=e.sub_county,r.stateProvince=e.sub_county),"ward"===o&&e.sub_county.length>0&&(r.address7=e.sub_county,r.address4=e.sub_county),"village_estate"===o&&e.village_estate.length>0&&(r.cityVillage=e.village_estate),"longitude"===o&&e.longitude.length>0&&(r.longitude=e.longitude),"latitude"===o&&e.latitude.length>0&&(r.latitude=e.latitude),"place_of_birth"===o&&e.place_of_birth.length>0&&a.push({value:e.place_of_birth,attributeType:"8d8718c2-c2cc-11de-8d13-0010c6dffd0f"}),"phone"===o&&e.phone.length>0&&a.push({value:e.phone,attributeType:"72a759a8-1359-11df-a1f1-0026b9348838"}),"email"===o&&e.email.length>0&&a.push({value:e.email,attributeType:"2f65dbcb-3e58-45a3-8be7-fd1dc9aa0faa"}),"civil_status"===o&&e.civil_status.length>0&&a.push({value:Re(e.civil_status),attributeType:"8d871f2a-c2cc-11de-8d13-0010c6dffd0f"}),"id"===o&&e.id&&a.push({value:e.id,attributeType:"e068e02b-faac-4baf-bd58-fe6e0c29a81f"}),"citizenship"===o&&e.citizenship&&a.push({value:e.citizenship,attributeType:"8d871afc-c2cc-11de-8d13-0010c6dffd0f"})}));var o=function(e){var t=[],n=e.find((function(e){return"Alternative Phone Number"===e.relationship})),r=e.find((function(e){return"Next Of Kin"===e.remarks}));return n&&"Phone"===n.contact_type&&t.push({value:n.contact_id,attributeType:"c725f524-c14a-4468-ac19-4a0e6661c930"}),r&&("Phone"===r.contact_type&&t.push({value:r.contact_id,attributeType:"a657a4f1-9c0f-444b-a1fd-445bb91dd12d"}),t.push({value:r.relationship,attributeType:"5730994e-c267-426b-87b6-c152b606973d"}),t.push({value:r.contact_name,attributeType:"72a75bec-1359-11df-a1f1-0026b9348838"})),t}(e.alternative_contacts);return a=Ue(a).concat(Ue(o)),Object.keys(n).length>0&&(t.names=[n]),Object.keys(r).length>0&&(t.addresses=[r]),a.length>0&&(t.attributes=a),t}(e),[4,Ye(t,e)];case 1:return r=a.sent(),[4,(o={person:n,identifiers:r},Le((function(){return He(this,(function(e){switch(e.label){case 0:return[4,(0,C.openmrsFetch)("".concat(C.restBaseUrl,"/patient"),{method:"POST",headers:{"Content-Type":"application/json"},body:o})];case 1:return[2,e.sent()]}}))}))())];case 2:return[4,a.sent().json()];case 3:return[2,a.sent()]}var o}))},function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(e){Me(o,r,a,i,l,"next",e)}function l(e){Me(o,r,a,i,l,"throw",e)}i(void 0)}))})();var n}var Ge=n(9036);function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Je(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Qe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Je(o,r,a,i,l,"next",e)}function l(e){Je(o,r,a,i,l,"throw",e)}i(void 0)}))}}function We(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ve(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 ze(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const Ke=function(){var e=We((0,a.useState)("National ID"),2),t=e[0],n=e[1],i=We((0,a.useState)(""),2),l=i[0],c=i[1],u=We((0,a.useState)(!1),2),s=u[0],d=u[1],f=We((0,a.useState)(),2),m=f[0],p=f[1],A=We((0,a.useState)(),2),h=A[0],_=A[1],y=We((0,a.useState)([]),2),b=y[0],E=y[1],x=We((0,a.useState)("principal"),2),S=x[0],T=x[1],k=We((0,a.useState)(!1),2),D=k[0],P=k[1],U=We((0,a.useState)(!1),2),O=U[0],R=U[1],F=We((0,a.useState)(!1),2),B=F[0],j=F[1],L=We((0,a.useState)(),2),H=L[0],Y=L[1],M=(0,C.useSession)().sessionLocation.uuid,q=function(e,t,n){(0,C.showSnackbar)({kind:e,title:t,subtitle:n})},G=function(){R(!1)},V=function(){window.location.href="".concat(window.spaBase,"/patient-registration")},J=function(){return"principal"===S?m:"dependants"===S?h:m},Q=function(){p(null),_(null),E([]),T(null),c(""),n("National ID"),R(!1),P(!1),j(!1),T("principal")};return o().createElement(o().Fragment,null,o().createElement("div",{className:v.registryLayout},o().createElement("div",{className:v.mainContent},o().createElement("div",{className:v.registryHeader},o().createElement("h4",null,"Client Registry"),o().createElement("p",null,"Please enter identification number to begin")),o().createElement("div",{className:v.registryContent},o().createElement("div",{className:v.formRow},o().createElement("div",{className:v.formControl},o().createElement(r.msM,{id:"identifier-type-dropdown",label:"Identifier Type",titleText:"Select Identifier Type",items:g.E$,selectedItem:t,onChange:function(e){var t=e.selectedItem;return n(t)}})),o().createElement("div",{className:v.formControl},o().createElement(r.ksK,{id:"identifier-value",labelText:"".concat(t," Value"),value:l,onChange:function(e){return c(e.target.value)},placeholder:"Enter ".concat(t.toLowerCase()," value")}))),o().createElement("div",{className:v.formRow},o().createElement("div",{className:v.formControl},o().createElement("div",{className:v.formBtn},o().createElement(r.$nd,{className:v.registrySearchBtn,kind:"primary",onClick:function(){return Qe((function(){var e,n,r,a,o,i;return ze(this,(function(c){switch(c.label){case 0:d(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),((u=e={identificationNumber:l,identificationType:t,locationUuid:M}).identificationNumber?u.identificationType?u.locationUuid||(q("error","No default location selected",""),0):(q("error","Please enter a valid identification type",""),0):(q("error","Please enter a valid identification number",""),0))?[4,(0,w.lr)(e)]:[2,!1];case 2:if(n=c.sent(),0===(r=Array.isArray(n)?n:[]).length)throw Q(),new Error("No matching patient found in Client Registry.");return a=r[0],p(a),q("success","Client Data Loaded","Patient fetched successfully"),[3,5];case 3:return o=c.sent(),i=o.message||"Failed to fetch client data",Q(),q("error","Fetch Failed",i),[3,5];case 4:return d(!1),[7];case 5:return[2]}var u}))}))()},disabled:s},s?o().createElement(r.OuH,{description:"Searching..."}):"Search"),o().createElement(r.$nd,{className:v.registrySearchBtn,kind:"secondary",onClick:V},"Emergency Registration"),m?o().createElement(o().Fragment,null):o().createElement(r.$nd,{className:v.registrySearchBtn,kind:"tertiary",onClick:function(){window.open("https://afyayangu.go.ke/","_blank")}},"Register on Afya Yangu")))),m?o().createElement("div",{className:v.formRow},o().createElement("div",{className:v.hieData},o().createElement("div",{className:v.selectionHeader},o().createElement("h5",null,"Please select one patient and request patient to share the OTP sent")),o().createElement("div",{className:v.patientSelect},o().createElement("div",{className:v.patientSelectRadio},o().createElement(r.zWQ,{defaultSelected:"principal",legendText:"Patient",onChange:function(e){T(e)},name:"radio-button-default-group"},o().createElement(r.aaP,{id:"principal",labelText:"Principal",value:"principal"}),o().createElement(r.aaP,{id:"dependants",labelText:"Dependants",value:"dependants"}))),o().createElement("div",{className:v.patientConfirmSelection},o().createElement("div",{className:v.btnContainer},o().createElement(r.$nd,{kind:"primary",onClick:function(){var e,n,r={identificationNumber:l,identificationType:t,locationUuid:M,phoneNumber:null!==(e=null==m?void 0:m.phone)&&void 0!==e?e:""};((n=r).identificationNumber?n.identificationType?n.locationUuid?n.phoneNumber||(q("error","No phone number selected",""),0):(q("error","No default location selected",""),0):(q("error","Please enter a valid identification type",""),0):(q("error","Please enter a valid identification number",""),0))&&(Y(r),P(!0))}}," ","Confirm")),o().createElement("div",{className:v.btnContainer},o().createElement(r.$nd,{kind:"secondary",onClick:Q},"Cancel")))),o().createElement("div",{className:v.principalDependantSection},"principal"===S?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"CR"),o().createElement(r.A0N,null,"Phone No"),o().createElement(r.A0N,null,"ID No"),o().createElement(r.A0N,null,"Eligibility Status"))),o().createElement(r.BFY,null,o().createElement(r.Hjg,null,o().createElement(r.nA6,null,m.first_name," ",N(m.middle_name)," ",N(m.last_name)),o().createElement(r.nA6,null,I(m.id)),o().createElement(r.nA6,null,I(m.phone)),o().createElement(r.nA6,null,I(m.identification_number)),o().createElement(r.nA6,null,o().createElement(Ge.A,{crId:m.id,locationUuid:M})))))):o().createElement(o().Fragment,null),"dependants"===S?o().createElement(o().Fragment,null,o().createElement("div",{className:v.dependantDetails},o().createElement("div",null,o().createElement(r.zWQ,{defaultSelected:"",helperText:"",invalidText:"",legendText:"",name:"dependant-group",onChange:function(e){return function(e){var t=m.dependants;if(t.length>0){var n=t.find((function(t){return t.result[0].id===e}));n&&_(n.result[0])}}(e)}},m.dependants.map((function(e){var t=e.result[0],n=e.relationship;return o().createElement(r.aaP,{id:t.id,labelText:ke(t,n),value:t.id})})))),o().createElement("div",null,h?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"CR"),o().createElement(r.A0N,null,"Eligibility Status"))),o().createElement(r.BFY,null,o().createElement(r.Hjg,null,o().createElement(r.nA6,null,h.first_name," ",N(h.middle_name)," ",N(h.last_name)),o().createElement(r.nA6,null,I(h.id)),o().createElement(r.nA6,null,o().createElement(Ge.A,{crId:h.id,locationUuid:M})))))):o().createElement(o().Fragment,null)))):o().createElement(o().Fragment,null),D?o().createElement(W,{requestCustomOtpDto:H,phoneNumber:m.phone,open:D,onModalClose:function(){P(!1)},onOtpSuccessfullVerification:function(){P(!1),R(!0)}}):o().createElement(o().Fragment,null),m&&O?o().createElement(o().Fragment,null,o().createElement(te,{client:J(),open:O,onModalClose:G,onSubmit:function(){},onSendClientToTriage:function(e){return Qe((function(){var t,n,r;return ze(this,(function(a){switch(a.label){case 0:return G(),[4,re(e)];case 1:return(t=a.sent()).totalCount>0?(q("success","".concat(t.totalCount," ").concat(t.totalCount>0?"Patients":"Patient"," found in the system with ").concat(e),""),o=e,i=null!==(n=t.results)&&void 0!==n?n:[],r=i.filter((function(e){return e.identifiers.some((function(e){return e.identifier===o&&e.identifierType.uuid===De.N.CLIENT_REGISTRY_NO_UUID}))})),E(r),j(!0)):(q("error","Patient not found in the system",""),E([]),j(!0)),[2]}var o,i}))}))()}})," "):o().createElement(o().Fragment,null),m&&B?o().createElement(o().Fragment,null,o().createElement(Te,{client:J(),patients:b,open:B,onModalClose:function(e){j(!1),e&&e.success&&(window.location.href="".concat(window.spaBase,"/home/triage"))},onSubmit:function(){},onCreateAmrsPatient:function(){return Qe((function(){var e,t,n,r,a,o,i,l,c,u,s,d;return ze(this,(function(f){switch(f.label){case 0:if(!(e=J()))return q("error","Principal or dependant not selected",""),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,qe(e,M)];case 2:return(t=f.sent())&&(q("success","Patient created succesfully",""),E([t])),[3,4];case 3:if(n=f.sent(),a=null!==(r=n.responseBody)&&void 0!==r?r:n.message,q("error","Error Creating Patient",""),o=function(e){var t=[];if(e&&e.error)if(e.error.error){var n=e.error.error.globalErrors||null;if(n){var r=!0,a=!1,o=void 0;try{for(var i,l=n[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var c=i.value;t.push(c.message)}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}}}else if(e.error)if(e.error.globalErrors){var u=e.error.globalErrors||null;if(u){var s=!0,d=!1,f=void 0;try{for(var m,p=u[Symbol.iterator]();!(s=(m=p.next()).done);s=!0){var A=m.value;t.push(A.message)}}catch(e){d=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(d)throw f}}}}else e.error.message&&t.push(e.error.message);else t.push(e.error.error.message||"An error occurred while creating the patient. Please try again or contact support");return t}(a),o&&o.length>0){i=!0,l=!1,c=void 0;try{for(u=o[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)d=s.value,q("error",d,"")}catch(e){l=!0,c=e}finally{try{i||null==u.return||u.return()}finally{if(l)throw c}}}return[3,4];case 4:return[2]}}))}))()},onManualRegistration:function(){j(!1),V()}})):o().createElement(o().Fragment,null)))):o().createElement(o().Fragment,null)))))}},73143:(e,t,n)=>{n.d(t,{Q:()=>r});var r={CCC_PATIENT_UUID:"a8a3899a-1350-11df-a1f1-0026b9348838",MCH_PATIENT_UUID:"a8a17d80-1350-11df-a1f1-0026b9348838"}},75485:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__timer-component__timerData___FgxzS{height:3rem;font-size:30px;color:#0055a5}","",{version:3,sources:["webpack://./src/shared/ui/timer/timer.component.scss"],names:[],mappings:"AAAA,uDACG,WAAA,CACA,cAAA,CACA,aAAA",sourcesContent:[".timerData{\n height: 3rem;\n font-size: 30px;\n color: #0055a5;\n}"],sourceRoot:""}]),i.locals={timerData:"-esm-dha-workflow__timer-component__timerData___FgxzS"};const l=i},83983:(e,t,n)=>{n.d(t,{B3:()=>s,EI:()=>c,Uv:()=>u,x_:()=>l});var r=n(25987);function a(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)}))}}function i(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function l(){return o((function(){var e,t,n;return i(this,(function(a){switch(a.label){case 0:return e="".concat(r.restBaseUrl,"/billing/paymentMode"),[4,(0,r.openmrsFetch)(e)];case 1:return[4,a.sent().json()];case 2:return t=a.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))}))()}function c(){return o((function(){var e,t,n;return i(this,(function(a){switch(a.label){case 0:return e="".concat(r.restBaseUrl,"/billing/billableService"),[4,(0,r.openmrsFetch)("".concat(e,"?v=").concat("full"))];case 1:return[4,a.sent().json()];case 2:return t=a.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))}))()}function u(e){return o((function(){var t,n,a;return i(this,(function(o){switch(o.label){case 0:return t="".concat(r.restBaseUrl,"/billing/bill"),[4,(0,r.openmrsFetch)(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})];case 1:return[4,o.sent().json()];case 2:return n=o.sent(),[2,null!==(a=n.results)&&void 0!==a?a:[]]}}))}))()}function s(){return o((function(){var e,t,n;return i(this,(function(a){switch(a.label){case 0:return e="".concat(r.restBaseUrl,"/billing/cashPoint?v=").concat("full"),[4,(0,r.openmrsFetch)(e)];case 1:return[4,a.sent().json()];case 2:return t=a.sent(),[2,null!==(n=t.results)&&void 0!==n?n:[]]}}))}))()}},84497:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__otp-verification-modal__modalVerificationLayout___MST8n{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__otp-verification-modal__sectionHeader___g62oo{display:flex;flex-direction:column;column-gap:5px;margin-top:5px;margin-bottom:5px}.-esm-dha-workflow__otp-verification-modal__otpSection___R\\+cLH{display:flex;flex-direction:row;width:100%;column-gap:15px}.-esm-dha-workflow__otp-verification-modal__otpForm___6EDu\\+{display:flex;flex-direction:column;width:60%;row-gap:20px}.-esm-dha-workflow__otp-verification-modal__otpTimer___ckBNm{display:flex;flex-direction:column;width:50%;padding-top:15%}.-esm-dha-workflow__otp-verification-modal__formRow___8sAxU{display:flex;flex-direction:row;width:100%;column-gap:5px;margin-top:10px}.-esm-dha-workflow__otp-verification-modal__formControl___nN1HY{width:70%;margin-top:10px}","",{version:3,sources:["webpack://./src/registry/modal/otp-verification-modal/otp-verification-modal.scss"],names:[],mappings:"AAAA,4EACE,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAEF,kEACE,YAAA,CACA,qBAAA,CACA,cAAA,CACA,cAAA,CACA,iBAAA,CAEF,gEACE,YAAA,CACA,kBAAA,CACA,UAAA,CACA,eAAA,CAEF,6DACE,YAAA,CACA,qBAAA,CACA,SAAA,CACA,YAAA,CAEF,6DACE,YAAA,CACA,qBAAA,CACA,SAAA,CACA,eAAA,CAGF,4DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CAEJ,gEACI,SAAA,CACA,eAAA",sourcesContent:[".modalVerificationLayout {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n}\n.sectionHeader{\n display: flex;\n flex-direction: column;\n column-gap: 5px;\n margin-top: 5px;\n margin-bottom: 5px;\n}\n.otpSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 15px;\n}\n.otpForm{\n display: flex;\n flex-direction: column;\n width: 60%;\n row-gap: 20px;\n}\n.otpTimer{\n display: flex;\n flex-direction: column;\n width: 50%;\n padding-top: 15%;\n}\n\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n margin-top: 10px;\n}\n.formControl{\n width: 70%;\n margin-top: 10px;\n}\n"],sourceRoot:""}]),i.locals={modalVerificationLayout:"-esm-dha-workflow__otp-verification-modal__modalVerificationLayout___MST8n",sectionHeader:"-esm-dha-workflow__otp-verification-modal__sectionHeader___g62oo",otpSection:"-esm-dha-workflow__otp-verification-modal__otpSection___R+cLH",otpForm:"-esm-dha-workflow__otp-verification-modal__otpForm___6EDu+",otpTimer:"-esm-dha-workflow__otp-verification-modal__otpTimer___ckBNm",formRow:"-esm-dha-workflow__otp-verification-modal__formRow___8sAxU",formControl:"-esm-dha-workflow__otp-verification-modal__formControl___nN1HY"};const l=i},86575:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__client-details-modal__clientDetailsLayout___r5WF\\+{display:flex;flex-direction:column;width:100%;row-gap:5px}.-esm-dha-workflow__client-details-modal__sectionHeader___lH-gL{display:flex;flex-direction:column;row-gap:5px;margin-top:5px;margin-bottom:10px}.-esm-dha-workflow__client-details-modal__sectionContent___QDFT7{display:flex;flex-direction:column;row-gap:5px}.-esm-dha-workflow__client-details-modal__actionSection___okVDp{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__client-details-modal__btnContainer___ETNEk{margin-top:2px;margin-bottom:2px}","",{version:3,sources:["webpack://./src/registry/modal/client-details-modal/client-details-modal.scss"],names:[],mappings:"AAAA,uEACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,WAAA,CACA,cAAA,CACA,kBAAA,CAEJ,iEACI,YAAA,CACA,qBAAA,CACA,WAAA,CAEJ,gEACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEJ,+DACI,cAAA,CACA,iBAAA",sourcesContent:[".clientDetailsLayout{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n}\n.sectionHeader{\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n margin-top: 5px;\n margin-bottom: 10px;\n}\n.sectionContent{\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n}\n.actionSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.btnContainer{\n margin-top: 2px;\n margin-bottom: 2px;\n}"],sourceRoot:""}]),i.locals={clientDetailsLayout:"-esm-dha-workflow__client-details-modal__clientDetailsLayout___r5WF+",sectionHeader:"-esm-dha-workflow__client-details-modal__sectionHeader___lH-gL",sectionContent:"-esm-dha-workflow__client-details-modal__sectionContent___QDFT7",actionSection:"-esm-dha-workflow__client-details-modal__actionSection___okVDp",btnContainer:"-esm-dha-workflow__client-details-modal__btnContainer___ETNEk"};const l=i},96622:(e,t,n)=>{n.d(t,{N:()=>r});var r={HOUSE_HOLD_NUMBER_UUID:"bb74b20e-dcee-4f59-bdf1-2dffc3abf106",SHA_UUID:"cf5362b2-8049-4442-b3c6-36f870e320cb",CLIENT_REGISTRY_NO_UUID:"e88dc246-3614-4ee3-8141-1f2a83054e72",NATIONAL_ID_UUID:"58a47054-1359-11df-a1f1-0026b9348838",PROVIDER_NATIONAL_ID_UUID:"4550df92-c684-4597-8ab8-d6b10eabdcfb",REFUGEE_ID_UUID:"465e81af-8d69-47e9-9127-53a94adc75fb",MANDATE_NUMBER_UUID:"aae2d097-20ba-43ca-9b71-fd8296068f39",ALIEN_ID_UUID:"12f5b147-3403-4a73-913d-7ded9ffec094",TEMPORARY_DEPENDANT_ID_UUID:"a3d34214-93e8-4faf-bf4d-0272eee079eb",AMRS_UNIVERSAL_ID_UUID:"58a4732e-1359-11df-a1f1-0026b9348838",UPI_NUMBER_UUID:"cba702b9-4664-4b43-83f1-9ab473cbd64d",BIRTH_CERTIFICATE_NUMBER_UUID:"7924e13b-131a-4da8-8efa-e294184a1b0d",BIRTH_NOTIFICATION_UUID:"10a4349d-dd1b-4b0c-bd35-a00a22394266"}}}]);
|