hplx-feature-library 1.0.221 → 1.0.223
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/PatientPopup/index.js +1 -1
- package/dist/{PatientPopupContainer-01TVoq-l.cjs → PatientPopupContainer-C7Y9w79Y.cjs} +2 -2
- package/dist/{PatientPopupContainer-DR5aP_eg.js → PatientPopupContainer-ci6LHf6q.js} +4 -2
- package/dist/{PrintModal-C0ullnUh.cjs → PrintModal-C7QPU-Sg.cjs} +4 -4
- package/dist/{PrintModal-D25hmhNL.js → PrintModal-Di2l9BWm.js} +6 -36
- package/dist/index.js +2 -2
- package/dist/print-pdf/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./index-CJ2AKRoq.cjs"),v=require("react"),J=require("./common-utils-BNaPcohw.cjs"),ne=require("./PrintModal-
|
|
1
|
+
"use strict";const e=require("./index-CJ2AKRoq.cjs"),v=require("react"),J=require("./common-utils-BNaPcohw.cjs"),ne=require("./PrintModal-C7QPU-Sg.cjs"),Zr=require("./APIAction-Bev2spv1.cjs"),Yt=require("./CommonConstant-COHqiSWL.cjs"),$r=require("./index.esm-BdlMQ1M7.cjs");;/* empty css */const jl=require("./useMediaQuery-D4SIgdMW.cjs"),en=require("./ReusableModal-2GKjVVbf.cjs"),Bl={color:"white"},_r=i=>e.jsxRuntimeExports.jsx("div",{children:i.isRequired&&e.jsxRuntimeExports.jsx("a",{href:i.goToPage,children:e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-flex-col hfl-items-center hfl-rounded hfl-px-2 hfl-py-1 ${i.color}
|
|
2
2
|
${i.disabled?"hfl-cursor-not-allowed ":"hfl-cursor-pointer"} ${i.isSelected?"hfl-bg-White_20 hfl-bg-opacity-10 ":""} `,onClick:i.disabled?()=>{}:i.onClickHandler,title:i.disabled?"Low internet speed. Feature available only in online mode":i.label,"data-qa":i.data_qa,children:[i.src&&e.jsxRuntimeExports.jsx("img",{className:"hfl-w-[22px]",src:i.src,alt:"no-img"}),i.icon&&e.jsxRuntimeExports.jsx("i",{className:i.icon+" hfl-text-5 ",style:Bl}),e.jsxRuntimeExports.jsx("div",{className:"hfl-text-1",children:e.jsxRuntimeExports.jsx(e.bs,{variant:i.isSelected?"Bold":"Regular",type:"Text sm",style:Bl,className:"hover:hfl-underline",children:i.label})})]})})}),Dt=v.createContext({currentWindow:"",isLoading:!1,formattedService:void 0,billPreferences:void 0,doctorListArr:void 0,serviceListArr:void 0,patientDetails:void 0,preferences:void 0,patientIDs:void 0,docPreference:void 0,showPrintModal:{visible:!1,whichPreview:"",printData:"",visitId:"",visit_date:"",details:null,visit_number:0,printDataFrom:"",currentPrintTime:0,printType:"",trackEventHandler:()=>{},appointmentInfo:void 0},ppEventProps:{patient_id:"",patient_registered_date:"",patient_age:"",patient_gender:""},patientCustomFieldData:[],setShowPrintModal:()=>{},setEndConsultationClicked:()=>{},setLoading:()=>{},setLastBillPaymentData:()=>{},getAndSetServiceListArr:async()=>{},getLastBillsPaymentData:async()=>{},showToast:()=>{},variable:{token:"",enc_token:"",envName:J.E_ENVIRONMENT.DEVELOPMENT}}),ml="data:image/svg+xml,%3csvg%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='22'%20height='22'%20fill='url(%23pattern0)'/%3e%3cdefs%3e%3cpattern%20id='pattern0'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_3069_356'%20transform='scale(0.00666667)'/%3e%3c/pattern%3e%3cimage%20id='image0_3069_356'%20width='150'%20height='150'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAMP2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBoAQSkhN4EkRpASggt9I4gKiEJE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uNJMz9TJlv3b4YHVeJijFq6epck8Pt1YVR3JQQKTwcJY4UfQn+AK0MeQJwrW/RDOvuLHe/f4shcrNlCPiQ5m950g6sGpEwMCPNlHLIB8kdSVG4BYAgAAXDjMAbBYOBd/8pl8BkoFu6oglVPx2XLO2FIivpfwpkYVnOgMyc4qOUksEoAg4SwUcfRNbDQuRJ08hfuplkd3T1MkDFm+Y2FSDlfboUunApb5SSS+s8PPcCxnpiYnP8FQXhVlrKicJoGyz/oYtucFMJAkxMCR2hBDWAvBhupIT42jKQTMFNKFxfHwMD8WoX5iNgo9DiFtEGdcjSioR9QJkYYP36PnI2atMq4TritmJRwbf8JKLlEpUiSBfvly5k6q/vHrbEkcax6nKx87JbAaExwgo9LSEYaCksHaM8VD9CVl/aCTgYtJmAsJjb/+hnqcNL6dv0sEAAGchgLAYLZmoVxyFlwJ90FnMhjSpV4eZfLu4RmcLz1LFtMjPW3RmGwLVXSKU5fQoVOMqJlBTHw2Ra71MPbVFJcN1J/KG6Mrq4glvU4l5JreOJVRZAIDOBlAAQqBTYkvjSoXQMM1fK6ey4l9h/k7H9cZJTK9zNf7rCw08Kg8NiJdFhmYtf2BsR1KAW80Wpu/djlgWaNQ0sfbg4zFtbHG8+VRhjpNkO7chViJ3iA3cpotSZ3an/UhBt/FIlV6lBsUUrVET3JJoE+e1MurTOrrUSINCMoLkIfmubqd6eJI3N/cFHBTwE0BNwXcFHBTwE0BNwXcFHBTwE0BNwXcFHA2Bf4/oyfH8g/DggoAAAAASUVORK5CYII='/%3e%3c/defs%3e%3c/svg%3e",Wl={appnt_id:"",patient_role_id:"",appnt_doctor_role_id:"",appnt_service_id:"",appnt_date:"",appnt_time:"",appnt_status:0,appnt_duration:"15",appnt_doctor_name:"",appnt_service_name:"",order_item_id:"",item_quantity:"0",order_unit_item_price:"0",order_item_price:"0",order_item_discount:"0",order_item_service_tax:"0",total_price:"0",appnt_created_on:"",order_item_created_on:""},tn={order_item_id:"",service_id:"",service_name:"",service_category:"",service_category_id:"",item_quantity:"",order_unit_item_price:"",order_item_price:"",order_item_discount:"",order_item_service_tax:"",created_on:"",bill_item_details:{appointment_details:null,doctor_name:"",lab_owner_name:"",lab_owner_id:"0"}},hl=[{order_id:"",order_date:"",order_created_on:"",service_category:"",service_category_id:"",order_id_str:"",order_total:"",order_paid_amount:"",order_item_sum_discount:"",order_discount:"",refund_amount:"",order_service_tax:"",balance_amount:"",net_bill_amount:"",order_item_id:"",service_id:"",service_name:"",item_quantity:"",order_unit_item_price:"",order_item_price:"",order_item_discount:"",order_item_service_tax:"",order_item_service_tax_percent:"",created_on:"",net_amount:""}],Dr=[{label:"5 min",value:5},{label:"10 min",value:10},{label:"15 min",value:15},{label:"20 min",value:20},{label:"30 min",value:30},{label:"45 min",value:45},{label:"1 hour",value:60},{label:"1:30 hours",value:90},{label:"2 hours",value:120},{label:"2:30 hours",value:150},{label:"3 hours",value:180}],rn=10,sn=10,dt=["bill_summary","service_level_bill","consult_details","lab_detail","other_detail","payment_summary","delete_item","deposit","deposit_summary","payment_mode"],Et=["Doctor consultation","Other Services","Internal lab tests"],Yr=["CASH","CARD","M-WALLET","UPI/UPI QR SCAN","CHEQUE","BANK TRANSFER","INSURANCE","PATIENT APP","HBOOK","DEPOSIT","CREDIT","CGHS","RGHS","PMJAY","AYUSHMAN BHARAT"],As=["CASH","CARD","UPI/UPI QR SCAN","M-WALLET","CHEQUE","BANK TRANSFER"],Xr={0:"M",1:"F",2:"O"};var qr=(i=>(i.CASH="CASH",i.CARD="CARD",i["M-WALLET"]="M-WALLET",i.CHEQUE="CHEQUE",i["BANK TRANSFER"]="BANK_TRANSFER",i.INSURANCE="INSURANCE",i["PATIENT APP"]="PATIENT_APP",i.HBOOK="HBOOK",i.DEPOSIT="DEPOSIT",i["UPI/UPI QR SCAN"]="UPI",i.CREDIT="CREDIT_MODE",i.CGHS="CGHS",i.RGHS="RGHS",i.PMJAY="PMJAY",i["AYUSHMAN BHARAT"]="AYUSHMAN BHARAT",i))(qr||{}),or=(i=>(i[i.CASH=0]="CASH",i[i.CARD=1]="CARD",i[i["M-WALLET"]=2]="M-WALLET",i[i.CHEQUE=3]="CHEQUE",i[i["BANK TRANSFER"]=4]="BANK TRANSFER",i[i.INSURANCE=5]="INSURANCE",i[i["PATIENT APP"]=6]="PATIENT APP",i[i.HBOOK=7]="HBOOK",i[i.DEPOSIT=8]="DEPOSIT",i[i["UPI/UPI QR SCAN"]=9]="UPI/UPI QR SCAN",i[i.CREDIT=10]="CREDIT",i[i.CGHS=11]="CGHS",i[i.RGHS=12]="RGHS",i[i.PMJAY=13]="PMJAY",i[i["AYUSHMAN BHARAT"]=14]="AYUSHMAN BHARAT",i))(or||{}),br=(i=>(i.deposit_refund="deposit_refund",i.consultation_lab_other_services="consultation_lab_other_services",i))(br||{});const dr={consultation_lab_other_services:{key:"consultation_lab_other_services",label:"Consultation, Lab and Other Services"},deposit_refund:{key:"deposit_refund",label:"Deposits and Refunds"}};var $t=(i=>(i.lis_report="lis_report",i.healthplix_report="healthplix_report",i))($t||{});const zr={lis_report:{key:"lis_report",label:"LIS Reports"},healthplix_report:{key:"healthplix_report",label:"HealthPlix Reports"}},jt=["abha","appointment","add_bills","bills","payments","visits","lab","doc","profile"],ln={margin_left:"leftMargin",margin_right:"rightMargin",header_height:"headerHeight",footer_height:"footerHeight",page_height:"pageHeight",pdf_margin_left:"leftMarginPdf",pdf_margin_right:"rightMarginPdf",pdf_header_height:"headerHeightPdf",pdf_footer_height:"footerHeightPdf",patient_img_height:"patientImageHeight",patient_img_width:"patientImageWidth",font_family:"fontFamily",font_size:"fontSize",font_size_compensation:"fontSizeCompen",field_phone_number:"print_phoneNum",field_address:"print_address",field_refer_by:"refer_by",field_channel_through:"channel_through",field_department_name:"department_name",field_doctor_name:"doctor_name",field_visit_number:"visit_number",not_include_sub_header:"notIncludeSubHeader",show_print_preview:"showPrintPreview",default_language:"defaultLanguage",print_sign_img:"print_signImg"},xl=[{value:0,text:"BOOKED",text_color:"hfl-text-Primary-700"},{value:1,text:"REVIEWED",text_color:"hfl-text-Gray-400 group-hover:hfl-text-Gray-500"},{value:2,text:"CANCELLED",text_color:"hfl-text-Error-600"},{value:3,text:"ARRIVED",text_color:"hfl-text-Primary-700"},{value:5,text:"ON-GOING",text_color:"hfl-text-Success-700"}],nn=async({callback:i},d,c)=>{try{const n={branch_id:c.window_var.org_branch_id_for_seg,person_id:c.window_var.person_id_for_seg,person_role_id:c.window_var.doctor_role_id_for_seg,patient_role_id:d};window?.partner_service_enabled==="1"&&(n.partner_service_enabled=!0);const y=await J.ReArchAPI(c.token,c.envName).post(Zr.GET_PATIENT_DETAILS,{...n}),{data:R}=y||{},{error:l}=R||{};if(l)throw new Error(l);i(R)}catch(n){console.log(n),i(void 0)}},an=async i=>{try{const d=await J.ReArchAPI(i.token,i.envName).get(ne.GET_SERVICE_LIST+"/"+i.window_var.org_branch_id_for_seg+"?doctor_role_id="+i.window_var.doctor_role_id_for_seg+"&doctor_id="+i.window_var.person_id_for_seg),{data:c}=d||{};return Promise.resolve(c)}catch(d){return console.log(d),Promise.reject(d)}},on=async i=>{try{const d=await J.ReArchAPI(i.token,i.envName).get(ne.GET_DOCTORS_LIST+"/"+i.window_var.org_branch_id_for_seg+"?doctor_role_id="+i.window_var.doctor_role_id_for_seg+"&doctor_id="+i.window_var.person_id_for_seg),{data:c}=d||{};return Promise.resolve(c)}catch(d){return console.log(d),Promise.reject(d)}},gl=async(i="all",d,c=1,n=20,y)=>{try{const R=await J.ReArchAPI(y.token,y.envName).get(`${ne.GET_BILLS}?date=${i}&patient_role_id=${d}&page_no=${c}&page_size=${n}&org_branch_id=${y.window_var.org_branch_id_for_seg}`),{data:l}=R||{};return Promise.resolve(l)}catch(R){return console.log(R),Promise.reject(R)}},vl=async(i,d=1,c=10,n)=>{try{const y=await J.ReArchAPI(n.token,n.envName).get(`${ne.GET_PAYMENT}?patient_role_id=${i}&branch_id=${n.window_var.org_branch_id_for_seg}&page_number=${d}&page_size=${c}`),{data:R}=y||{};return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},Rl=async(i,d,c)=>{try{const n=await J.ReArchAPI(c.token,c.envName).get(`${ne.GET_BILL_ITEM}?order_item_id=${i}&patient_role_id=${d}&org_branch_id=${c.window_var.org_branch_id_for_seg}`),{data:y}=n||{};return Promise.resolve(y)}catch(n){return console.log(n),Promise.reject(n)}},yl=async(i,d,c=!0,n)=>{try{const y=await J.ReArchAPI(n.token,n.envName).get(`${ne.GET_PAST_DUE}?bill_date=${i}&org_branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${d}&past_due=${c}`),{data:R}=y||{};return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},un=async(i,d,c)=>{try{const n=await J.ReArchAPI(c.token,c.envName).get(`${ne.GET_BILL_SUMMARY}/${i}/${d}?doctor_role_id=${c.window_var.doctor_role_id_for_seg}&doctor_id=${c.window_var.person_id_for_seg}&org_branch_id=${c.window_var.org_branch_id_for_seg}`),{data:y}=n||{};return Promise.resolve(y)}catch(n){return console.log(n),Promise.reject(n)}},cn=async(i,d,c,n)=>{try{const y={billing_person_role_id:+n.window_var.doctor_role_id_for_seg,org_branch_id:+n.window_var.org_branch_id_for_seg,patient_role_id:+d,doctor_id:+n.window_var.person_id_for_seg,billing_person_role:11,bill_details:{appnt_id:+i?.appnt_id||0,discount:+i?.order_item_discount,order_date:c,quantity:+i?.item_quantity,referrer_doctor_role_id:+i?.bill_item_details?.referrer_doctor_role_id||i?.appnt_doctor_role_id||0,service_category:Et.indexOf(i?.service_category)+1,service_id:+i?.service_id,service_name:i?.service_name,service_tax:Math.floor(i?.order_item_service_tax)||0,unit_price:+i?.order_unit_item_price||0,appnt_doctor_role_id:+i?.appnt_doctor_role_id||0,doctor_name:i?.bill_item_details?.doctor_name||"",lab_owner_name:i?.bill_item_details?.lab_owner_name||"",lab_owner_id:+i?.bill_item_details?.lab_owner_id||0}},R=await J.ReArchAPI(n.token,n.envName).post(ne.GET_BILLS,{...y}),{data:l}=R||{};return Promise.resolve(l)}catch(y){return console.log(y),Promise.reject(y)}},dn=async(i,d,c)=>{try{const n={org_branch_id:+c.window_var.org_branch_id_for_seg,doctor_id:+c.window_var.person_id_for_seg,patient_role_id:+d,order_item_price:+i.order_item_price,order_item_id:+i.order_item_id,service_id:+i.service_id,service_name:i.service_name,item_quantity:+i.item_quantity,order_unit_item_price:+i.order_unit_item_price,order_item_discount:+i.order_item_discount,order_item_service_tax:Math.floor(i.order_item_service_tax)},y=await J.ReArchAPI(c.token,c.envName).put(ne.PUT_BILL_ITEM,{...n}),{data:R}=y||{};return Promise.resolve(R)}catch(n){return console.log(n),Promise.reject(n)}},pl=async(i,d,c,n,y,R={},l)=>{try{const A={action:i,amount:d,order_id:+c,billing_person_role_id:+l.window_var.doctor_role_id_for_seg,patient_role_id:+y,payment_split:n,org_branch_id:+l.window_var.org_branch_id_for_seg,refund_details:R},S=await J.ReArchAPI(l.token,l.envName).put(ne.PUT_BILLS,{...A}),{data:h}=S||{};return Promise.resolve(h)}catch(A){return console.log(A),Promise.reject(A)}},zl=async(i,d,c,n,y,R)=>{try{const l=await J.ReArchAPI(R.token,R.envName).delete(`${ne.DELETE_BILL_ITEM}?deleting_person_role_id=${R.window_var.doctor_role_id_for_seg}&mode=${y}&order_id=${i}&order_item_id=${d}&org_branch_id=${R.window_var.org_branch_id_for_seg}&patient_role_id=${c}&reason=${n}`),{data:A}=l||{};return Promise.resolve(A)}catch(l){return console.log(l),Promise.reject(l)}},Bs=async(i="all",d,c=1,n=10,y=!1,R)=>{try{const l=await J.ReArchAPI(R.token,R.envName).get(`${ne.GET_APPOINTMENTS}?appnt_date=${i}&patient_role_id=${d}&doctor_id=${R.window_var.person_id_for_seg}&org_branch_id=${R.window_var.org_branch_id_for_seg}&page_no=${c}&page_size=${n}&skip_appnt_with_bill=${y}`),{data:A}=l||{};return Promise.resolve(A)}catch(l){return console.log(l),Promise.reject(l)}},fn=async(i,d="all",c="0",n)=>{try{const y=await J.ReArchAPI(n.token,n.envName).get(`${ne.GET_APPOINTMENTS}/services/${i}?appnt_date=${d}&doctor_id=${n.window_var.person_id_for_seg}&org_branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${c}`),{data:R}=y||{};return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},hn=async(i,d,c,n,y,R,l)=>{try{const A={doctor_id:+l.window_var.person_id_for_seg,patient_role_id:+y,org_branch_id:+l.window_var.org_branch_id_for_seg,billing_person_role_id:+l.window_var.doctor_role_id_for_seg,appnt_date:i.appnt_date,patient_name:c,patient_phone_number:n,appnt_doctor_name:i.appnt_doctor_name,appnt_doctor_role_id:+i.appnt_doctor_role_id,appnt_duration:+i.appnt_duration,appnt_service_id:+i?.service_id||+i.appnt_service_id,appnt_service_name:i?.service_name||i.appnt_service_name,appnt_status:+i.appnt_status,appnt_time:i.appnt_time,skip_appnt_bill:d,order_date:J.dayjs().format("YYYY-MM-DD"),item_quantity:+i.item_quantity,order_item_discount:+i.order_item_discount,order_item_price:+i.order_item_price,order_item_service_tax:Math.floor(i.order_item_service_tax),order_unit_item_price:+i.order_unit_item_price,is_partner_appointment:R},S=await J.ReArchAPI(l.token,l.envName).post(ne.PUT_APPOINTMENTS,{...A}),{data:h}=S||{};return Promise.resolve(h)}catch(A){return console.log(A),Promise.reject(A)}},pn=async(i,d,c,n,y)=>{try{const R={doctor_id:y.window_var.person_id_for_seg,patient_role_id:n,org_branch_id:+y.window_var.org_branch_id_for_seg,billing_person_role_id:y.window_var.doctor_role_id_for_seg,appnt_id:+i.appnt_id,appnt_date:J.dayjs(i.appnt_date).format("YYYY-MM-DD"),patient_name:c,appnt_doctor_name:i.appnt_doctor_name,appnt_doctor_role_id:+i.appnt_doctor_role_id,appnt_duration:+i.appnt_duration,appnt_service_id:+i.appnt_service_id,appnt_service_name:i.appnt_service_name,appnt_status:+i.appnt_status,appnt_time:i.appnt_time,skip_appnt_bill:d,order_date:J.dayjs().format("YYYY-MM-DD"),item_quantity:+i.item_quantity,order_item_discount:+i.order_item_discount,order_item_price:+i.order_item_price,order_item_service_tax:Math.floor(i.order_item_service_tax),order_unit_item_price:+i.order_unit_item_price},l=await J.ReArchAPI(y.token,y.envName).put(ne.PUT_APPOINTMENTS,{...R}),{data:A}=l||{};return Promise.resolve(A)}catch(R){return console.log(R),Promise.reject(R)}},mn=async(i="",d)=>{try{const c=await J.ReArchAPI(d.token,d.envName).get(`${ne.GET_BRANCH_PREFERENCE}/${d.window_var.org_branch_id_for_seg}?fields_required=${i}`),{data:n}=c||{};return Promise.resolve(n)}catch(c){return console.log(c),Promise.reject(c)}},xn=async(i,d,c="",n)=>{try{const y={branch_id:n.window_var.org_branch_id_for_seg,doctor_id:n.window_var.person_id_for_seg,doctor_role_id:n.window_var.doctor_role_id_for_seg,patient_role_id:d,extra:{visit_date:J.dayjs(i).format("DD-MMM-YYYY")},page_config:{page_number:1,page_size:1},metadata_preference:{patient_history:!0,obstetric_history:!0,menstrual_info:!0,physical_examination:!0,lab_tests_n_imaging:!0,drawing_board:!0},visit_id:c},R=await J.ReArchAPI(n.token,n.envName).post(ne.GET_VISIT_ALL,{...y}),{data:l}=R||{};return Promise.resolve(l)}catch(y){return console.log(y),Promise.reject(y)}},gn=async(i,d,c,n)=>{try{const y=await J.ReArchAPI(n.enc_token,n.envName).get(`${ne.GET_PATIENT_POPUP_HPLXLAB}/${c}/reports?page=${d}&limit=${i}`),{data:R}=y||{},{status:l,message:A}=R||{};if(!l)throw new Error(A);return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},vn=async(i,d,c,n)=>{try{const y=await J.ReArchAPI(n.token,n.envName).get(`${ne.GET_PATIENT_POPUP_VISIT}/${c}?doctor_role_id=${n.window_var.doctor_role_id_for_seg}&doctor_id=${n.window_var.person_id_for_seg}&branch_id=${n.window_var.org_branch_id_for_seg}&page_size=${i}&page_number=${d}`),{data:R}=y||{},{error:l}=R||{};if(l)throw new Error(l);return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},yn=async(i,d,c)=>{const{patientRoleID:n,patientID:y}=c||{};try{const R=await J.ReArchAPI(d.token,d.envName).put(ne.UPDATE_PATIENT_DETAIL+"/"+n,{...i,person_role_id:d.window_var.doctor_role_id_for_seg,person_id:d.window_var.person_id_for_seg,branch_id:d.window_var.org_branch_id_for_seg,patient_role_id:n,patient_id:y}),{data:l}=R||{};return l?.status&&typeof d.window_var.getUpdatedPatientDetails=="function"&&y===d.window_var.patient_person_id&&n===d.window_var.patient_role_id&&d.window_var.getUpdatedPatientDetails(),Promise.resolve(l)}catch(R){return console.log(R),Promise.reject(R)}},_n=async i=>{try{const d=await J.hplxAPI(i.token,i.envName).post(ne.GET_REFERREDBY_DOCTOR),{data:c}=d||{},{apiError:n}=c||{};if(n)throw new Error(n);return Promise.resolve(c)}catch(d){return console.log(d),Promise.reject(d)}},bn=async(i,d)=>{try{const c=await J.hplxAPI(i.token,i.envName).post(`${ne.GET_IPD_CASE}?pid=${d}`),{data:n}=c||{};return Promise.resolve(n)}catch(c){return console.log(c),Promise.reject(c)}},jn=i=>{const d=[];if(i.length)for(const c of i)d.push({title:c,value:c});return d},Rn=i=>{const d=[];if(i.length)for(const c of i)d.push({doctor_id:c.doctor_id?c.doctor_id:"",doctor_name:c.doctor_name?c.doctor_name:"",label:c.doctor_name?c.doctor_name:"",specialist:c.specialist||""});return d},wn=async(i,d)=>{try{const c=await J.hplxAPI(d.token,d.envName).post(ne.ADD_PATIENT_IMAGE,i),{data:n}=c||{};return Promise.resolve(n)}catch(c){return console.log(c),Promise.reject(c)}},Cn=async(i,d,c,n,y)=>{try{const R={billing_person_id:y.window_var.person_id_for_seg,billing_person_role_id:y.window_var.doctor_role_id_for_seg,patient_role_id:n,org_branch_id:y.window_var.org_branch_id_for_seg,total_amount:i,data:d,payment_split:c},l=await J.ReArchAPI(y.token,y.envName).post(ne.POST_PAYMENT,{...R}),{data:A}=l||{};return Promise.resolve(A)}catch(R){return console.log(R),Promise.reject(R)}},En=async(i="",d)=>{try{const c=await J.ReArchAPI(d.token,d.envName).get(ne.GET_REFERRAL+"/"+d.window_var.org_branch_id_for_seg+`?type=null&query=${i}&doctor_role_id=`+d.window_var.doctor_role_id_for_seg+"&doctor_id="+d.window_var.person_id_for_seg),{data:n}=c||{};return Promise.resolve(n)}catch(c){return console.log(c),Promise.reject(c)}},Pn=async(i,d,c)=>{try{const n={org_branch_id:+c.window_var.org_branch_id_for_seg,patient_role_id:+d,doctor_role_id:+c.window_var.doctor_role_id_for_seg,doctor_id:+c.window_var.person_id_for_seg,referral_name:i,is_lab_referral:!0},y=await J.ReArchAPI(c.token,c.envName).post(ne.GET_REFERRAL,{...n}),{data:R}=y||{};return Promise.resolve(R)}catch(n){return console.log(n),Promise.reject(n)}},Sn=async(i,d,c,n,y)=>{try{const R=await J.ReArchAPI(y.token,y.envName).delete(`${ne.DELETE_TRANSACTION}/${i}/${d}?org_branch_id=${y.window_var.org_branch_id_for_seg}&patient_role_id=${n}&order_id=${c}&deleting_person_role_id=${y.window_var.doctor_role_id_for_seg}&doctor_role_id=${y.window_var.doctor_role_id_for_seg}&doctor_id=${y.window_var.person_id_for_seg}`),{data:l}=R||{};return Promise.resolve(l)}catch(R){return console.log(R),Promise.reject(R)}},wl=async(i,d,c,n)=>{try{let y="";c.forEach((A,S)=>{y="fields="+A+(S<c.length-1?"&":"")});const R=await J.ReArchAPI(n.token,n.envName).get(`${ne.GET_BILLS_PAYMENTS_BILL_ID}/${i}?branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${d}&${y}`),{data:l}=R||{};return Promise.resolve(l)}catch(y){return console.log(y),Promise.reject(y)}},Yl=async(i,d,c)=>{const n={patient_role_id:i,patient_id:d,branch_id:c.window_var.org_branch_id_for_seg};try{const y=await J.ReArchAPI(c.token,c.envName).post(ne.GET_ABHA_INFO,n),{data:R}=y||{};return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},Nn=async(i,d)=>{const c={scope:i?.includes("@")?"abha_address":"abha_number",AbhaAddress:i,branch_id:d.window_var.org_branch_id_for_seg};try{const n=await J.ReArchAPI(d.token,d.envName).post(ne.GENERATE_OTP_BY_ABHA_ADDRESS,c),{data:y}=n||{};return Promise.resolve(y)}catch(n){return console.log(n),Promise.reject(n)}},An=async(i,d,c,n,y)=>{const R={abha_address:i,otp:d,patient_role_id:c,patient_id:n,branch_id:y.window_var.org_branch_id_for_seg};try{const l=await J.ReArchAPI(y.token,y.envName).post(ne.VERIFY_ABHA_OTP,R),{data:A}=l||{};return Promise.resolve(A)}catch(l){return console.log(l),Promise.reject(l)}},Dn=async(i,d)=>{const c={abha_address:i,doctor_name:d.window_var.doc_name_for_seg,branch_name:d.window_var.current_branch_name||"",doctor_role_id:d.window_var.doctor_role_id_for_seg,description:"Auto initiated",branch_id:d.window_var.org_branch_id_for_seg};try{const n=await J.ReArchAPI(d.token,d.envName).post(ne.GET_ABHA_CONSENT,c),{data:y}=n||{};return Promise.resolve(y)}catch(n){return console.log(n),Promise.reject(n)}},In=async(i,d)=>{try{const c=await J.ReArchAPI(d.token,d.envName).get(`${ne.GET_INSURANCE_LIST}/${i}`),{data:n}=c||{};return Promise.resolve(n)}catch(c){return console.log(c),Promise.reject(c)}},Tn=async i=>{try{const d={doctor_id:i.window_var.person_id_for_seg},c=await J.ReArchAPI(i.token,i.envName).post(ne.GET_CUSTOM_TRANSLATIONS,{...d}),{data:n,status:y}=c||{};if(y!==200)throw new Error("error");return Promise.resolve(n)}catch(d){return console.log(d),Promise.reject(d)}},Bn=async(i,d)=>{try{const c={branch_id:d.window_var.org_branch_id_for_seg,doctor_id:d.window_var.person_id_for_seg,...i},n=await J.ReArchAPI(d.token,d.envName).post(ne.VERIFY_INSURANCE,{...c});return Promise.resolve(n)}catch(c){return Promise.resolve(c)}},Gn=async i=>{try{const d={org_branch_id:i.window_var.org_branch_id_for_seg,doctor_id:i.window_var.person_id_for_seg,doctor_role_id:i.window_var.doctor_role_id_for_seg,master_tests_needed:!1},c=await J.ReArchAPI(i.token,i.envName).post(ne.GET_ONLINE_TEST_RANGES,{...d}),{data:n,status:y}=c||{};if(y!==200)throw new Error("error");return Promise.resolve(n)}catch(d){return console.log(d),Promise.reject(d)}},Gl=async(i,d,c)=>{try{const n=await J.ReArchAPI(c.enc_token,c.envName).post(ne.UPDATE_WALLET,{...d,emr_entity_id:i,branch_id:c.window_var.org_branch_id_for_seg,entity_type:"PATIENT_BRANCH"}),{data:y}=n||{};if(y?.status)return Promise.resolve(y)}catch(n){return console.log(n),Promise.reject(n)}},Cl=async(i,d)=>{try{const c=d.window_var.org_branch_id_for_seg;if(!i||!c)throw new Error("Patient ID or Branch ID is missing.");const n=await J.ReArchAPI(d.enc_token,d.envName).get(`${ne.UPDATE_WALLET}/balance?emr_entity_id=${i}&entity_type=PATIENT_BRANCH&branch_id=${c}`),{data:y}=n;if(y?.status)return Promise.resolve(y);throw new Error(y?.message||"API returned a non-successful status for wallet balance.")}catch(c){console.error("Failed to get wallet balance:",c)}},_l=async(i,d=1,c=10,n)=>{try{const y=await J.ReArchAPI(n.enc_token,n.envName).get(`${ne.UPDATE_WALLET}/transaction?emr_entity_id=${i}&branch_id=${n.window_var.org_branch_id_for_seg}&page_no=${d}&page_size=${c}&entity_type=PATIENT_BRANCH`),{data:R}=y||{};return Promise.resolve(R)}catch(y){return console.log(y),Promise.reject(y)}},Fn=async(i,d,c,n)=>{try{const y={mode:Number(d),transaction_type:c},R=await J.ReArchAPI(n.token,n.envName).patch(`${ne.GET_PAYMENT}/${i}`,y),{data:l}=R||{};return Promise.resolve(l)}catch(y){return console.log(y),Promise.reject(y)}};var Is={exports:{}},Mn=Is.exports,Fl;function Hn(){return Fl||(Fl=1,function(i,d){(function(c,n){i.exports=n()})(Mn,function(){var c={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,y=/\d/,R=/\d\d/,l=/\d\d?/,A=/\d*[^-_:/,()\s\d]+/,S={},h=function(N){return(N=+N)+(N>68?1900:2e3)},O=function(N){return function(P){this[N]=+P}},g=[/[+-]\d\d:?(\d\d)?|Z/,function(N){(this.zone||(this.zone={})).offset=function(P){if(!P||P==="Z")return 0;var I=P.match(/([+-]|\d\d)/g),j=60*I[1]+(+I[2]||0);return j===0?0:I[0]==="+"?-j:j}(N)}],L=function(N){var P=S[N];return P&&(P.indexOf?P:P.s.concat(P.f))},k=function(N,P){var I,j=S.meridiem;if(j){for(var Q=1;Q<=24;Q+=1)if(N.indexOf(j(Q,0,P))>-1){I=Q>12;break}}else I=N===(P?"pm":"PM");return I},W={A:[A,function(N){this.afternoon=k(N,!1)}],a:[A,function(N){this.afternoon=k(N,!0)}],Q:[y,function(N){this.month=3*(N-1)+1}],S:[y,function(N){this.milliseconds=100*+N}],SS:[R,function(N){this.milliseconds=10*+N}],SSS:[/\d{3}/,function(N){this.milliseconds=+N}],s:[l,O("seconds")],ss:[l,O("seconds")],m:[l,O("minutes")],mm:[l,O("minutes")],H:[l,O("hours")],h:[l,O("hours")],HH:[l,O("hours")],hh:[l,O("hours")],D:[l,O("day")],DD:[R,O("day")],Do:[A,function(N){var P=S.ordinal,I=N.match(/\d+/);if(this.day=I[0],P)for(var j=1;j<=31;j+=1)P(j).replace(/\[|\]/g,"")===N&&(this.day=j)}],w:[l,O("week")],ww:[R,O("week")],M:[l,O("month")],MM:[R,O("month")],MMM:[A,function(N){var P=L("months"),I=(L("monthsShort")||P.map(function(j){return j.slice(0,3)})).indexOf(N)+1;if(I<1)throw new Error;this.month=I%12||I}],MMMM:[A,function(N){var P=L("months").indexOf(N)+1;if(P<1)throw new Error;this.month=P%12||P}],Y:[/[+-]?\d+/,O("year")],YY:[R,function(N){this.year=h(N)}],YYYY:[/\d{4}/,O("year")],Z:g,ZZ:g};function D(N){var P,I;P=N,I=S&&S.formats;for(var j=(N=P.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(ie,z,ge){var je=ge&&ge.toUpperCase();return z||I[ge]||c[ge]||I[je].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(fe,He,ae){return He||ae.slice(1)})})).match(n),Q=j.length,F=0;F<Q;F+=1){var M=j[F],V=W[M],te=V&&V[0],Y=V&&V[1];j[F]=Y?{regex:te,parser:Y}:M.replace(/^\[|\]$/g,"")}return function(ie){for(var z={},ge=0,je=0;ge<Q;ge+=1){var fe=j[ge];if(typeof fe=="string")je+=fe.length;else{var He=fe.regex,ae=fe.parser,q=ie.slice(je),de=He.exec(q)[0];ae.call(z,de),ie=ie.replace(de,"")}}return function(H){var Ee=H.afternoon;if(Ee!==void 0){var Fe=H.hours;Ee?Fe<12&&(H.hours+=12):Fe===12&&(H.hours=0),delete H.afternoon}}(z),z}}return function(N,P,I){I.p.customParseFormat=!0,N&&N.parseTwoDigitYear&&(h=N.parseTwoDigitYear);var j=P.prototype,Q=j.parse;j.parse=function(F){var M=F.date,V=F.utc,te=F.args;this.$u=V;var Y=te[1];if(typeof Y=="string"){var ie=te[2]===!0,z=te[3]===!0,ge=ie||z,je=te[2];z&&(je=te[2]),S=this.$locale(),!ie&&je&&(S=I.Ls[je]),this.$d=function(q,de,H,Ee){try{if(["x","X"].indexOf(de)>-1)return new Date((de==="X"?1e3:1)*q);var Fe=D(de)(q),Le=Fe.year,ft=Fe.month,ct=Fe.day,lt=Fe.hours,ke=Fe.minutes,ht=Fe.seconds,wt=Fe.milliseconds,mt=Fe.zone,St=Fe.week,Tt=new Date,T=ct||(Le||ft?1:Tt.getDate()),Ie=Le||Tt.getFullYear(),Ue=0;Le&&!ft||(Ue=ft>0?ft-1:Tt.getMonth());var se,X=lt||0,Z=ke||0,ue=ht||0,Te=wt||0;return mt?new Date(Date.UTC(Ie,Ue,T,X,Z,ue,Te+60*mt.offset*1e3)):H?new Date(Date.UTC(Ie,Ue,T,X,Z,ue,Te)):(se=new Date(Ie,Ue,T,X,Z,ue,Te),St&&(se=Ee(se).week(St).toDate()),se)}catch{return new Date("")}}(M,Y,V,I),this.init(),je&&je!==!0&&(this.$L=this.locale(je).$L),ge&&M!=this.format(Y)&&(this.$d=new Date("")),S={}}else if(Y instanceof Array)for(var fe=Y.length,He=1;He<=fe;He+=1){te[1]=Y[He-1];var ae=I.apply(this,te);if(ae.isValid()){this.$d=ae.$d,this.$L=ae.$L,this.init();break}He===fe&&(this.$d=new Date(""))}else Q.call(this,F)}}})}(Is)),Is.exports}var Ln=Hn();const kn=e.getDefaultExportFromCjs(Ln);J.dayjs.extend(kn);const ql=(...i)=>{let d=!1;try{const c=/^[a-zA-Z]+$/;for(const n of i){const y=n.toString();if(y.includes(".")||y.includes("-")||c.test(y)){d=!0;break}}}catch{return!1}return d},Ul=async(i,d=!0,c,n,y,R,l,A=!1,S)=>{let h={appnt_id:0,error:"",order_id:"",order_item_id:"",appnt_create_status:!1,appnt_create_message:"",bill_create_status:!1,bill_create_message:""};const O=i.appnt_time_time+" "+i.appnt_time_format;try{if(!i.appnt_doctor_role_id){c("Error","Doctor name is missing","Error",3e3);return}if(!new RegExp(/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(O)){c("Error","Error in time format","Error",3e3);return}if(!i.appnt_service_id){c("Error","Service name is missing","Error",3e3);return}const{item_quantity:L,order_unit_item_price:k,order_item_discount:W,order_item_service_tax:D,order_item_service_tax_percentage:N=0,order_item_price:P}=i;if(!d&&ql(L,k,W,D,P)){c("Error","Value cannot be in decimal or in negative form","Error",3e3);return}if(i={...i,order_item_service_tax:Math.floor(k*L*.01*N),appnt_time:J.dayjs(O,"hh:mm A").format("HH:mm:ss")},i.appnt_id.length)try{const I=await pn(i,d,n?.name,y.patientRoleID,S),j=I.appnt_update_status?"Success":"Error";if(I.appnt_update_message&&(h=I),c(j,I.appnt_update_message,j,3e3),A){const Q=I.bill_update_status?"Success":"Error";c(Q,I.bill_update_message,Q,3e3)}}catch(I){console.error("Error while create/update appointnment",I),c("Error",I.data.message,"Error",3e3)}else{const I=await hn(i,d,n.name,n.phone_number,y.patientRoleID,l,S),j=I.appnt_create_status?"Success":"Error";if(I.appnt_create_status&&(h=I),c(j,I.appnt_create_message,j,3e3),A){const Q=I.bill_create_status?"Success":"Error";c(Q,I.bill_create_message,Q,3e3)}}return h}catch{c("Error","Something went wrong while creating/updating appointment","Error",3e3)}},El=async(i,d,c,n,y,R=Et[0],l)=>{let A={};try{if(R===Et[0]&&!i.appnt_doctor_role_id){d("Error","Doctor name is missing","Error",3e3);return}if(R===Et[0]){const D=i.appnt_time_time+" "+i.appnt_time_format;if(!new RegExp(/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(D)){d("Error","Error in time format","Error",3e3);return}}const{item_quantity:S,order_unit_item_price:h,order_item_service_tax_percentage:O=0,order_item_discount:g,order_item_service_tax:L,order_item_price:k}=i;if(ql(S,h,g,L,k)){d("Error","Value cannot be in decimal or in negative form","Error",3e3);return}i={...i,order_item_service_tax:Math.floor(h*S*.01*O)};try{if(i?.order_item_id?.length){const D=await dn(i,c,l);d(D.status?"Success":"Error",D.message,D.status?"Success":"Error",3e3),D.status&&(A=D)}else{const D=await cn(i,c,n,l);d(D.status?"Success":"Error",D.message,D.status?"Success":"Error",3e3)}}catch(D){console.error("Error while create/update bill",D)}return A}catch{console.log("error in handleCreateUpdateBill API Call"),d("Error","Something went wrong while create update bill","Error",3e3)}},Kl=async(i,d,c)=>{try{const n=await wl(i,d,["payments"],c),y=Array.isArray(n?.payments)?n.payments:[],R=[...new Set(y.map(l=>or[l.mode]).filter(l=>typeof l=="string"))];return{lab_owner_name:n?.lab_owner_name??"",paymentModes:R}}catch(n){return console.error("Error in fetching payment modes from bill id:",n),null}},Vn=async(i,d,c)=>{const n={lab_owner_name:"",paymentsData:new Map([])},y=i.map(l=>wl(l,d,["payments"],c));return(await Promise.all(y)).forEach(l=>{l.service_category_id==3&&(n.lab_owner_name=l.lab_owner_name),Array.isArray(l.payments)&&l.payments.length>0?n.paymentsData.set(l.service_category_id,l.payments.map(A=>A?.mode)):n.paymentsData.set(l.service_category_id,[])}),n},Zl=(i="")=>{switch(i){case"0":return"male";case"1":return"female";case"2":return"others";default:return""}},On={vitals:"vitals",investigationtable:"Investigations",complaints:"Complaints",diagnosis:"Diagnosis",presc:"RxComponent",nextvisit:"FollowUpVisit",referred:"referTo",dietEX:"Diet",tests:"TestsRequested",quicknotes:"QuickNotes",advice:"Advice",systemic:"SystemicExaminations",pickle:"GeneralExaminations",assessment:"Assessment",glassPrescription:"",pediatrics:"",jointExamination:"",customField:"",customField2:"",customField3:"",patienthistory:"PatientHistory",pastMedication:"pastMedication",menstrualInfo:"menstrualInfo",physicalExamination:"physicalExamination",obstetricHistory:"obstetricHistory",labTestImaging:"labTestImaging",drawingBoard:"drawing_board"},Ml=(i,d)=>{let c={};try{c=JSON.parse(d)}catch(R){return console.error("Failed to parse visit_pad_json:",R),[]}const n=Array.isArray(i)?i:i.split(","),y=[];return n.forEach(R=>{let l="";switch(R){case"nextvisit":l="use_next_visit";break;case"referred":l="use_doc_referral";break;case"dietEX":l="use_dietEx";break;case"tests":l="use_test_prescribed";break;case"assesment":l="use_assessment";break;case"quicknotes":l="use_quick_notes";break;case"presc":l="use_print_prescription_method";break;case"systemic":l="use_systemic_exam";break;case"customField":l="use_custom_field";break;case"customField2":l="use_custom_field2";break;case"customField3":l="use_custom_field3";break;case"customField4":l="use_custom_field4";break;case"customField5":l="use_custom_field5";break;case"customField6":l="use_custom_field6";break;case"investigationtable":l="use_investigation_table";break;case"patienthistory":l="patient_history_include";break;case"menstrualInfo":l="use_menstrual_info";break;case"physicalExamination":l="use_physical_examination";break;case"obstetricHistory":l="obstetric_history_include";break;case"labTestImaging":l="use_lab_test_imaging";break;case"vitals":l="use_vitals";break;case"pastMedication":l="use_past_medication";break;case"drawing_board":l="drawing_board";break;default:l="use_"+R}const A=c?.[l];A&&(R==="presc"||A?.include==="1")&&(R==="obstetricHistory"&&c?.obhGpla?.include==="0"&&c?.obhPregnancyHistory?.include==="0"||y.push(R))}),y.map(R=>On[R]||R)},Wn="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cpath%20d='M7.6665%206.00004C8.95517%206.00004%209.99984%204.95537%209.99984%203.66671C9.99984%202.37804%208.95517%201.33337%207.6665%201.33337C6.37784%201.33337%205.33317%202.37804%205.33317%203.66671C5.33317%204.95537%206.37784%206.00004%207.6665%206.00004Z'%20fill='%23039855'/%3e%3cpath%20d='M4.65017%205.75205C4.49106%205.52233%204.4115%205.40747%204.32581%205.36953C4.24888%205.33547%204.1679%205.3313%204.08788%205.35729C3.99875%205.38624%203.92865%205.46803%203.78845%205.6316C3.22585%206.28801%202.84213%207.10277%202.71374%208.00016H2.6665C2.29831%208.00016%201.99984%207.70168%201.99984%207.33349C1.99984%207.08757%202.13265%206.87188%202.33365%206.75561C2.65236%206.57125%202.76127%206.16343%202.57691%205.84472C2.39255%205.52601%201.98473%205.4171%201.66602%205.60147C1.06996%205.94627%200.666504%206.59237%200.666504%207.33349C0.666504%208.43806%201.56193%209.33349%202.6665%209.33349H2.71377C2.85774%2010.339%203.32239%2011.2416%203.9998%2011.9329L3.99979%2013.4823C3.99976%2013.5617%203.99973%2013.6565%204.00655%2013.7401C4.01446%2013.8369%204.03476%2013.9756%204.10879%2014.1209C4.20466%2014.309%204.35764%2014.462%204.54581%2014.5579C4.6911%2014.6319%204.82976%2014.6522%204.92658%2014.6601C5.0101%2014.6669%205.10492%2014.6669%205.18432%2014.6669H6.4819C6.56129%2014.6669%206.65616%2014.6669%206.73968%2014.6601C6.8365%2014.6522%206.97516%2014.6319%207.12045%2014.5579C7.30862%2014.462%207.4616%2014.309%207.55747%2014.1209C7.6315%2013.9756%207.6518%2013.8369%207.65971%2013.7401C7.66653%2013.6565%207.6665%2013.5617%207.66647%2013.4823L7.66646%2013.3335H8.33314L8.33313%2013.482C8.3331%2013.5615%208.33307%2013.6563%208.33989%2013.7398C8.3478%2013.8366%208.3681%2013.9753%208.44213%2014.1206C8.538%2014.3088%208.69099%2014.4618%208.87915%2014.5576C9.02444%2014.6317%209.16311%2014.652%209.25992%2014.6599C9.34344%2014.6667%209.43824%2014.6667%209.51764%2014.6666H10.8153C10.8947%2014.6667%2010.9896%2014.6667%2011.0731%2014.6599C11.1699%2014.652%2011.3085%2014.6317%2011.4538%2014.5576C11.642%2014.4618%2011.795%2014.3088%2011.8909%2014.1206C11.9649%2013.9753%2011.9852%2013.8366%2011.9931%2013.7398C11.9999%2013.6563%2011.9999%2013.5615%2011.9999%2013.482L11.9999%2012.884C12.7373%2012.5338%2013.3676%2011.9963%2013.83%2011.3333L14.1486%2011.3333C14.228%2011.3333%2014.3229%2011.3334%2014.4064%2011.3265C14.5032%2011.3186%2014.6419%2011.2983%2014.7872%2011.2243C14.9753%2011.1284%2015.1283%2010.9754%2015.2242%2010.7873C15.2982%2010.642%2015.3185%2010.5033%2015.3264%2010.4065C15.3333%2010.323%2015.3332%2010.2282%2015.3332%2010.1488V7.84245C15.3332%207.76683%2015.3333%207.67651%2015.327%207.59685C15.3199%207.50472%2015.3015%207.37257%2015.2341%207.23269C15.1358%207.02862%2014.9712%206.86396%2014.7671%206.76567C14.6272%206.6983%2014.4951%206.67993%2014.403%206.67276C14.3435%206.66813%2014.2781%206.66697%2014.2173%206.66669C13.9935%206.19554%2013.6934%205.76825%2013.3332%205.40063L13.3332%204.68824C13.3332%204.58502%2013.3333%204.46819%2013.3243%204.36769C13.3144%204.25673%2013.2886%204.08518%2013.1832%203.91515C13.0519%203.70315%2012.846%203.54789%2012.6061%203.47982C12.4137%203.42523%2012.2416%203.44753%2012.1322%203.4685C12.0331%203.48749%2011.9208%203.51963%2011.8216%203.54801L11.7177%203.57769C11.581%203.61674%2011.5127%203.63626%2011.4646%203.67145C11.4182%203.70542%2011.3899%203.73891%2011.364%203.79026C11.3371%203.84344%2011.3279%203.92456%2011.3094%204.08678C11.101%205.91399%209.54949%207.33337%207.6665%207.33337C6.41617%207.33337%205.31201%206.70755%204.65017%205.75205Z'%20fill='%23039855'/%3e%3c/svg%3e",zn="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cg%20clip-path='url(%23clip0_3744_11287)'%3e%3cpath%20d='M7.99984%200.666626C3.94975%200.666626%200.666504%203.94987%200.666504%207.99996C0.666504%2012.05%203.94975%2015.3333%207.99984%2015.3333C8.47083%2015.3333%208.93145%2015.2889%209.37774%2015.204C8.53209%2014.4484%207.99976%2013.3495%207.99976%2012.1262C7.99976%2012.0103%208.00454%2011.8954%208.01391%2011.7819L5.24834%209.5192C5.2413%209.51353%205.23438%209.50771%205.22758%209.50175C5.15845%209.44136%205.10469%209.36959%205.06681%209.29153C5.02391%209.20345%204.99984%209.10452%204.99984%208.99996L4.99984%208.99919C4.99985%208.97688%205.00098%208.95454%205.00323%208.93228C5.01844%208.7814%205.08397%208.64537%205.18277%208.54122C5.23645%208.48449%205.29814%208.43911%205.36462%208.4054C5.45526%208.35929%205.55791%208.33329%205.66657%208.33329H6.6665C7.21472%208.33329%207.58295%208.12528%207.82444%207.84003C7.94632%207.69607%208.04285%207.52355%208.11027%207.33329H5.6665C5.29831%207.33329%204.99984%207.03482%204.99984%206.66663C4.99984%206.29844%205.29831%205.99996%205.6665%205.99996H8.11027C8.04285%205.8097%207.94632%205.63718%207.82444%205.49322C7.58295%205.20797%207.21472%204.99996%206.6665%204.99996H5.6665C5.29831%204.99996%204.99984%204.70148%204.99984%204.33329C4.99984%203.9651%205.29831%203.66663%205.6665%203.66663H10.3332C10.7014%203.66663%2010.9998%203.9651%2010.9998%204.33329C10.9998%204.70148%2010.7014%204.99996%2010.3332%204.99996H9.10602C9.29303%205.31016%209.41955%205.65102%209.48954%205.99996H10.3332C10.7014%205.99996%2010.9998%206.29844%2010.9998%206.66663C10.9998%207.03482%2010.7014%207.33329%2010.3332%207.33329H9.48954C9.39054%207.82684%209.17845%208.30422%208.84207%208.70155C8.48663%209.12139%208.00773%209.43255%207.42456%209.577L8.39182%2010.3684C9.05188%208.96864%2010.4758%207.99996%2012.126%207.99996C13.3493%207.99996%2014.4483%208.53232%2015.2039%209.37801C15.2888%208.93167%2015.3332%208.471%2015.3332%207.99996C15.3332%203.94987%2012.0499%200.666626%207.99984%200.666626Z'%20fill='%23DC6803'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.126%208.91891C10.3547%208.91891%208.91878%2010.3548%208.91878%2012.1261C8.91878%2013.8974%2010.3547%2015.3333%2012.126%2015.3333C13.8973%2015.3333%2015.3332%2013.8974%2015.3332%2012.1261C15.3332%2010.3548%2013.8973%208.91891%2012.126%208.91891ZM12.126%209.57157C12.4082%209.57157%2012.6369%209.80032%2012.6369%2010.0825V11.6152H14.1697C14.4518%2011.6152%2014.6806%2011.844%2014.6806%2012.1262C14.6806%2012.4083%2014.4518%2012.6371%2014.1697%2012.6371H12.6369V14.1698C12.6369%2014.452%2012.4082%2014.6807%2012.126%2014.6807C11.8438%2014.6807%2011.6151%2014.452%2011.6151%2014.1698V12.6371H10.0823C9.80016%2012.6371%209.57141%2012.4083%209.57141%2012.1262C9.57141%2011.844%209.80016%2011.6152%2010.0823%2011.6152H11.6151V10.0825C11.6151%209.80032%2011.8438%209.57157%2012.126%209.57157Z'%20fill='%23DC6803'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3744_11287'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",fr=(i="")=>{const d=new Date(i),n=Math.abs(new Date().getTime()-d.getTime()),y=Math.ceil(n/(1e3*60*60*24));return y<=7?`${y-1}d`:y<=30?`${Math.floor(y/7)}w`:y<=365?`${Math.floor(y/30)}m`:`${Math.floor(y/365)}y`},lr=i=>i?i.toLowerCase().replace(/\b\w/g,d=>d.toUpperCase()):"",$l=i=>{switch(i){case"DEPOSIT":return Wn;case"REFUND":return zn;default:return""}},Yn=i=>{const{handleCurrentWindow:d,setShowPatientPopModal:c,patientIDs:n,redirectionPage:y,closePrintModal:R}=i,l=v.useContext(Dt);if(!l)throw new Error("PatientPopupHeader must be used within an AppContext.Provider");const{currentWindow:A,patientDetails:S,docPreference:h,billPreferences:O,setLastBillPaymentData:g,variable:L}=l,{name:k,age:W,gender:D,image_link:N,org_person_bid_str:P,org_person_dob:I,honorific:j}=S||{};window.patientPopupClosehandler=()=>{if(c(!1),R(),g({created_on:"",category_name:""}),window.location.pathname.indexOf("/frontdesk/")!==-1){const F=document.getElementById("appointmentRefreshBtn");F&&F.click()}};const Q=()=>{y==="appointments"?typeof window.redirectVPFromAppnt=="function"&&window.redirectVPFromAppnt(n?.patientRoleID||"",n?.patientID||""):y==="consultations"?typeof window.redirectVPFromConsult=="function"&&window.redirectVPFromConsult(n?.patientRoleID||"",n?.patientID||""):y==="addpatient"||y==="frontDeskDashboard"?window.location.href=`${window.origin}${Yt.EAPP_ROUTES.visitpad}?pid=${n?.patientRoleID}`:window.location.reload(),c(!1),R()};return e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-h-[56px] hfl-shrink-0 hfl-items-center hfl-justify-between hfl-rounded-t-xl hfl-bg-Blue_gray-600 hfl-py-1 hfl-pl-[11px] hfl-pr-1.5",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-gap-[13px]",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-gap-2 hfl-px-2 hfl-py-0.5",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-8 hfl-w-8 hfl-flex-col hfl-items-center hfl-justify-center hfl-rounded hfl-bg-White_20",children:e.jsxRuntimeExports.jsx(e.tp,{url:N,name:"",placeholder:!1,text:!1,size:"Text sm",shape:"hplxt-rounded"})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-items-start hfl-text-White_20",children:[e.jsxRuntimeExports.jsxs(e.bs,{variant:"Bold",type:"Text sm",className:"hfl-text-2 hfl-font-inter-2 hfl-capitalize hfl-leading-10","data-qa":"patient-name",children:[j?`${j}. `:"",k]}),e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text lg",className:"hfl-flex hfl-items-center hfl-gap-2 hfl-text-1 hfl-capitalize",children:[Zl(D)||e.jsxRuntimeExports.jsx("div",{className:"hfl-top-1 hfl-h-3 hfl-w-10 hfl-rounded-3xl hfl-bg-Gray-100"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-h-[18px] hfl-w-[1px] hfl-bg-Gray-200"}),W?typeof W=="number"?`${W} Years`:fr(`${W}`):I&&fr(I)||e.jsxRuntimeExports.jsx("div",{className:"hfl-h-3 hfl-w-12 hfl-rounded-3xl hfl-bg-Gray-100"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-h-[18px] hfl-w-[1px] hfl-bg-Gray-200"}),P||e.jsxRuntimeExports.jsx("div",{className:"hfl-top-1 hfl-h-3 hfl-w-10 hfl-rounded-3xl hfl-bg-Gray-100"})]})]})]}),L.window_var.role_id==="11"&&e.jsxRuntimeExports.jsx(e.Ku,{onClick:Q,hierarchy:"Primary",size:"md",textField:"Visit Pad",className:"hfl-rounded-md hfl-bg-Warning-50 hfl-p-2.5 hfl-text-Warning-500 hfl-shadow-md hover:hfl-bg-Warning-100","data-qa":"visit-pad"})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-gap-3",children:[e.jsxRuntimeExports.jsx(_r,{disabled:!1,src:ml,onClickHandler:()=>d(jt[8]),label:"Abha",isRequired:h?.abha?.link_patient_rx??!1,isSelected:A===jt[8],data_qa:"abha-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[1]?"hx_patient-calendar-filled":"hx_patient-calendar",onClickHandler:()=>d(jt[1]),label:"Appnt",isRequired:!0,isSelected:A===jt[1],data_qa:"appoint-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[2]?"hx_patient-add-bil-filled":"hx_patient-add-bil",onClickHandler:()=>{d(jt[2])},label:"Add Bills",isRequired:!0,isSelected:A===jt[2],data_qa:"add-bills-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[3]?"hx_patient-all-bills-filled":"hx_patient-all-bills",onClickHandler:()=>{d(jt[3])},label:"Bills",isRequired:!0,isSelected:A===jt[3],data_qa:"bill-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[4]?"hx_patient-payments-filled":"hx_patient-payments",onClickHandler:()=>{d(jt[4])},label:"Payments",isRequired:!0,isSelected:A===jt[4],data_qa:"payments-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[5]?"hx_patient-visits-filled":"hx_patient-visits",onClickHandler:()=>{d(jt[5])},label:"Visits",isRequired:!0,isSelected:A===jt[5],data_qa:"visits-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[6]?"hx_patient-lab-filled":"hx_patient-lab",onClickHandler:()=>d(jt[6]),label:"Lab",isRequired:L.window_var.permit_lab_tech==="1"||O?.features?.enable_lis_v1===!0,isSelected:A===jt[6],data_qa:"lab-tab"}),e.jsxRuntimeExports.jsx(_r,{disabled:!1,icon:A===jt[8]?"hx_patient-user-filled":"hx_patient-user",onClickHandler:()=>d(jt[8]),label:"Profile",isRequired:!0,isSelected:A===jt[8],data_qa:"profile-tab"}),e.jsxRuntimeExports.jsx("div",{className:"hx_close hfl-cursor-pointer hfl-text-5 hfl-text-White_20",onClick:()=>window.patientPopupClosehandler?.(),"data-qa":"patient-popup-close"})]})]})},qn=()=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-[900px] hfl-flex-col hfl-p-3 ",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-between",children:[e.jsxRuntimeExports.jsx("div",{className:" hfl-flex",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Semibold",type:"Text lg",children:"Select Message Template"})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-pr-2",children:e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"lg",icon:"Left",iconFile:"hx_chat-filled hfl-text-Primary-500",textField:"Select SMS Template",className:"hfl-justify-center"})}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"lg",icon:"Left",iconFile:"hx_whatsapp-filled hfl-text-Success-500",textField:"Select Whatsapp Template",className:"hfl-justify-center"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex hfl-top-0 hfl-pt-3 ",children:e.jsxRuntimeExports.jsx(e.Oh,{className:"hfl-bg-Gray-200",rows:10,suffixPlaceholder:"Load Message Template from right"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-justify-end hfl-pt-[160px] ",children:e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Send Message"})})]}),Un=i=>{const{patientAbhaDetails:d,savePatientDetailsHandler:c,setPatientAbhaDetails:n,patientData:y}=i,{showToast:R,patientIDs:l,variable:A}=v.useContext(Dt)||{},[S,h]=v.useState(""),[O,g]=v.useState(""),[L,k]=v.useState(),W=async(D=!1)=>{try{if(L?.status&&!D){const N=await An(L.abha_address,O,l?.patientRoleID||"",l?.patientID||"",A);if(N.status){const P=await Yl(l?.patientRoleID||"",l?.patientID||"",A);n(P),Dn(L.abha_address,A);const I=N.PatientDetails[0].yearOfBirth?y?.org_person_dob.replace(y.org_person_dob.split("-")[0],N.PatientDetails[0].yearOfBirth):y?.org_person_dob;c(N.PatientDetails[0].name,I||"")}else R("Error",N.error,"Error",3e3)}else{const N=await Nn(S,A);k(N),N.status||R("Error",N.error,"Error",3e3)}}catch(N){console.error("Error while generating OTP",N)}};return d?.patient_details_mongo?.length?e.jsxRuntimeExports.jsxs("div",{className:"hfl-mx-[40px] hfl-flex hfl-items-center hfl-justify-between hfl-rounded-lg hfl-bg-Purple-25 hfl-px-3 hfl-py-2 hfl-shadow-lg",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsxs(e.bs,{variant:"Medium",type:"Text lg",className:"hfl-flex hfl-items-center hfl-gap-3 hfl-text-1 hfl-text-Rose-600",children:[e.jsxRuntimeExports.jsx("img",{className:"hfl-h-8 hfl-w-8",src:ml,alt:"profile-tab"}),d.patient_details_mongo[0].abha_address,e.jsxRuntimeExports.jsx("div",{className:"hfl-h-[31px] hfl-w-[1px] hfl-bg-Gray-200"}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text lg",className:"hfl-flex hfl-items-center hfl-gap-1 hfl-text-1 hfl-text-Blue_gray-700",children:d.patient_details_mongo[0].abha_number})]})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-gap-1 hfl-text-1 hfl-text-Success-600",children:[e.jsxRuntimeExports.jsx("div",{className:"hx_verified-filled hfl-text-4"}),"Verified by ABHA"]})})]}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-mx-[40px] hfl-flex hfl-h-[72px] hfl-flex-shrink-0 hfl-items-start hfl-gap-[9px] hfl-rounded-lg hfl-bg-Blue_gray-50 hfl-px-[13px] hfl-py-2 hfl-shadow-xs",children:[e.jsxRuntimeExports.jsx("img",{className:"hfl-h-8 hfl-w-8",src:ml,alt:"profile-tab"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-items-start hfl-gap-1",children:[e.jsxRuntimeExports.jsx(e.Ps,{inputProps:{value:S,onChange:D=>{h(D.target.value)},placeholder:"Enter ABHA Address/ ABHA Number"},className:"",width:"400px",height:"32px"}),L?.status&&e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-items-center hfl-gap-1 hfl-text-1 hfl-text-Gray-400",children:["OTP sent",e.jsxRuntimeExports.jsx("div",{className:"hfl-h-[18px] hfl-w-[1px] hfl-bg-Gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-h-[18px] hfl-w-[1px] hfl-bg-Gray-200"}),e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-cursor-pointer hfl-items-center hfl-gap-1 hfl-text-1 hfl-text-Primary-600",onClick:async()=>{await W(!0)},children:[e.jsxRuntimeExports.jsx("div",{className:"hx_rewind hfl-font-bold hfl-text-3"}),"Resend OTP"]})]})]}),L?.status&&e.jsxRuntimeExports.jsx(e.Ps,{inputProps:{value:O,onChange:D=>{g(D.target.value)},placeholder:"Enter OTP"},className:"",width:"128px",height:"32px"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",className:"hfl-h-[32px]",size:"sm",textField:L?.status?"Submit OTP":"Verify ABHA",onClick:async()=>{await W()}})]})},Kn=v.forwardRef(i=>{const{patientData:d={},setPatientData:c,preferences:n,referredByDocList:y,throughChannelList:R,showImageFromLink:l,validators:A,setValidators:S,billPreferences:h,isAbhaVerified:O,isPartnerServiceEnabled:g,insuranceData:L,partnerConfig:k,verifyInsuranceHandler:W,policyNumberErrorMessage:D,selectedInsuranceDetails:N,setSelectedInsuranceDetails:P,insuranceDivRef:I,patientCustomFieldData:j}=i,[Q,F]=v.useState(!1),[M,V]=v.useState([]),[te,Y]=v.useState([]),[ie,z]=v.useState(!1),[ge,je]=v.useState(!1),[fe,He]=v.useState([]),ae=h?.permissions?.edit_patient_name,{phone_number:q,age:de,org_person_dob:H,gender:Ee,honorific:Fe,name:Le,patient_preferred_language:ft,blood_group:ct,spouse_name:lt,marital_status:ke,married_since:ht,spouse_blood_group:wt,org_person_bid_str:mt,ref_doc_name:St,ref_doc_spec:Tt,email:T,phone_secondary:Ie,pincode:Ue,address:se,through_channel:X,care_of:Z,tag:ue,image_link:Te,aadhar_number:Se}=d,[pt,Xt]=v.useState(Ee),[gt,Ot]=v.useState("Years"),[Bt,Qt]=v.useState(""),[er,sr]=v.useState(!1),[hr,nr]=v.useState([]),ur=v.useRef(),vt=(B,_e)=>{c(bt=>({...bt,[B]:_e})),B=="gender"&&_e==""?S(bt=>({...bt,gender:"Select Gender"})):S(bt=>({...bt,gender:""}))};v.useEffect(()=>{Fe&&Qt(Fe)},[Fe]),v.useEffect(()=>{Te&&l(Te)},[Te]);const tr=B=>{const{value:_e}=B.target,bt=yt(_e);V(bt)},cr=B=>{vt("occupation",B.trim()),z(!1)},pr=B=>{vt("city",B.trim()),je(!1)},ar=B=>{const{value:_e}=B.target,bt=it(_e);Y(bt)},mr=B=>{const{value:_e}=B.target,bt=ot(_e);He(bt)},it=B=>{if(Yt.OccupationList?.length){let _e=Yt.OccupationList;return B?.length&&(_e=Yt.OccupationList.filter(bt=>bt.toLowerCase().includes(B.toLowerCase()))),_e}else return[]},yt=B=>{if(R?.length){let _e=R;return B?.length&&(_e=R.filter(bt=>bt.title.toLowerCase().includes(B.toLowerCase()))),_e}else return[]},ot=B=>{if(Yt.CityList?.length){let _e=Yt.CityList;return B?.length&&(_e=Yt.CityList.filter(bt=>bt.toLowerCase().includes(B.toLowerCase()))),_e}else return[]},Ct=(B="")=>{const _e=B?.toLowerCase();return H!==""?"":de!==""&&Number(de)<0&&H===""?"Invalid Age":_e==="weeks"&&de!==""&&Number(de)<5907||_e==="days"&&de!==""&&Number(de)<9999||_e==="months"&&de!==""&&Number(de)<1358||_e==="years"&&de!==""&&Number(de)<114?"":"Invalid Age"};v.useEffect(()=>{if(!H){const B=J.calculateDOB(d.age,gt);B&&c(_e=>({..._e,org_person_dob:B}))}},[gt,d.age]);const Mt=B=>{Xt(B),vt("gender",B),S(_e=>({..._e,gender:""}))},Gt=B=>{vt("through_channel",B.value.trim()),F(!1)},Ht=B=>{ur.current&&!ur.current.contains(B.target)&&sr(!1)},kt=(B,_e,bt)=>{c(Lt=>{const Ut=Lt.custom_fields?.length?Lt.custom_fields.map(rr=>rr.id===B?{...rr,value:bt}:rr):[];return Ut.some(rr=>rr.id===B)||Ut.push({id:B,value:bt,title:_e}),{...Lt,custom_fields:Ut}})},It=v.useCallback(()=>j?.map(B=>{const{id:_e,type:bt,title:Lt}=B||{};if(!_e||!bt||!Lt)return null;const Ut=d.custom_fields?.find(Zt=>Zt.id===_e)?.value||"";switch(bt){case"text":return e.jsxRuntimeExports.jsx(e.Ps,{label:Lt,labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:Ut||"",placeholder:`Enter ${Lt}`,onChange:Zt=>{kt(_e,Lt,Zt.target.value)}},width:"21em"},_e);case"date":return e.jsxRuntimeExports.jsx(e.ZC,{label:Lt,placeholder:`Select ${Lt}`,selectDate:Ut?new Date(Ut):null,clearDate:Zt=>{kt(_e,Lt,Zt)},dateVar:Zt=>{kt(_e,Lt,Zt)},isborderRequired:!0,width:"22em",openUp:!0,backSpaceClearDate:!0},_e);default:return null}}),[j,d.custom_fields]);return v.useEffect(()=>{const B=Object.keys(k).map(_e=>{if(k[_e]?.verify_insurance?.enable)return{value:_e,label:_e}}).filter(_e=>_e);nr(B??[])},[k]),v.useEffect(()=>(document.addEventListener("mousedown",Ht),()=>{document.removeEventListener("mousedown",Ht)}),[]),e.jsxRuntimeExports.jsx("div",{id:"add-patient-modal hfl-overflow-scroll",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-min-h-[400px] hfl-px-10 hfl-py-5 ",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-gap-1",children:[e.jsxRuntimeExports.jsxs("div",{className:ae?"":"hfl-pointer-events-none",children:[e.jsxRuntimeExports.jsx(e.Ps,{label:"Patient Name*",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",prefix:e.jsxRuntimeExports.jsxs("div",{ref:ur,className:"-hfl-ml-2 hfl-flex hfl-w-16 hfl-items-center hfl-justify-between hfl-bg-Gray-50",onClick:()=>sr(B=>!B),children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:Bt}),!Bt.length&&e.jsxRuntimeExports.jsx("div",{className:`${er?"hx_up":"hx_down"} -hfl-mr-2`})]}),errorMsg:!!A.name&&A.name,inputProps:{type:"text",value:Le,disabled:O,placeholder:"Enter Name",onChange:B=>{vt("name",B.target.value)},onBlur:()=>{const B=!(Le.length>0);Le.length>0&&Le.length<2?S(_e=>({..._e,name:"Enter at least 2 letters "})):S(_e=>({..._e,name:B?"Enter the Name of the Patient":""}))}},start_icon:"hx_person",width:"16em"}),er&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-[1000] hfl-mt-[2px] hfl-flex hfl-h-[270px] hfl-w-20 hfl-flex-col hfl-overflow-y-auto hfl-rounded-lg hfl-border-1 hfl-border-Gray-300 hfl-bg-White",style:{boxShadow:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)"},children:Yt.HonorificList.map(B=>e.jsxRuntimeExports.jsx(e.ks,{className:"hfl-text-Primary-700",label:B.label,onSelect:()=>{Qt(B.label),sr(!1),Xt(B.gender),vt("honorific",B.label),vt("gender",B.gender),c(_e=>({..._e,gender:B.gender,patHonorific:B.label}))}}))})]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Ps,{label:`Phone ${n&&n.phone_number_length?"*":""}`,labelColor:"hfl-text-Gray-600",labelSize:"Text sm",errorMsg:!!A.phone_number&&A.phone_number,inputProps:{maxLength:10,value:q,placeholder:"Enter Number",onChange:B=>{vt("phone_number",B.target.value.replace(/[^0-9]/g,""))},onBlur:()=>{const{isError:B=!1,msg:_e=""}=n&&n.phone_number_length||q?J.validateMobileNo(q):{};S(bt=>({...bt,phone_number:B?_e:""}))}},width:"21em",start_icon:"hx_phone"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-space-x-2 hfl-pt-8",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-h-[40px] hfl-space-y-1",children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-pb-[1px] hfl-text-Gray-600",children:"Gender*"}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(e.ju,{className:`!hfl-h-[37px] hfl-w-44 ${A.gender?"hfl-border-Error-300":""}`,options:[{label:"M",value:"0"},{label:"F",value:"1"},{label:"Other",value:"2"}],value:pt,onChange:B=>Mt(B),disabled:!1}),!!A.gender&&e.jsxRuntimeExports.jsx("div",{className:"hfl-font-inter hfl-text-1 hfl-font-inter-0 hfl-leading-10 hfl-tracking-1 hfl-text-Error-500",children:A.gender})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-space-x-1",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-2",children:e.jsxRuntimeExports.jsx(e.ej,{label:"Age or DOB*",className:"hfl-w-20",classNamedoubleInput:"hfl-relative",suffixClassName:"hfl-w-16 hfl-border-0",suffixDropdownClassName:"hfl-ml-[80px]",input1value:de==0?"":de,input2value:gt,end_icon:"hx_down",errorMsg:!!A.age&&A.age,inputProps:{disabled:O,type:"number",min:0,maxLength:3,placeholder:"Age",onChange:B=>{vt("age",B.target.value.replace(/[^0-9]/g,"")),c(_e=>({..._e,org_person_dob:""}))},onBlur:()=>{S(B=>({...B,age:Ct(gt)}))}},onlySuffixDropdownItemsAllowed:!0,suffixInputProps:{disabled:O,placeholder:"Select format"},suffixOptions:[{label:"Years",value:"years"},{label:"Weeks",value:"weeks"},{label:"Months",value:"months"},{label:"Days",value:"days"}],handleValChange:B=>{vt("age",B),S(_e=>({..._e,age:Ct(gt)}))},handleSuffixValChange:B=>{Ot(B),S(_e=>({..._e,age:Ct(B)}))},onSuffixDropdownClick:B=>{Ot(B.label),c(_e=>({..._e,age_selector:B.value,org_person_dob:""})),S(_e=>({..._e,age:Ct(B.value)}))}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-[24px] hfl-space-y-1",children:e.jsxRuntimeExports.jsx(e.ZC,{className:"hfl-relative",placeholder:"DOB",disable:O,width:"8em",height:"!hfl-h-[40px]",label:"",labelSize:"Text sm",labelColor:"hfl-text-Gray-700",selectDate:H&&J.isValidDate(new Date(H))?new Date(J.dayjs(new Date(H)).format("DD-MMM-YYYY")):"",dateVar:B=>{c(_e=>({..._e,org_person_dob:J.dayjs(B).format("YYYY-MM-DD"),age:""})),S(_e=>({..._e,age:""}))},isborderRequired:!0,maxDate:new Date})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-1",children:e.jsxRuntimeExports.jsx(e.Ap,{value:{label:ft?Yt.DefinedLanguages[ft]:"English"},placeholder:"English",label:"Preferred Language",onChange:B=>{vt("patient_preferred_language",B.value)},options:Object.keys(Yt.DefinedLanguages).map(B=>({label:Yt.DefinedLanguages[B],value:B})),className:"!hfl-h-[40px] hfl-w-[200px]","data-qa":"dropdown-language"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-gap-1 hfl-pb-6 hfl-pt-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-[375px] hfl-flex-col",children:[e.jsxRuntimeExports.jsx(e.Ps,{className:"hfl-mb-3",label:"Pin",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:Ue,placeholder:"Enter Pin",onChange:B=>{vt("pincode",B.target.value)}},width:22.5+"em"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-2",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ps,{label:"City",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:d?.city,placeholder:"Enter City",onChange:B=>{vt("city",B.target.value),je(!0),mr(B)},onBlur:B=>{B.stopPropagation(),je(!1)}},width:23.5+"em"}),ge&&fe&&fe.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-10 hfl-mt-1 hfl-max-h-80 hfl-w-full hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Blue_gray-200 hfl-bg-Indigo-25 hfl-shadow-md ",children:fe.map(B=>e.jsxRuntimeExports.jsx(e.ks,{label:B,className:"hfl-text-Primary-700",onSelect:()=>pr(B)}))})]})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-flex-col",style:{height:"100%",flexGrow:1},children:e.jsxRuntimeExports.jsx(e.bu,{className:"hfl-h-[120px] hfl-w-[368px]",label:"Address",rows:4,inputProps:{value:se,placeholder:"Enter Address",onChange:B=>{vt("address",B.target.value)}},isDynamicHeight:!0,"data-qa":"enter-address"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-stroke-Gray-200 hfl-stroke-1 hfl-pt-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-absolute hfl-left-0 hfl-right-0 hfl-top-1/2 hfl-h-px hfl-bg-Gray-200"}),e.jsxRuntimeExports.jsx("span",{className:"hfl-relative hfl-bg-White hfl-px-4",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-ml-2 hfl-inline hfl-bg-White hfl-text-Gray-400",children:"Marital Status"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-gap-1 hfl-pt-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-space-x-1",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-2",children:e.jsxRuntimeExports.jsx(e.Ap,{value:{label:ke&&Yt.MARITAL_STATUS.find(B=>B===ke)||""},placeholder:"Marital Status",label:"Marital Status",onChange:B=>{vt("marital_status",B.label)},options:Yt.MARITAL_STATUS.map(B=>({label:B,value:B})),className:"!hfl-h-[40px] hfl-w-[200px]","data-qa":"marital-status"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-[24px] hfl-flex hfl-space-y-2",children:e.jsxRuntimeExports.jsx(e.ZC,{className:"hfl-relative",placeholder:"Since",width:"8em",height:"!hfl-h-[40px]",label:"",labelSize:"Text sm",labelColor:"hfl-text-Gray-700",selectDate:ht&&J.isValidDate(new Date(ht))?new Date(J.dayjs(new Date(ht)).format("DD-MMM-YYYY")):"",dateVar:B=>{c(_e=>({..._e,married_since:J.dayjs(B).format("YYYY-MM-DD")}))},isborderRequired:!0,maxDate:new Date})})]}),e.jsxRuntimeExports.jsx(e.Ap,{label:"Blood Group",placeholder:"Enter blood group",value:{label:ct&&Yt.bloodGroups.find(B=>B.value===ct)?.label||"Blood group"},onChange:B=>{vt("blood_group",B.value)},options:Yt.bloodGroups,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"blood-group"})]}),ke!==Yt.MARITAL_STATUS[0]&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-gap-1 hfl-pt-6",children:[e.jsxRuntimeExports.jsx(e.Ps,{label:"Spouse Name",start_icon:"hx_person",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:lt,placeholder:"Enter Spouse Name",onChange:B=>{vt("spouse_name",B.target.value)}},width:"21em"}),e.jsxRuntimeExports.jsx(e.Ap,{label:"Spouse Blood Group",placeholder:"Enter blood group",value:{label:wt?Yt.bloodGroups.find(B=>B.value===wt)?.label||"Spouse Blood group":"Blood group"},onChange:B=>{vt("spouse_blood_group",B.value)},options:Yt.bloodGroups,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"blood-group"})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-pt-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-absolute hfl-left-0 hfl-right-0 hfl-top-1/2 hfl-h-px hfl-bg-Gray-200"}),e.jsxRuntimeExports.jsx("span",{className:"hfl-relative hfl-bg-White hfl-px-4",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-ml-2 hfl-inline hfl-bg-White hfl-text-Gray-400",children:"Other Details"})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-6",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Existing ID (if any)",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:mt,placeholder:"Enter ID",onChange:B=>{vt("org_person_bid_str",B.target.value)}},width:"23em"})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-gap-1 hfl-pt-6",children:[e.jsxRuntimeExports.jsx(e.ej,{classNameDatePicker:"hfl-relative",classNamedoubleInput:"hfl-relative",label:"Referred By",input1value:St,input2value:Tt,end_icon:"hx_down",inputProps:{placeholder:"Doctor Name"},suffixInputProps:{placeholder:"Speciality"},className:"hfl-w-48",suffixClassName:"hfl-w-[100px]",suffixDropdownClassName:"hfl-ml-[160px]",options:y,suffixOptions:Yt.SpecialityList,handleValChange:B=>{vt("ref_doc_name",B)},handleSuffixValChange:B=>{vt("ref_doc_spec",B.value)},onDropdownClick:B=>{vt("ref_doc_name",B.doctor_name),vt("ref_doc_id",B.doctor_id),vt("refDocId",B.doctor_id),vt("ref_doc_spec",B.specialist)},onSuffixDropdownClick:B=>{vt("ref_doc_spec",B.value)}}),e.jsxRuntimeExports.jsx(e.Ps,{label:"Email",className:"",classNameParentDiv:"hfl-relative",showEmailSuggestions:!0,labelColor:"hfl-text-Gray-600",errorMsg:!!A.email&&A.email,labelSize:"Text sm",start_icon:"hx_mail",inputProps:{value:T,placeholder:"Enter Email",onChange:B=>{vt("email",B.target.value.trim())},onBlur:B=>{B.target.value&&!$r.create$6().email().isValidSync(B.target.value)?S(_e=>({..._e,email:"Email format is wrong"})):S(_e=>({..._e,email:""}))}},width:20.5+"em"})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-inline-flex hfl-flex-row hfl-flex-wrap hfl-justify-between hfl-gap-y-6 hfl-py-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-gap-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ps,{label:"Channel (How did the patient hear about you?)",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:X,placeholder:"Enter Channel",onChange:B=>{vt("through_channel",B.target.value),F(!0),tr(B)},onBlur:B=>{B.stopPropagation(),F(!1)}},width:23.5+"em"}),Q&&M&&M.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-10 hfl-mt-1 hfl-max-h-80 hfl-w-full hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Blue_gray-200 hfl-bg-Indigo-25 hfl-shadow-md ",children:M.map(B=>{const{title:_e,...bt}=B||{};return e.jsxRuntimeExports.jsx(e.ks,{label:B.title,className:"hfl-text-Primary-700",...bt,onSelect:()=>Gt({...bt})})})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-[368px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"C/O",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:Z,placeholder:"Enter C/O",onChange:B=>{vt("care_of",B.target.value)}},width:"22em"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ps,{label:"Occupation",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:d?.occupation,placeholder:"Enter Occupation",onChange:B=>{vt("occupation",B.target.value),z(!0),ar(B)},onBlur:B=>{B.stopPropagation(),z(!1)}},width:23.5+"em"}),ie&&te&&te.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-10 hfl-mt-1 hfl-max-h-80 hfl-w-full hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Blue_gray-200 hfl-bg-Indigo-25 hfl-shadow-md ",children:te.map(B=>e.jsxRuntimeExports.jsx(e.ks,{label:B,className:"hfl-text-Primary-700",onSelect:()=>cr(B)}))})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-[368px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Tag",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:ue,placeholder:"Enter Tag",onChange:B=>{vt("tag",B.target.value)}},width:"22em"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-pb-2",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Mobile 2",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:Ie,maxLength:10,placeholder:"Enter Secondary Number",onChange:B=>{vt("phone_secondary",B.target.value.replace(/[^0-9]/g,""))}},width:23.5+"em"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-[368px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Aadhar Number",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:Se,maxLength:12,placeholder:"Aadhar Card Number",onChange:B=>{vt("aadhar_number",B.target.value)},onBlur:()=>{S(B=>({...B,aadhar_number:d.aadhar_number&&d.aadhar_number.length!=12?"Please enter 12 digit aadhar number":""}))}},width:"22em"})})]}),g&&e.jsxRuntimeExports.jsx("div",{className:"hfl-align-center hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-gap-1 hfl-pb-8",children:e.jsxRuntimeExports.jsx(e.Ap,{label:"Partner Company",placeholder:"Select Partner",value:{label:N?.partner_name??""},onChange:B=>{P(_e=>({..._e,partner_name:B.value}))},options:hr,disabled:!!d?.insurance_details?.policy_id,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"opd-insurance"})}),g&&N?.partner_name&&e.jsxRuntimeExports.jsxs("div",{ref:I,className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-items-center hfl-justify-between hfl-pb-8 hfl-pt-2",children:[e.jsxRuntimeExports.jsx(e.Ap,{label:"Insurance Company",placeholder:"Select Provider",value:{label:N?.policy_company??"Select Provider"},onChange:B=>{P(_e=>({..._e,policy_company:B.value}))},options:L,disabled:!!d?.insurance_details?.policy_id,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"opd-insurance"}),e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-justify-between ${D?"hfl-items-center":"hfl-items-end"}`,children:[e.jsxRuntimeExports.jsx(e.Ps,{label:"Policy Number",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:N?.policy_id??"",placeholder:"Enter Policy Number",onChange:B=>{P(_e=>({..._e,policy_id:B.target.value}))},disabled:!!d?.insurance_details?.policy_id},errorMsg:D,width:d?.insurance_details?.policy_id?16.5+"em":17.5+"em"}),e.jsxRuntimeExports.jsx(e.Ku,{className:"hfl-ml-4 hfl-px-4 hfl-py-[1.2rem]",hierarchy:"Primary",size:"md",onClick:()=>W(N),textField:d?.insurance_details?.policy_id?"Verified":"Verify",style:{pointerEvents:d?.insurance_details?.policy_id?"none":"unset"}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-grid hfl-grid-cols-2 hfl-gap-x-36 hfl-gap-y-6",children:It()})]})]})})}),Zn=i=>{const{getPatientDetails:d,setPatientAbhaDetails:c,patientAbhaDetails:n,isPartnerServiceEnabled:y,partnerConfig:R}=i,[l,A]=v.useState(""),[S,h]=v.useState(!1),[O,g]=v.useState(!1),[L,k]=v.useState(!1),[W,D]=v.useState([]),[N,P]=v.useState([]),I=v.useRef(null),j=v.useRef(null),[Q,F]=v.useState("profile"),{docPreference:M,patientDetails:V,preferences:te,patientIDs:Y,billPreferences:ie,showToast:z,patientCustomFieldData:ge,variable:je}=v.useContext(Dt)||{},fe=V?.org_person_bid_str||"",[He,ae]=v.useState([]),[q,de]=v.useState(""),[H,Ee]=v.useState({partner_name:"",policy_company:"",policy_id:""}),Fe=v.useRef(null),[Le,ft]=v.useState({name:"",phone_number:"",age:"",gender:"",email:""}),ct=(ue,Te,Se)=>e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-w-[60px] hfl-flex-col hfl-items-center hfl-rounded hfl-px-1 hfl-py-2 hfl-text-center ${Q===ue?"hfl-bg-Primary-50 hfl-text-Primary-600":""} hfl-cursor-pointer`,onClick:()=>F(ue),children:[e.jsxRuntimeExports.jsx("div",{className:Te}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",children:Se})]},ue),[lt,ke]=v.useState(V),ht=async()=>{try{h(!1);const ue=await navigator.mediaDevices.getUserMedia({video:!0});j.current&&(j.current.srcObject=ue,k(!0))}catch(ue){console.error("Error accessing camera:",ue)}},wt=ue=>{h(!1),k(!1);const Te=ue.target.files?.[0];if(!Te)return;const Se=new FileReader;Se.onloadend=()=>{const pt=Se.result;typeof pt=="string"?A(pt):console.error("Failed to read file as a data URL."),ue.target&&(ue.target.value="")},Se.onerror=()=>{console.error("There was an issue reading the file.")},Se.readAsDataURL(Te)},mt=()=>{document.getElementById("upload-local-file")?.click()},St=()=>{z?.("Success","Image deleted successfully","Success",3e3),h(!0),A(""),k(!1),T()},Tt=ue=>{A(ue),h(!1),k(!1)},T=()=>{if(j.current&&j.current.srcObject){const ue=j.current.srcObject;ue instanceof MediaStream&&ue.getTracks().forEach(Te=>Te.stop())}},Ie=()=>{const ue=I.current,Te=j.current;if(ue&&Te){ue.width=Te.videoWidth,ue.height=Te.videoHeight;const Se=ue.getContext("2d");Se&&Se.drawImage(Te,0,0,ue.width,ue.height);const pt=ue.toDataURL();A(pt),h(!1),k(!1),T()}};v.useEffect(()=>{(async()=>{try{const ue=await _n(je),{total_ref_doc_details:Te,through_channel:Se}=ue;Te.length&&D(Rn(Te)),Se.length&&P(jn(Se))}catch(ue){console.log("ERROR",ue)}})()},[je]),v.useEffect(()=>{Ee({partner_name:lt?.insurance_details?.partner||"",policy_company:lt?.insurance_details?.policy_company||"",policy_id:lt?.insurance_details?.policy_id||""})},[lt?.insurance_details]),v.useEffect(()=>{const ue=async Te=>{try{const pt=(await In(Te,je))?.insurance_companies||{},Xt=Object.entries(pt).map(([gt,Ot])=>({value:gt,label:Ot}));ae(Xt)}catch(Se){console.error("Failed to fetch insurance list:",Se),ae([])}};H?.partner_name&&y?ue(H?.partner_name):ae([])},[y,H?.partner_name,je]),v.useEffect(()=>{Fe?.current?.scrollIntoView({behavior:"smooth"})},[H.partner_name]);const Ue=async ue=>{if(R&&R[ue?.partner_name]?.verify_insurance?.enable){const Te=await Bn({...ue,patient_role_id:lt?.patient_id||""},je),{data:Se}=Te||{};if(Se.status_code===200)de(""),z?.("Insurance Verified Successfully","","Success",3e3);else if(Se?.error||Te?.status===500)throw de("Policy Number is Incorrect"),console.log(Se?.error),new Error(Se?.error)}},se=async(ue,Te)=>{const Se=new FormData;Se.append("pid",ue),Se.append("bidstr",Te),Se.append("imgData",l);const pt=await wn(Se,je);pt.apiError&&z?.("Error",pt.apiError,"Error",3e3)},X=async ue=>{const Te=new FormData;Te.append("pid",ue);const Se=await Zr.deletePatientImage(Te,je);Se.apiError&&z("Error",Se.apiError,"Error",3e3)},Z=async(ue=lt?.name??"",Te=lt?.org_person_dob??"")=>{if(!lt||!Y?.patientRoleID){z?.("Error","Patient data not available.","Error",3e3);return}const Se={...lt,name:ue,org_person_dob:Te};try{lt.image_link&&!l?await X(Y.patientRoleID):l&&O&&(await se(Y.patientRoleID,fe),g(!1));const pt=await yn(Se,je,Y);pt.status?(z?.("Success",pt.message,"Success",3e3),d(Y.patientRoleID)):z?.("Error",pt.message,"Error",3e3)}catch(pt){console.error("Error updating patient details:",pt)}};return e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-h-[73.55vh] hfl-flex-row hfl-bg-White ",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-gap-4 hfl-border-r-1 hfl-border-Gray-200 hfl-bg-Gray-50 hfl-px-1 hfl-py-2",children:ct("profile","hx_person-id-filled hfl-text-5","Profile")}),Q==="sms"?e.jsxRuntimeExports.jsx(qn,{}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-full xxs:max-md:hfl-w-[915px]",children:[e.jsxRuntimeExports.jsxs("div",{className:" hfl-mt-4 hfl-justify-center hfl-overflow-y-auto",children:[M?.abha?.link_patient_rx&&e.jsxRuntimeExports.jsx(Un,{patientAbhaDetails:n,patientData:lt,savePatientDetailsHandler:Z,setPatientAbhaDetails:c}),e.jsxRuntimeExports.jsx(Kn,{setPatientData:ke,patientData:lt,preferences:te,referredByDocList:W,throughChannelList:N,showImageFromLink:Tt,setValidators:ft,validators:Le,billPreferences:ie,isAbhaVerified:n?.patient_details_mongo?.length,isPartnerServiceEnabled:y,insuranceData:He,partnerConfig:R,verifyInsuranceHandler:Ue,policyNumberErrorMessage:q,selectedInsuranceDetails:H,setSelectedInsuranceDetails:Ee,insuranceDivRef:Fe,patientCustomFieldData:ge})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-4 hfl-py-9",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-items-start hfl-justify-start hfl-pt-3",children:e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-h-[150px] hfl-w-[200px] hfl-items-center hfl-justify-center
|
|
3
3
|
hfl-rounded-3xl hfl-border-4
|
|
4
4
|
hfl-border-White hfl-bg-Primary-50 hfl-shadow-lg`,children:[e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-flex-col hfl-items-center hfl-justify-between
|
|
@@ -33,4 +33,4 @@ ${g}`,textFieldClassName:"hfl-w-full hfl-line-clamp-2",onClick:()=>c(S),classNam
|
|
|
33
33
|
</div>
|
|
34
34
|
</body>
|
|
35
35
|
</html>
|
|
36
|
-
`)}`;return e.jsxRuntimeExports.jsx("div",{style:{zIndex:1e4},className:"hfl-fixed hfl-inset-0 hfl-flex hfl-w-full hfl-items-center hfl-justify-center hfl-overflow-y-auto hfl-overflow-x-hidden hfl-opacity-100 hfl-outline-none",children:e.jsxRuntimeExports.jsx("div",{className:"xss:max-md:hfl-w-[80vw] hfl-relative hfl-m-1 hfl-mx-auto hfl-my-6 hfl-w-auto",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-rounded-lg hfl-border-0 hfl-bg-White hfl-shadow-lg hfl-outline-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-between hfl-rounded-t hfl-px-4 hfl-py-2 hfl-shadow-sm",style:{borderBottom:"1px solid var(--gray-300, #D0D5DD)"},children:[e.jsxRuntimeExports.jsx(e.bs,{type:"Text md",variant:"Regular",children:"Report"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Tertiary-Grey",icon:"Only",iconFile:"hx_close",onClick:()=>d(!1),size:"md",textField:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-overflow-y-auto",style:{maxHeight:"85vh"},children:[e.jsxRuntimeExports.jsx("div",{id:"pdf-print-render",className:"hfl-overflow-y-auto hfl-bg-Gray-300",children:e.jsxRuntimeExports.jsxs("div",{className:"relative hfl-h-[85vh] hfl-w-[210mm] xxs:max-md:hfl-h-[85vh] xxs:max-sm:hfl-w-[150mm] md:hfl-w-[180mm]",children:[P&&e.jsxRuntimeExports.jsx(Gs,{}),e.jsxRuntimeExports.jsx("iframe",{height:"100%",width:"100%",src:q(D.report_link),title:"PDF Report",onLoad:He,style:{display:P?"none":"block"}})]})}),y?e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"-4px 0px 4px 0px rgba(222, 214, 214, 0.25)",maxHeight:"85vh",position:"relative"},children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex-grow hfl-overflow-y-auto",style:{paddingBottom:"60px"},children:k?.visits&&k.visits.length>0?e.jsxRuntimeExports.jsxs("div",{className:"hfl-p-6 hfl-pb-0",children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-font-inter-2 !hfl-text-Black",children:"Please Choose Date:"}),e.jsxRuntimeExports.jsx(Da,{visits:k?.visits,setPdfUrl:N,pdfUrl:D})]}):!P&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-flex-1 hfl-items-center hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"!hfl-text-Gray hfl-font-inter-2",children:"No reports available."})})}),k?.visits&&k.visits.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-bottom-[0px] hfl-w-[400px] hfl-border-t-1 hfl-border-Gray-100 hfl-bg-White hfl-p-2",style:{boxShadow:"0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)"},children:e.jsxRuntimeExports.jsx(e.Ku,{onClick:()=>ae(D,"Attachment"),hierarchy:"Primary",size:"lg",textField:"Attach to EMR",className:"hfl-mx-2 hfl-flex hfl-w-full hfl-items-center hfl-justify-center hfl-text-center"})})]}):e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"-4px 0px 4px 0px rgba(222, 214, 214, 0.25)",maxHeight:"85vh",position:"relative"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-justify-between hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"rgba(222, 214, 214, 0.25) -4px 0px 4px 0px"},children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-py-6 xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Email",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_mail",errorMsg:j&&F!=="email"?"Email format is wrong":void 0,inputProps:{onFocus:()=>M("email"),onBlur:()=>M(""),autoFocus:!0,type:"text",placeholder:"Enter Email",onChange:de=>{je(de)},value:V}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-auto xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Phone Number",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_phone",errorMsg:z&&F!=="phone"?"Invalid Phone Number":void 0,inputProps:{placeholder:"Enter Phone Number",onFocus:()=>M("phone"),onBlur:()=>M(""),onChange:de=>{fe(de)},value:Y,maxLength:10}})})]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-bottom-[0px] hfl-w-[400px] hfl-border-t-1 hfl-border-Gray-100 hfl-bg-White hfl-p-2",style:{boxShadow:"0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-space-x-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Email",disabled:!V||j||P,icon:"Left",onClick:()=>ae(D,"Email"),iconFile:"hx_mail hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"WhatsApp",disabled:!Y||z||P,icon:"Left",onClick:()=>ae(D,"SMS/WA"),iconFile:"hfl-mr-2",className:"hfl-border-Blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsx("img",{alt:"WhatsApp",src:ne.WhatsApp,width:"24px",height:"24px",className:"hfl-absolute hfl-left-[16px] hfl-top-[50%] hfl-translate-y-[-50%] hfl-object-contain hover:hfl-cursor-pointer"})]}),e.jsxRuntimeExports.jsx(e.Ku,{id:"print-button",hierarchy:"Secondary",size:"lg",textField:"Print",disabled:P,icon:"Left",onClick:()=>l("print_pdf",D),iconFile:"hx_print hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-flex hfl-items-center hfl-justify-center hfl-border hfl-px-10"})]})})})]})})]})]})})})},Ba=i=>{const{patientDetails:d,showToast:c,variable:n}=i,[y,R]=v.useState(!1),[l,A]=v.useState(""),{org_person_bid_str:S=""}=d,h=v.useReducer((Q,F)=>({...Q,...F}),{currentPage:1,totalRecord:0,LabRecords:[],isLabTableLoading:!1}),[O,g]=h,{LabRecords:L,currentPage:k,isLabTableLoading:W}=O,D=(Q,F)=>{Q==="print_pdf"?window.open(F.report_link,"_blank"):Q==="print_preview"&&(R(!0),A(F))},N=v.useCallback(async Q=>{try{g({isLabTableLoading:!0});const F=await ne.getLisDataByOrgBidStr(S,n);let M=[];F?.visits?.length&&(M=Ga(F.visits)),g({currentPage:Q,LabRecords:M?.length?M:[],isLabTableLoading:!1,totalRecord:M.length})}catch(F){g({isLabTableLoading:!1}),console.log(F)}},[g,S,n]),P={lab_date:"100px",lab_number:"350px"};v.useEffect(()=>{N(k)},[k,N]);const I=v.useMemo(()=>[{Header:"Date",accessor:"lab_date",Cell:({row:Q})=>e.jsxRuntimeExports.jsx("div",{className:"hfl-max-[100px] hfl-w-[100px]",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.lab_date}]`,children:Q?.original?.lab_date&&J.dayjs(Q.original.lab_date).format("DD-MMM-YYYY")})})},{Header:"Lab Number / Service Name.",accessor:"lab_number",Cell:({row:Q})=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.lab_number}]`,children:Q?.original?.lab_number&&Q.original.lab_number})},{Header:"View Report",accessor:"report_link",Cell:({row:Q})=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-mx-2 hfl-my-1 hfl-flex hfl-gap-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Print",iconFile:"hx_print",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-print",onClick:()=>D("print_preview",Q.original)}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Share",iconFile:"hx_share",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-share",onClick:()=>D("print_preview",Q.original)})]})}],[P.lab_date,P.lab_number]),j=v.useMemo(()=>L,[L]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[" ",j?.length>0&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xl,{columns:I,data:j||[]}),y&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-left-[50%] hfl-top-[50%]",children:e.jsxRuntimeExports.jsx(Ta,{setLisModalOpen:R,patientDetails:d,lisPDFUrl:l,showListing:!1,openLISReportHandler:D,showToast:c,variable:n})})]}),j.length===0&&!W&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text md",className:"hfl-items-center hfl-justify-center hfl-text-Gray-400",children:"These are no Reports for the Patient"})}),W&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",style:{width:"inherit"},children:e.jsxRuntimeExports.jsx(Gs,{})})]})},Ga=i=>{const d=[];return i.forEach(c=>{c.reports.forEach(n=>{d.push({lab_number:n.lab_number,report_link:n.report_link,lab_date:c.date})})}),d},Fa=i=>{const{setHplxLabModalOpen:d,patientDetails:c,showHPLXPrintPreview:n,reportsData:y,showToast:R,envName:l}=i,{patient_role_id:A="",email:S="",phone_number:h="",name:O=""}=c,{order_date:g,report_id:L}=y,[k,W]=v.useState(!1),[D,N]=v.useState(""),[P,I]=v.useState(S),[j,Q]=v.useState(h),[F,M]=v.useState(!1),[V,te]=v.useState(null),[Y,ie]=v.useState("");v.useEffect(()=>{A&&g&&(async()=>{const ae={pid:A,todays_date:g,rids:L};try{const q=await ne.getHplxLabPdfUrl(ae,l);if(q&&q?.pdf){ie(q.pdf);const H=await(await fetch(q.pdf)).blob(),Ee=URL.createObjectURL(H);te(Ee),n||fe(Ee)}}catch(q){console.error("Error:",q)}})()},[A,g]);const z=async He=>{try{const ae={created_by:window.doctor_role_id_for_seg,dynamicFieldValue:{patient_name:O,url:Y,email_attachment_urls:Y,email_attachment_file_names:"Lab-Report.pdf"},receiverEmails:He==="Email"?[P]:[],receiverPersonRoleIds:[],receiverPhoneNumbers:He==="WA"?[j]:[],receiverPhoneNumbersUrl:"",senderId:window.doctor_role_id_for_seg,sourceDetails:{entity_type:"hplx_lab_report",entity_id:L,user_type:"0",user_id:A,branch_id:window.org_branch_id_for_seg},triggerCode:He==="WA"?"EHR-LAB-REPORT-WHATSAPP":"EHR-LAB-REPORT-EMAIL"};if(await ne.sendV2PrintEmailOrSMS(ae,l))R("",`${He==="Email"?"Email":"WhatsApp"} Sent Successfully`,"Success",1e3,"topRight");else throw new Error("Error while uploading the file")}catch(ae){console.log("error",ae)}},ge=He=>{const{value:ae}=He.target;W(!!ae&&!$r.create$6().email().isValidSync(ae)),I(ae)},je=He=>{const{value:ae}=He.target;M(!!ae&&!$r.create$6().min(10).max(10).isValidSync(ae)),Q(ae)},fe=He=>{if(He){const ae=document.getElementById("hiddenIframe").querySelector("iframe");ae.src=He,ae.onload=()=>{ae.contentWindow.print()}}};return e.jsxRuntimeExports.jsx("div",{style:{zIndex:1e4},className:"hfl-fixed hfl-inset-0 hfl-flex hfl-w-full hfl-items-center hfl-justify-center hfl-overflow-y-auto hfl-overflow-x-hidden hfl-opacity-100 hfl-outline-none",children:e.jsxRuntimeExports.jsx("div",{className:"xss:max-md:hfl-w-[80vw] hfl-relative hfl-m-1 hfl-mx-auto hfl-my-6 hfl-w-auto",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-rounded-lg hfl-border-0 hfl-bg-White hfl-shadow-lg hfl-outline-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-between hfl-rounded-t hfl-px-4 hfl-py-2 hfl-shadow-sm",style:{borderBottom:"1px solid var(--gray-300, #D0D5DD)"},children:[e.jsxRuntimeExports.jsx(e.bs,{type:"Text md",variant:"Regular",children:"Report"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Tertiary-Grey",icon:"Only",iconFile:"hx_close",onClick:()=>d(!1),size:"md",textField:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-overflow-y-auto",style:{maxHeight:"85vh"},children:[e.jsxRuntimeExports.jsx("div",{id:"pdf-print-render",className:"hfl-overflow-y-auto hfl-bg-Gray-300",children:e.jsxRuntimeExports.jsxs("div",{className:"relative hfl-h-[85vh] hfl-w-[210mm] xxs:max-md:hfl-h-[85vh] xxs:max-sm:hfl-w-[150mm] md:hfl-w-[180mm]",children:[e.jsxRuntimeExports.jsx("iframe",{height:"100%",width:"100%",src:V?V+"#toolbar=0&navpanes=0":"about:blank",title:"PDF Report"}),e.jsxRuntimeExports.jsx("div",{id:"hiddenIframe",className:"hfl-hidden",children:e.jsxRuntimeExports.jsx("iframe",{src:V,title:"PDF Report"})})]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"-4px 0px 4px 0px rgba(222, 214, 214, 0.25)",maxHeight:"85vh",position:"relative"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-justify-between hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"rgba(222, 214, 214, 0.25) -4px 0px 4px 0px"},children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-py-6 xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Email",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_mail",errorMsg:k&&D!=="email"&&"Email format is wrong",inputProps:{onFocus:()=>N("email"),onBlur:()=>N(""),autoFocus:!0,type:"text",placeholder:"Enter Email",onChange:He=>{ge(He)},value:P}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-auto xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Phone Number",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_phone",errorMsg:F&&D!=="phone"&&"Invalid Phone Number",inputProps:{placeholder:"Enter Phone Number",onFocus:()=>N("phone"),onBlur:()=>N(""),onChange:He=>{je(He)},value:j,maxLength:10}})})]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-bottom-[0px] hfl-w-[400px] hfl-border-t-1 hfl-border-Gray-100 hfl-bg-White hfl-p-2",style:{boxShadow:"0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-space-x-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Email",disabled:!P||k,icon:"Left",onClick:()=>z("Email"),iconFile:"hx_mail hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"WhatsApp",disabled:!j||F,icon:"Left",onClick:()=>z("WA"),iconFile:"hfl-mr-2",className:"hfl-border-blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsx("img",{alt:"WhatsApp",src:ne.WhatsApp,width:"24px",height:"24px",className:"hfl-absolute hfl-left-[16px] hfl-top-[50%] hfl-translate-y-[-50%] hfl-object-contain hover:hfl-cursor-pointer"})]}),e.jsxRuntimeExports.jsx(e.Ku,{id:"print-button",hierarchy:"Secondary",size:"lg",textField:"Print",icon:"Left",onClick:()=>fe(V),iconFile:"hx_print hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-flex hfl-items-center hfl-justify-center hfl-border hfl-px-10"})]})})})]})})]})]})})})},Ma=i=>{const{patientDetails:d,showToast:c,variable:n}=i,[y,R]=v.useState(!1),[l,A]=v.useState(!0),[S,h]=v.useState({}),O=v.useReducer((M,V)=>({...M,...V}),{currentPage:1,totalRecord:0,LabRecords:[],isLabTableLoading:!1}),[g,L]=O,{LabRecords:k,currentPage:W,isLabTableLoading:D,totalRecord:N}=g,P={order_date:"100px",test:"350px"},I=(M,V)=>{R(!0),A(M),h(V)},j=v.useCallback(async M=>{L({isLabTableLoading:!0});try{const V=await gn(sn,M,d?.patient_role_id,n),te=V?.data??[];L({currentPage:M,LabRecords:[...k,...te],isLabTableLoading:!1,totalRecord:V?.total_lab_count??0})}catch(V){console.error("Failed to fetch HPLX Lab reports:",V)}finally{L({isLabTableLoading:!1})}},[L,d?.patient_role_id,n]);v.useEffect(()=>{j(W)},[W,j]);const Q=v.useMemo(()=>[{Header:"Date",accessor:"order_date",Cell:({row:M})=>e.jsxRuntimeExports.jsx("div",{className:"hfl-max-[100px] hfl-w-[100px]",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.order_date}]`,children:M?.original?.order_date&&J.dayjs(M.original.order_date).format("DD-MMM-YYYY")})})},{Header:"Test Name",accessor:"test",Cell:({row:M})=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.test}]`,children:M?.original?.test&&M.original.test})},{Header:"View Report",accessor:"report_link",Cell:({row:M})=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-mx-2 hfl-my-1 hfl-flex hfl-gap-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Print",iconFile:"hx_print",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-print",onClick:()=>I(!0,M.original)}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Share",iconFile:"hx_share",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-share",onClick:()=>I(!0,M.original)})]})}],[P.order_date,P.test]),F=v.useMemo(()=>k,[k]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[" ",F?.length>0&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xl,{columns:Q,data:F||[]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-2",children:e.jsxRuntimeExports.jsx(Qr,{currentPage:W,totalRecord:N,handleLoadMore:()=>j(W+1),isLoading:D,currentTotal:F.length})}),y&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-left-[50%] hfl-top-[50%]",children:e.jsxRuntimeExports.jsx(Fa,{setHplxLabModalOpen:R,patientDetails:d,showHPLXPrintPreview:l,reportsData:S,showToast:c,envName:n})})]}),F.length===0&&!D&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text md",className:"hfl-items-center hfl-justify-center hfl-text-Gray-400",children:"These are no Reports for the Patient"})}),D&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",style:{width:"inherit"},children:e.jsxRuntimeExports.jsx(Gs,{})})]})},Ha=i=>{const{showToast:d}=i,{patientDetails:c,billPreferences:n,variable:y}=v.useContext(Dt)||{},[R,l]=v.useState(""),A=n?.features?.enable_lis_v1??!1,S=y.window_var.permit_lab_tech=="1";v.useEffect(()=>{A&&S||A?l(zr[$t.lis_report].key):S&&l(zr[$t.healthplix_report].key)},[A,S]);const h=O=>{l(O)};return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[73.55vh] hfl-bg-White",children:e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-[913px] hfl-flex-col hfl-justify-start hfl-px-4 hfl-py-2",children:A||S?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center",children:[A&&e.jsxRuntimeExports.jsx(e.bs,{variant:`${R===$t.lis_report?"Semibold":"Regular"}`,type:"Text md",className:`hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-center hfl-gap-0.5 hfl-px-[13px] hfl-py-2 ${R===$t.lis_report?"hfl-border-b-2 hfl-border-Primary-600 hfl-text-Primary-600":""}`,onClick:()=>h($t.lis_report),children:zr[$t.lis_report].label}),S&&e.jsxRuntimeExports.jsx(e.bs,{variant:`${R===$t.healthplix_report?"Semibold":"Regular"}`,type:"Text md",className:`hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-center hfl-gap-0.5 hfl-px-[13px] hfl-py-2 ${R===$t.healthplix_report?"hfl-border-b-2 hfl-border-Primary-600 hfl-text-Primary-600":""}`,onClick:()=>h($t.healthplix_report),children:zr[$t.healthplix_report].label})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative hfl-mx-[12%] hfl-h-full hfl-overflow-auto hfl-py-[20px]",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-center hfl-justify-between hfl-pb-2",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Semibold",type:"Text md",className:"hfl-text-Gray-600",children:R===$t.lis_report?"Lab reports of LIS":R===$t.healthplix_report?"Lab reports of Healthplix":""})}),R===$t.lis_report&&e.jsxRuntimeExports.jsx(Ba,{patientDetails:c,showToast:d,variable:y}),R===$t.healthplix_report&&e.jsxRuntimeExports.jsx(Ma,{patientDetails:c,showToast:d,variable:y})]})]}):e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-items-center hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text lg",className:"hfl-text-Gray-500",children:"Lab is not active."})})})})})};function La({variable:i}){const{window_var:d,token:c,envName:n,IMGREP_DIRECTORY:y}=i,R=jl.useMediaQuery("(max-width: 1080px)"),l=v.useRef(null),[A,S]=v.useState(!1),[h,O]=v.useState(!1),[g,L]=v.useState([]),[k,W]=v.useState(jt[2]),[D,N]=v.useState(),[P,I]=v.useState(),[j,Q]=v.useState(),[F,M]=v.useState(),[V,te]=v.useState(),[Y,ie]=v.useState(),[z,ge]=v.useState({printDataFrom:"",visible:!1,whichPreview:"offlinePrint",printData:"",visitId:"",visit_date:"",details:{},visit_number:1,currentPrintTime:0,printType:"bill",trackEventHandler:()=>{}}),[je,fe]=v.useState(""),[He,ae]=v.useState("en"),[q,de]=v.useState(),[H,Ee]=v.useState(),[Fe,Le]=v.useState(),[ft,ct]=v.useState({patient_id:"",patient_registered_date:"",patient_age:"",patient_gender:""}),lt=window?.partner_config?JSON.parse(window?.partner_config):{},[ke,ht]=v.useState([]),{patient_preferred_language:wt}=V||{},{visit_pad_json:mt,visitpad_order:St,org_person_sign_text:Tt,org_person_signature_url:T}=j||{},{add_lang_change:Ie,defaultLanguage:Ue}=typeof mt=="string"&&mt&&JSON.parse(mt)||{},{rows:se}=Ue||{},[X,Z]=v.useState(!1),[ue,Te]=v.useState({}),[Se,pt]=v.useState([]),[Xt,gt]=v.useState({}),[Ot,Bt]=v.useState({created_on:"",category_name:""});v.useEffect(()=>{const it=Y?.print?.bill?.appnt_minute_slab;if(!it)return;const yt=+it;yt&&(Dr.find(Ct=>Ct.value==yt)||Dr.unshift({label:`${yt} min`,value:yt}))},[Y]);const Qt=v.useCallback(it=>{nn({callback:ot=>{te(ot),ct({patient_id:it,patient_registered_date:"",patient_age:ot?.age?typeof ot?.age=="number"?`${ot.age} y`:`${fr(`${ot.age}`)}`:fr(ot?.org_person_dob),patient_gender:Zl(ot?.gender)})}},it,i)},[te]),er=it=>{tr(),W(it)},sr=(it,yt,ot,Ct)=>{const Mt=Date.now();L(Gt=>[...Gt,{id:Mt,title:it,description:yt,type:ot,duration:Ct}]),setTimeout(()=>{L(Gt=>[...Gt].filter(({id:Ht})=>Ht!==Mt))},Ct)};v.useEffect(()=>{St&&mt&&ht(Ml(St,mt))},[j,mt,St]);const hr=v.useCallback(()=>{ae(typeof wt=="string"&&wt.length>=2?wt:typeof se=="string"&&se.length>=2?se:"en")},[se,wt]);v.useEffect(()=>{hr()},[wt,se,hr]);const nr=async(it,yt,ot,Ct=!0)=>{const{unmodifiedVisitPadJson:Mt,printPrefMasterArr:Gt}=it,Ht=Mt&&J.isJson(Mt)?JSON.parse(Mt):{},kt=Gt?.[yt]||{config:{}},It=kt?.config||{},_e={...Ht,...kt,...((Ut,Zt)=>Object.fromEntries(Object.entries(Ut).map(([rr,Pr])=>[Zt[rr]||rr,Pr])))(It,ln)},bt={org_person_logo_footer_url:`${y}${It.footer_img_url}`,org_person_logo_header_url:`${y}${It.header_img_url}`,org_person_sign_text:It.signature,org_person_signature_url:`${y}${It.signature_img_url}`,person_seal_url:`${It.seal_img_url}`},Lt={...it,visit_pad_json:JSON.stringify(_e),...bt};if(ot===""||window.doctor_role_id_for_seg==ot)Q(Lt);else if(Ct)ge(Ut=>({...Ut,visible:!0,visitpadPref:Lt}));else return Lt},ur=async(it={doc_id:"",doc_rid:""})=>{const yt=await Zr.getVisitpadPreference(it,{token:c,envName:n},d.org_branch_id_for_seg||"",d.person_id_for_seg||"",d.doctor_role_id_for_seg||""),ot=await Zr.getDoctorPreference("print_configs",it,d.doctor_role_id_for_seg||"",d.org_branch_id_for_seg||"",{token:c,envName:n||J.E_ENVIRONMENT.STAGING}),Ct=yt?.visit_pad_json,Mt={};let Gt=0;ot?.print_templates?.forEach((kt,It)=>{kt?.name&&(Mt[It]=kt.name,Gt=kt.is_default?It:Gt)}),yt.printPreferenceList=Mt,yt.printPrefMasterArr=ot?.print_templates||[],yt.unmodifiedVisitPadJson=Ct,yt.printDefaultPrefIndex=Gt;const Ht=await nr(yt,Gt,it.doc_rid,!1);if(!(it.doc_rid===""||window.doctor_role_id_for_seg==it.doc_rid))return Ht},vt=async()=>{const it=await an(i);N(it);const yt={};if(it?.service_list){for(const ot of it.service_list)yt[ot.service_identifier]={...ot};Ee(yt)}};window.patientPopupHandler=async(it,yt,ot,Ct,Mt,Gt,Ht)=>{S(!0),fe(it),M({patientRoleID:yt,patientID:ot}),l.current=Ht??null,await nr(Ct,Ct.printDefaultPrefIndex,"",!1);try{W(jt.includes(Gt?.toLowerCase()??"")?Gt.toLowerCase():jt[2]),Qt(yt),on(i).then(I),mn("patient_config",i).then(ie),Zr.getDoctorPreference("print_configs",{doc_rid:""},d.doctor_role_id_for_seg||"",d.org_branch_id_for_seg||"",{token:c,envName:n||J.E_ENVIRONMENT.STAGING}).then(de),Yl(yt,ot,i).then(Le),ar(yt),await vt()}catch{console.log("Failed to open patient pop up")}};const tr=()=>{ge({printDataFrom:"",visible:!1,whichPreview:"",printData:"",visitId:"",visit_date:"",details:{},visit_number:1,currentPrintTime:0,printType:"",trackEventHandler:()=>{}})};v.useEffect(()=>{document.body.style.overflow=A?"hidden":"auto"},[A]);const cr=v.useMemo(()=>[...Y?.patient_config?.custom_fields||[]].sort((ot,Ct)=>ot.sort-Ct.sort).map(ot=>{const Ct=V?.custom_fields?.find(Mt=>Mt.id===ot.id);return{...ot,value:Ct?.value||"",title:Ct?.value?Ct?.title:ot.title}}),[Y?.patient_config?.custom_fields,V?.custom_fields]),pr=it=>{switch(it){case"1":return"Consultation";case"2":return"Other";case"3":return"Lab";default:return"Other"}},ar=async it=>{function yt(ot){return ot?ot.replace("Z","").replace(" +0000 UTC","").trim():null}try{const[ot,Ct]=await Promise.all([vl(it,1,1,i),_l(it,1,10,i)]),Mt=Ct?.wallet_transactions?.filter(It=>It.type?.toUpperCase()==="DEPOSIT").map(It=>({...It,created_on:It.transaction_time}))??[],Gt=ot?.data?.filter(It=>It.payment_refund?.toUpperCase()==="P")??[],Ht=[...Mt,...Gt].sort((It,B)=>{const _e=new Date(yt(It.created_on)||0).getTime();return new Date(yt(B.created_on)||0).getTime()-_e});if(Ht.length===0){Bt({created_on:"",category_name:""});return}const kt=Ht[0];Bt({created_on:kt.created_on??"",category_name:"service_category_id"in kt?pr(kt.service_category_id):kt.type??""})}catch(ot){console.error("Error in last payment details API Call",ot),Bt({created_on:"",category_name:""})}};function mr(it){const yt=J.dayjs(it).startOf("day"),Ct=J.dayjs().startOf("day").diff(yt,"day");return Ct===0?"Today":Ct===1?"Yesterday":Ct>=2?`${Ct} days ago`:yt.format("DD MMM YYYY")}return e.jsxRuntimeExports.jsx("div",{id:"react_patientpopup_mfe",children:e.jsxRuntimeExports.jsxs(Dt.Provider,{value:{billPreferences:Y,preferences:j,currentWindow:k,patientDetails:V,setShowPrintModal:ge,showPrintModal:z,setEndConsultationClicked:Z,doctorListArr:P,docPreference:q,serviceListArr:D,patientIDs:F,showToast:sr,isLoading:h,setLoading:O,formattedService:H,ppEventProps:ft,getAndSetServiceListArr:vt,patientCustomFieldData:cr,getLastBillsPaymentData:ar,setLastBillPaymentData:Bt,variable:i},children:[e.jsxRuntimeExports.jsx("div",{children:A&&e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1060,height:"100vh",display:"flex",width:"100%",top:0,paddingTop:"50px",left:0},children:e.jsxRuntimeExports.jsxs("div",{style:{zIndex:1e3,borderRadius:"12px",border:"0px",backgroundColor:"var(--White, #FFFFFD)",boxShadow:"0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08)",padding:"0px",width:R?"980px":"1267px",maxHeight:"80.45vh",minHeight:"70vh",inset:"6%"},children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-sticky hfl-top-0 hfl-z-50",children:e.jsxRuntimeExports.jsx(Yn,{redirectionPage:je,patientIDs:F,setShowPatientPopModal:S,handleCurrentWindow:er,closePrintModal:tr})}),h&&e.jsxRuntimeExports.jsx("div",{className:" hfl-absolute hfl-flex hfl-items-center hfl-justify-center hfl-rounded-b-2xl hfl-bg-White",style:{width:"inherit",height:"598px"},children:e.jsxRuntimeExports.jsx(Gs,{})}),k===jt[1]&&e.jsxRuntimeExports.jsx(pa,{}),k===jt[2]&&e.jsxRuntimeExports.jsx(fa,{closePrintModal:tr}),k===jt[3]&&e.jsxRuntimeExports.jsx(ja,{closePrintModal:tr,handleCurrentWindow:er,billIdToOpen:l.current,onBillHandled:()=>l.current=null}),k===jt[4]&&e.jsxRuntimeExports.jsx(Aa,{closePrintModal:tr}),k===jt[5]&&e.jsxRuntimeExports.jsx(ga,{closePrintModal:tr,setLatestMetaData:gt,setInvestigationDropdown:pt,setCustomTranslations:Te,getVisitpadPreferenceHandler:ur,updateVPPrefUsingDocPref:nr}),k===jt[6]&&e.jsxRuntimeExports.jsx(Ha,{showToast:sr}),k===jt[8]&&e.jsxRuntimeExports.jsx(Zn,{patientAbhaDetails:Fe,setPatientAbhaDetails:Le,getPatientDetails:Qt,isPartnerServiceEnabled:window?.partner_service_enabled==="1",partnerConfig:lt}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[40px] hfl-items-center hfl-rounded-b-md hfl-border-t-1 hfl-border-Gray-200 hfl-bg-White hfl-p-4 ",children:Ot.created_on&&e.jsxRuntimeExports.jsxs(e.bs,{variant:"Medium",type:"Text sm",children:["Last Payment: ",mr(Ot.created_on),Ot.category_name&&` (${Ot.category_name})`]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-[100]",children:e.jsxRuntimeExports.jsx(e.qh,{toastList:g})})]})}),z?.visible&&e.jsxRuntimeExports.jsx(ne.PrintModal,{modalProps:{mfePrefix:"hfl",printType:z.printType,onCloseModal:tr,showToast:sr,currentPrintTime:z.currentPrintTime,whichPreview:z.whichPreview,envName:i},billPrintProps:z.printType==="bill"||z.printType==="bill_deposit_refund"?{billPatientDetails:z.details.billPatientDetails,billServiceDetails:z.details.billServiceDetails,billSummaryDetails:z.details.billSummaryDetails,preferences:{...Y?.print?.bill,...Y?.org_details,...Y?.branch_details,doc_sign_img:T,doc_sign_text:Tt},showPrintPreviewForBill:z.details.showPrintPreviewForBill,isWholeBill:z.details.isWholeBill,payloadDataforEmail:z.details.payloadDataforEmail,printDataFrom:z.printDataFrom,depositRefundBillDetails:z.details.depositRefundBillDetails}:void 0,optionFormProps:{selectedLanguage:He,showLanguageDropDown:z.printType==="visit"&&Ie?.print==="1"||z.printType==="visit"&&window.role_id!="11",showPrintPrefDropDown:!0,setSelectedLanguage:it=>ae(it),googleReview:!1,showEmailInput:!0,showPhoneInput:z.printType==="visit"},ampEventProps:{vpEventProps:"",setvpEventProps:()=>{},trackEventHandler:it=>{z.trackEventHandler?.(it)}},visitpadProps:z.printType==="visit"?{printDataFrom:z.printDataFrom,patientDetails:V,visitDetails:z.details,offlineMode:!1,visitId:z.visitId,preferences:z?.visitpadPref||j,endConsultationClicked:X,visitDate:z.visit_date,visitPadOrder:z?.visitpadPref?.visitpad_order?Ml(z?.visitpadPref?.visitpad_order,z?.visitpadPref?.visit_pad_json):ke,visitNumber:z.visit_number,customTranslations:ue,latestMetaData:Xt,investigationDropdown:Se,printDateTime:()=>"",getInvestigationTestNameOffline:()=>{},updateVPPrefUsingDocPref:nr,patientCustomFields:cr}:void 0,appointmentInfoProps:z.printType==="visit"&&z.printDataFrom==="patient_popup"?z.appointmentInfo:void 0})]})}),A&&e.jsxRuntimeExports.jsx(va,{fontBaseUrl:i.fontBaseUrl})]})})}exports.PatientPopupContainer=La;
|
|
36
|
+
`)}`;return e.jsxRuntimeExports.jsx("div",{style:{zIndex:1e4},className:"hfl-fixed hfl-inset-0 hfl-flex hfl-w-full hfl-items-center hfl-justify-center hfl-overflow-y-auto hfl-overflow-x-hidden hfl-opacity-100 hfl-outline-none",children:e.jsxRuntimeExports.jsx("div",{className:"xss:max-md:hfl-w-[80vw] hfl-relative hfl-m-1 hfl-mx-auto hfl-my-6 hfl-w-auto",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-rounded-lg hfl-border-0 hfl-bg-White hfl-shadow-lg hfl-outline-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-between hfl-rounded-t hfl-px-4 hfl-py-2 hfl-shadow-sm",style:{borderBottom:"1px solid var(--gray-300, #D0D5DD)"},children:[e.jsxRuntimeExports.jsx(e.bs,{type:"Text md",variant:"Regular",children:"Report"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Tertiary-Grey",icon:"Only",iconFile:"hx_close",onClick:()=>d(!1),size:"md",textField:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-overflow-y-auto",style:{maxHeight:"85vh"},children:[e.jsxRuntimeExports.jsx("div",{id:"pdf-print-render",className:"hfl-overflow-y-auto hfl-bg-Gray-300",children:e.jsxRuntimeExports.jsxs("div",{className:"relative hfl-h-[85vh] hfl-w-[210mm] xxs:max-md:hfl-h-[85vh] xxs:max-sm:hfl-w-[150mm] md:hfl-w-[180mm]",children:[P&&e.jsxRuntimeExports.jsx(Gs,{}),e.jsxRuntimeExports.jsx("iframe",{height:"100%",width:"100%",src:q(D.report_link),title:"PDF Report",onLoad:He,style:{display:P?"none":"block"}})]})}),y?e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"-4px 0px 4px 0px rgba(222, 214, 214, 0.25)",maxHeight:"85vh",position:"relative"},children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex-grow hfl-overflow-y-auto",style:{paddingBottom:"60px"},children:k?.visits&&k.visits.length>0?e.jsxRuntimeExports.jsxs("div",{className:"hfl-p-6 hfl-pb-0",children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-font-inter-2 !hfl-text-Black",children:"Please Choose Date:"}),e.jsxRuntimeExports.jsx(Da,{visits:k?.visits,setPdfUrl:N,pdfUrl:D})]}):!P&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-flex-1 hfl-items-center hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"!hfl-text-Gray hfl-font-inter-2",children:"No reports available."})})}),k?.visits&&k.visits.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-bottom-[0px] hfl-w-[400px] hfl-border-t-1 hfl-border-Gray-100 hfl-bg-White hfl-p-2",style:{boxShadow:"0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)"},children:e.jsxRuntimeExports.jsx(e.Ku,{onClick:()=>ae(D,"Attachment"),hierarchy:"Primary",size:"lg",textField:"Attach to EMR",className:"hfl-mx-2 hfl-flex hfl-w-full hfl-items-center hfl-justify-center hfl-text-center"})})]}):e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"-4px 0px 4px 0px rgba(222, 214, 214, 0.25)",maxHeight:"85vh",position:"relative"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-justify-between hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"rgba(222, 214, 214, 0.25) -4px 0px 4px 0px"},children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-py-6 xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Email",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_mail",errorMsg:j&&F!=="email"?"Email format is wrong":void 0,inputProps:{onFocus:()=>M("email"),onBlur:()=>M(""),autoFocus:!0,type:"text",placeholder:"Enter Email",onChange:de=>{je(de)},value:V}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-auto xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Phone Number",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_phone",errorMsg:z&&F!=="phone"?"Invalid Phone Number":void 0,inputProps:{placeholder:"Enter Phone Number",onFocus:()=>M("phone"),onBlur:()=>M(""),onChange:de=>{fe(de)},value:Y,maxLength:10}})})]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-bottom-[0px] hfl-w-[400px] hfl-border-t-1 hfl-border-Gray-100 hfl-bg-White hfl-p-2",style:{boxShadow:"0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-space-x-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Email",disabled:!V||j||P,icon:"Left",onClick:()=>ae(D,"Email"),iconFile:"hx_mail hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"WhatsApp",disabled:!Y||z||P,icon:"Left",onClick:()=>ae(D,"SMS/WA"),iconFile:"hfl-mr-2",className:"hfl-border-Blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsx("img",{alt:"WhatsApp",src:ne.WhatsApp,width:"24px",height:"24px",className:"hfl-absolute hfl-left-[16px] hfl-top-[50%] hfl-translate-y-[-50%] hfl-object-contain hover:hfl-cursor-pointer"})]}),e.jsxRuntimeExports.jsx(e.Ku,{id:"print-button",hierarchy:"Secondary",size:"lg",textField:"Print",disabled:P,icon:"Left",onClick:()=>l("print_pdf",D),iconFile:"hx_print hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-flex hfl-items-center hfl-justify-center hfl-border hfl-px-10"})]})})})]})})]})]})})})},Ba=i=>{const{patientDetails:d,showToast:c,variable:n}=i,[y,R]=v.useState(!1),[l,A]=v.useState(""),{org_person_bid_str:S=""}=d,h=v.useReducer((Q,F)=>({...Q,...F}),{currentPage:1,totalRecord:0,LabRecords:[],isLabTableLoading:!1}),[O,g]=h,{LabRecords:L,currentPage:k,isLabTableLoading:W}=O,D=(Q,F)=>{Q==="print_pdf"?window.open(F.report_link,"_blank"):Q==="print_preview"&&(R(!0),A(F))},N=v.useCallback(async Q=>{try{g({isLabTableLoading:!0});const F=await ne.getLisDataByOrgBidStr(S,n);let M=[];F?.visits?.length&&(M=Ga(F.visits)),g({currentPage:Q,LabRecords:M?.length?M:[],isLabTableLoading:!1,totalRecord:M.length})}catch(F){g({isLabTableLoading:!1}),console.log(F)}},[g,S,n]),P={lab_date:"100px",lab_number:"350px"};v.useEffect(()=>{N(k)},[k,N]);const I=v.useMemo(()=>[{Header:"Date",accessor:"lab_date",Cell:({row:Q})=>e.jsxRuntimeExports.jsx("div",{className:"hfl-max-[100px] hfl-w-[100px]",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.lab_date}]`,children:Q?.original?.lab_date&&J.dayjs(Q.original.lab_date).format("DD-MMM-YYYY")})})},{Header:"Lab Number / Service Name.",accessor:"lab_number",Cell:({row:Q})=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.lab_number}]`,children:Q?.original?.lab_number&&Q.original.lab_number})},{Header:"View Report",accessor:"report_link",Cell:({row:Q})=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-mx-2 hfl-my-1 hfl-flex hfl-gap-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Print",iconFile:"hx_print",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-print",onClick:()=>D("print_preview",Q.original)}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Share",iconFile:"hx_share",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-share",onClick:()=>D("print_preview",Q.original)})]})}],[P.lab_date,P.lab_number]),j=v.useMemo(()=>L,[L]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[" ",j?.length>0&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xl,{columns:I,data:j||[]}),y&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-left-[50%] hfl-top-[50%]",children:e.jsxRuntimeExports.jsx(Ta,{setLisModalOpen:R,patientDetails:d,lisPDFUrl:l,showListing:!1,openLISReportHandler:D,showToast:c,variable:n})})]}),j.length===0&&!W&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text md",className:"hfl-items-center hfl-justify-center hfl-text-Gray-400",children:"These are no Reports for the Patient"})}),W&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",style:{width:"inherit"},children:e.jsxRuntimeExports.jsx(Gs,{})})]})},Ga=i=>{const d=[];return i.forEach(c=>{c.reports.forEach(n=>{d.push({lab_number:n.lab_number,report_link:n.report_link,lab_date:c.date})})}),d},Fa=i=>{const{setHplxLabModalOpen:d,patientDetails:c,showHPLXPrintPreview:n,reportsData:y,showToast:R,envName:l}=i,{patient_role_id:A="",email:S="",phone_number:h="",name:O=""}=c,{order_date:g,report_id:L}=y,[k,W]=v.useState(!1),[D,N]=v.useState(""),[P,I]=v.useState(S),[j,Q]=v.useState(h),[F,M]=v.useState(!1),[V,te]=v.useState(null),[Y,ie]=v.useState("");v.useEffect(()=>{A&&g&&(async()=>{const ae={pid:A,todays_date:g,rids:L};try{const q=await ne.getHplxLabPdfUrl(ae,l);if(q&&q?.pdf){ie(q.pdf);const H=await(await fetch(q.pdf)).blob(),Ee=URL.createObjectURL(H);te(Ee),n||fe(Ee)}}catch(q){console.error("Error:",q)}})()},[A,g]);const z=async He=>{try{const ae={created_by:window.doctor_role_id_for_seg,dynamicFieldValue:{patient_name:O,url:Y,email_attachment_urls:Y,email_attachment_file_names:"Lab-Report.pdf"},receiverEmails:He==="Email"?[P]:[],receiverPersonRoleIds:[],receiverPhoneNumbers:He==="WA"?[j]:[],receiverPhoneNumbersUrl:"",senderId:window.doctor_role_id_for_seg,sourceDetails:{entity_type:"hplx_lab_report",entity_id:L,user_type:"0",user_id:A,branch_id:window.org_branch_id_for_seg},triggerCode:He==="WA"?"EHR-LAB-REPORT-WHATSAPP":"EHR-LAB-REPORT-EMAIL"};if(await ne.sendV2PrintEmailOrSMS(ae,l))R("",`${He==="Email"?"Email":"WhatsApp"} Sent Successfully`,"Success",1e3,"topRight");else throw new Error("Error while uploading the file")}catch(ae){console.log("error",ae)}},ge=He=>{const{value:ae}=He.target;W(!!ae&&!$r.create$6().email().isValidSync(ae)),I(ae)},je=He=>{const{value:ae}=He.target;M(!!ae&&!$r.create$6().min(10).max(10).isValidSync(ae)),Q(ae)},fe=He=>{if(He){const ae=document.getElementById("hiddenIframe").querySelector("iframe");ae.src=He,ae.onload=()=>{ae.contentWindow.print()}}};return e.jsxRuntimeExports.jsx("div",{style:{zIndex:1e4},className:"hfl-fixed hfl-inset-0 hfl-flex hfl-w-full hfl-items-center hfl-justify-center hfl-overflow-y-auto hfl-overflow-x-hidden hfl-opacity-100 hfl-outline-none",children:e.jsxRuntimeExports.jsx("div",{className:"xss:max-md:hfl-w-[80vw] hfl-relative hfl-m-1 hfl-mx-auto hfl-my-6 hfl-w-auto",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-rounded-lg hfl-border-0 hfl-bg-White hfl-shadow-lg hfl-outline-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-between hfl-rounded-t hfl-px-4 hfl-py-2 hfl-shadow-sm",style:{borderBottom:"1px solid var(--gray-300, #D0D5DD)"},children:[e.jsxRuntimeExports.jsx(e.bs,{type:"Text md",variant:"Regular",children:"Report"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Tertiary-Grey",icon:"Only",iconFile:"hx_close",onClick:()=>d(!1),size:"md",textField:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-overflow-y-auto",style:{maxHeight:"85vh"},children:[e.jsxRuntimeExports.jsx("div",{id:"pdf-print-render",className:"hfl-overflow-y-auto hfl-bg-Gray-300",children:e.jsxRuntimeExports.jsxs("div",{className:"relative hfl-h-[85vh] hfl-w-[210mm] xxs:max-md:hfl-h-[85vh] xxs:max-sm:hfl-w-[150mm] md:hfl-w-[180mm]",children:[e.jsxRuntimeExports.jsx("iframe",{height:"100%",width:"100%",src:V?V+"#toolbar=0&navpanes=0":"about:blank",title:"PDF Report"}),e.jsxRuntimeExports.jsx("div",{id:"hiddenIframe",className:"hfl-hidden",children:e.jsxRuntimeExports.jsx("iframe",{src:V,title:"PDF Report"})})]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"-4px 0px 4px 0px rgba(222, 214, 214, 0.25)",maxHeight:"85vh",position:"relative"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-justify-between hfl-bg-Gray-25 md:hfl-w-[400px]",style:{boxShadow:"rgba(222, 214, 214, 0.25) -4px 0px 4px 0px"},children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-py-6 xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Email",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_mail",errorMsg:k&&D!=="email"&&"Email format is wrong",inputProps:{onFocus:()=>N("email"),onBlur:()=>N(""),autoFocus:!0,type:"text",placeholder:"Enter Email",onChange:He=>{ge(He)},value:P}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-auto xxs:max-md:hfl-w-[190px]",children:e.jsxRuntimeExports.jsx(e.Ps,{label:"Phone Number",height:"hfl-h-10 hfl-border-Purple-200 hfl-h-10 hfl-border-Purple-200",start_icon:"hx_phone",errorMsg:F&&D!=="phone"&&"Invalid Phone Number",inputProps:{placeholder:"Enter Phone Number",onFocus:()=>N("phone"),onBlur:()=>N(""),onChange:He=>{je(He)},value:j,maxLength:10}})})]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-bottom-[0px] hfl-w-[400px] hfl-border-t-1 hfl-border-Gray-100 hfl-bg-White hfl-p-2",style:{boxShadow:"0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)"},children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-space-x-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Email",disabled:!P||k,icon:"Left",onClick:()=>z("Email"),iconFile:"hx_mail hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"WhatsApp",disabled:!j||F,icon:"Left",onClick:()=>z("WA"),iconFile:"hfl-mr-2",className:"hfl-border-blue-300 hfl-items-center hfl-justify-center hfl-border hfl-px-10"}),e.jsxRuntimeExports.jsx("img",{alt:"WhatsApp",src:ne.WhatsApp,width:"24px",height:"24px",className:"hfl-absolute hfl-left-[16px] hfl-top-[50%] hfl-translate-y-[-50%] hfl-object-contain hover:hfl-cursor-pointer"})]}),e.jsxRuntimeExports.jsx(e.Ku,{id:"print-button",hierarchy:"Secondary",size:"lg",textField:"Print",icon:"Left",onClick:()=>fe(V),iconFile:"hx_print hfl-text-4 hfl-text-4",className:"hfl-border-Blue-300 hfl-flex hfl-items-center hfl-justify-center hfl-border hfl-px-10"})]})})})]})})]})]})})})},Ma=i=>{const{patientDetails:d,showToast:c,variable:n}=i,[y,R]=v.useState(!1),[l,A]=v.useState(!0),[S,h]=v.useState({}),O=v.useReducer((M,V)=>({...M,...V}),{currentPage:1,totalRecord:0,LabRecords:[],isLabTableLoading:!1}),[g,L]=O,{LabRecords:k,currentPage:W,isLabTableLoading:D,totalRecord:N}=g,P={order_date:"100px",test:"350px"},I=(M,V)=>{R(!0),A(M),h(V)},j=v.useCallback(async M=>{L({isLabTableLoading:!0});try{const V=await gn(sn,M,d?.patient_role_id,n),te=V?.data??[];L({currentPage:M,LabRecords:[...k,...te],isLabTableLoading:!1,totalRecord:V?.total_lab_count??0})}catch(V){console.error("Failed to fetch HPLX Lab reports:",V)}finally{L({isLabTableLoading:!1})}},[L,d?.patient_role_id,n]);v.useEffect(()=>{j(W)},[W,j]);const Q=v.useMemo(()=>[{Header:"Date",accessor:"order_date",Cell:({row:M})=>e.jsxRuntimeExports.jsx("div",{className:"hfl-max-[100px] hfl-w-[100px]",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.order_date}]`,children:M?.original?.order_date&&J.dayjs(M.original.order_date).format("DD-MMM-YYYY")})})},{Header:"Test Name",accessor:"test",Cell:({row:M})=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text [13px]",className:`hfl-text-Gray-600 hfl-w-[${P.test}]`,children:M?.original?.test&&M.original.test})},{Header:"View Report",accessor:"report_link",Cell:({row:M})=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-mx-2 hfl-my-1 hfl-flex hfl-gap-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Print",iconFile:"hx_print",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-print",onClick:()=>I(!0,M.original)}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary-Grey",size:"sm",textField:"Share",iconFile:"hx_share",icon:"Left",className:"hfl-w-[74px]","data-qa":"to-share",onClick:()=>I(!0,M.original)})]})}],[P.order_date,P.test]),F=v.useMemo(()=>k,[k]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[" ",F?.length>0&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xl,{columns:Q,data:F||[]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-2",children:e.jsxRuntimeExports.jsx(Qr,{currentPage:W,totalRecord:N,handleLoadMore:()=>j(W+1),isLoading:D,currentTotal:F.length})}),y&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-left-[50%] hfl-top-[50%]",children:e.jsxRuntimeExports.jsx(Fa,{setHplxLabModalOpen:R,patientDetails:d,showHPLXPrintPreview:l,reportsData:S,showToast:c,envName:n})})]}),F.length===0&&!D&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text md",className:"hfl-items-center hfl-justify-center hfl-text-Gray-400",children:"These are no Reports for the Patient"})}),D&&e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[calc(100%_-_80px)] hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-4",style:{width:"inherit"},children:e.jsxRuntimeExports.jsx(Gs,{})})]})},Ha=i=>{const{showToast:d}=i,{patientDetails:c,billPreferences:n,variable:y}=v.useContext(Dt)||{},[R,l]=v.useState(""),A=n?.features?.enable_lis_v1??!1,S=y.window_var.permit_lab_tech=="1";v.useEffect(()=>{A&&S||A?l(zr[$t.lis_report].key):S&&l(zr[$t.healthplix_report].key)},[A,S]);const h=O=>{l(O)};return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[73.55vh] hfl-bg-White",children:e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-[913px] hfl-flex-col hfl-justify-start hfl-px-4 hfl-py-2",children:A||S?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center",children:[A&&e.jsxRuntimeExports.jsx(e.bs,{variant:`${R===$t.lis_report?"Semibold":"Regular"}`,type:"Text md",className:`hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-center hfl-gap-0.5 hfl-px-[13px] hfl-py-2 ${R===$t.lis_report?"hfl-border-b-2 hfl-border-Primary-600 hfl-text-Primary-600":""}`,onClick:()=>h($t.lis_report),children:zr[$t.lis_report].label}),S&&e.jsxRuntimeExports.jsx(e.bs,{variant:`${R===$t.healthplix_report?"Semibold":"Regular"}`,type:"Text md",className:`hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-center hfl-gap-0.5 hfl-px-[13px] hfl-py-2 ${R===$t.healthplix_report?"hfl-border-b-2 hfl-border-Primary-600 hfl-text-Primary-600":""}`,onClick:()=>h($t.healthplix_report),children:zr[$t.healthplix_report].label})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative hfl-mx-[12%] hfl-h-full hfl-overflow-auto hfl-py-[20px]",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-center hfl-justify-between hfl-pb-2",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Semibold",type:"Text md",className:"hfl-text-Gray-600",children:R===$t.lis_report?"Lab reports of LIS":R===$t.healthplix_report?"Lab reports of Healthplix":""})}),R===$t.lis_report&&e.jsxRuntimeExports.jsx(Ba,{patientDetails:c,showToast:d,variable:y}),R===$t.healthplix_report&&e.jsxRuntimeExports.jsx(Ma,{patientDetails:c,showToast:d,variable:y})]})]}):e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-items-center hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text lg",className:"hfl-text-Gray-500",children:"Lab is not active."})})})})})};function La({variable:i}){const{window_var:d,token:c,envName:n,IMGREP_DIRECTORY:y}=i,R=jl.useMediaQuery("(max-width: 1080px)"),l=v.useRef(null),[A,S]=v.useState(!1),[h,O]=v.useState(!1),[g,L]=v.useState([]),[k,W]=v.useState(jt[2]),[D,N]=v.useState(),[P,I]=v.useState(),[j,Q]=v.useState(),[F,M]=v.useState(),[V,te]=v.useState(),[Y,ie]=v.useState(),[z,ge]=v.useState({printDataFrom:"",visible:!1,whichPreview:"offlinePrint",printData:"",visitId:"",visit_date:"",details:{},visit_number:1,currentPrintTime:0,printType:"bill",trackEventHandler:()=>{}}),[je,fe]=v.useState(""),[He,ae]=v.useState("en"),[q,de]=v.useState(),[H,Ee]=v.useState(),[Fe,Le]=v.useState(),[ft,ct]=v.useState({patient_id:"",patient_registered_date:"",patient_age:"",patient_gender:""}),lt=window?.partner_config?JSON.parse(window?.partner_config):{};console.log("PatientPopupContainer 124");const[ke,ht]=v.useState([]),{patient_preferred_language:wt}=V||{},{visit_pad_json:mt,visitpad_order:St,org_person_sign_text:Tt,org_person_signature_url:T}=j||{},{add_lang_change:Ie,defaultLanguage:Ue}=typeof mt=="string"&&mt&&JSON.parse(mt)||{},{rows:se}=Ue||{},[X,Z]=v.useState(!1),[ue,Te]=v.useState({}),[Se,pt]=v.useState([]),[Xt,gt]=v.useState({}),[Ot,Bt]=v.useState({created_on:"",category_name:""});v.useEffect(()=>{const it=Y?.print?.bill?.appnt_minute_slab;if(!it)return;const yt=+it;yt&&(Dr.find(Ct=>Ct.value==yt)||Dr.unshift({label:`${yt} min`,value:yt}))},[Y]);const Qt=v.useCallback(it=>{nn({callback:ot=>{te(ot),ct({patient_id:it,patient_registered_date:"",patient_age:ot?.age?typeof ot?.age=="number"?`${ot.age} y`:`${fr(`${ot.age}`)}`:fr(ot?.org_person_dob),patient_gender:Zl(ot?.gender)})}},it,i)},[te]),er=it=>{tr(),W(it)},sr=(it,yt,ot,Ct)=>{const Mt=Date.now();L(Gt=>[...Gt,{id:Mt,title:it,description:yt,type:ot,duration:Ct}]),setTimeout(()=>{L(Gt=>[...Gt].filter(({id:Ht})=>Ht!==Mt))},Ct)};v.useEffect(()=>{St&&mt&&ht(Ml(St,mt))},[j,mt,St]);const hr=v.useCallback(()=>{ae(typeof wt=="string"&&wt.length>=2?wt:typeof se=="string"&&se.length>=2?se:"en")},[se,wt]);v.useEffect(()=>{hr()},[wt,se,hr]);const nr=async(it,yt,ot,Ct=!0)=>{const{unmodifiedVisitPadJson:Mt,printPrefMasterArr:Gt}=it,Ht=Mt&&J.isJson(Mt)?JSON.parse(Mt):{},kt=Gt?.[yt]||{config:{}},It=kt?.config||{},_e={...Ht,...kt,...((Ut,Zt)=>Object.fromEntries(Object.entries(Ut).map(([rr,Pr])=>[Zt[rr]||rr,Pr])))(It,ln)},bt={org_person_logo_footer_url:`${y}${It.footer_img_url}`,org_person_logo_header_url:`${y}${It.header_img_url}`,org_person_sign_text:It.signature,org_person_signature_url:`${y}${It.signature_img_url}`,person_seal_url:`${It.seal_img_url}`},Lt={...it,visit_pad_json:JSON.stringify(_e),...bt};if(ot===""||window.doctor_role_id_for_seg==ot)Q(Lt);else if(Ct)ge(Ut=>({...Ut,visible:!0,visitpadPref:Lt}));else return Lt},ur=async(it={doc_id:"",doc_rid:""})=>{const yt=await Zr.getVisitpadPreference(it,{token:c,envName:n},d.org_branch_id_for_seg||"",d.person_id_for_seg||"",d.doctor_role_id_for_seg||""),ot=await Zr.getDoctorPreference("print_configs",it,d.doctor_role_id_for_seg||"",d.org_branch_id_for_seg||"",{token:c,envName:n||J.E_ENVIRONMENT.STAGING}),Ct=yt?.visit_pad_json,Mt={};let Gt=0;ot?.print_templates?.forEach((kt,It)=>{kt?.name&&(Mt[It]=kt.name,Gt=kt.is_default?It:Gt)}),yt.printPreferenceList=Mt,yt.printPrefMasterArr=ot?.print_templates||[],yt.unmodifiedVisitPadJson=Ct,yt.printDefaultPrefIndex=Gt;const Ht=await nr(yt,Gt,it.doc_rid,!1);if(!(it.doc_rid===""||window.doctor_role_id_for_seg==it.doc_rid))return Ht},vt=async()=>{const it=await an(i);N(it);const yt={};if(it?.service_list){for(const ot of it.service_list)yt[ot.service_identifier]={...ot};Ee(yt)}};window.patientPopupHandler=async(it,yt,ot,Ct,Mt,Gt,Ht)=>{S(!0),fe(it),M({patientRoleID:yt,patientID:ot}),l.current=Ht??null,await nr(Ct,Ct.printDefaultPrefIndex,"",!1);try{W(jt.includes(Gt?.toLowerCase()??"")?Gt.toLowerCase():jt[2]),Qt(yt),on(i).then(I),mn("patient_config",i).then(ie),Zr.getDoctorPreference("print_configs",{doc_rid:""},d.doctor_role_id_for_seg||"",d.org_branch_id_for_seg||"",{token:c,envName:n||J.E_ENVIRONMENT.STAGING}).then(de),Yl(yt,ot,i).then(Le),ar(yt),await vt()}catch{console.log("Failed to open patient pop up")}};const tr=()=>{ge({printDataFrom:"",visible:!1,whichPreview:"",printData:"",visitId:"",visit_date:"",details:{},visit_number:1,currentPrintTime:0,printType:"",trackEventHandler:()=>{}})};v.useEffect(()=>{document.body.style.overflow=A?"hidden":"auto"},[A]);const cr=v.useMemo(()=>[...Y?.patient_config?.custom_fields||[]].sort((ot,Ct)=>ot.sort-Ct.sort).map(ot=>{const Ct=V?.custom_fields?.find(Mt=>Mt.id===ot.id);return{...ot,value:Ct?.value||"",title:Ct?.value?Ct?.title:ot.title}}),[Y?.patient_config?.custom_fields,V?.custom_fields]),pr=it=>{switch(it){case"1":return"Consultation";case"2":return"Other";case"3":return"Lab";default:return"Other"}},ar=async it=>{function yt(ot){return ot?ot.replace("Z","").replace(" +0000 UTC","").trim():null}try{const[ot,Ct]=await Promise.all([vl(it,1,1,i),_l(it,1,10,i)]),Mt=Ct?.wallet_transactions?.filter(It=>It.type?.toUpperCase()==="DEPOSIT").map(It=>({...It,created_on:It.transaction_time}))??[],Gt=ot?.data?.filter(It=>It.payment_refund?.toUpperCase()==="P")??[],Ht=[...Mt,...Gt].sort((It,B)=>{const _e=new Date(yt(It.created_on)||0).getTime();return new Date(yt(B.created_on)||0).getTime()-_e});if(Ht.length===0){Bt({created_on:"",category_name:""});return}const kt=Ht[0];Bt({created_on:kt.created_on??"",category_name:"service_category_id"in kt?pr(kt.service_category_id):kt.type??""})}catch(ot){console.error("Error in last payment details API Call",ot),Bt({created_on:"",category_name:""})}};function mr(it){const yt=J.dayjs(it).startOf("day"),Ct=J.dayjs().startOf("day").diff(yt,"day");return Ct===0?"Today":Ct===1?"Yesterday":Ct>=2?`${Ct} days ago`:yt.format("DD MMM YYYY")}return e.jsxRuntimeExports.jsx("div",{id:"react_patientpopup_mfe",children:e.jsxRuntimeExports.jsxs(Dt.Provider,{value:{billPreferences:Y,preferences:j,currentWindow:k,patientDetails:V,setShowPrintModal:ge,showPrintModal:z,setEndConsultationClicked:Z,doctorListArr:P,docPreference:q,serviceListArr:D,patientIDs:F,showToast:sr,isLoading:h,setLoading:O,formattedService:H,ppEventProps:ft,getAndSetServiceListArr:vt,patientCustomFieldData:cr,getLastBillsPaymentData:ar,setLastBillPaymentData:Bt,variable:i},children:[e.jsxRuntimeExports.jsx("div",{children:A&&e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1060,height:"100vh",display:"flex",width:"100%",top:0,paddingTop:"50px",left:0},children:e.jsxRuntimeExports.jsxs("div",{style:{zIndex:1e3,borderRadius:"12px",border:"0px",backgroundColor:"var(--White, #FFFFFD)",boxShadow:"0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08)",padding:"0px",width:R?"980px":"1267px",maxHeight:"80.45vh",minHeight:"70vh",inset:"6%"},children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-sticky hfl-top-0 hfl-z-50",children:e.jsxRuntimeExports.jsx(Yn,{redirectionPage:je,patientIDs:F,setShowPatientPopModal:S,handleCurrentWindow:er,closePrintModal:tr})}),h&&e.jsxRuntimeExports.jsx("div",{className:" hfl-absolute hfl-flex hfl-items-center hfl-justify-center hfl-rounded-b-2xl hfl-bg-White",style:{width:"inherit",height:"598px"},children:e.jsxRuntimeExports.jsx(Gs,{})}),k===jt[1]&&e.jsxRuntimeExports.jsx(pa,{}),k===jt[2]&&e.jsxRuntimeExports.jsx(fa,{closePrintModal:tr}),k===jt[3]&&e.jsxRuntimeExports.jsx(ja,{closePrintModal:tr,handleCurrentWindow:er,billIdToOpen:l.current,onBillHandled:()=>l.current=null}),k===jt[4]&&e.jsxRuntimeExports.jsx(Aa,{closePrintModal:tr}),k===jt[5]&&e.jsxRuntimeExports.jsx(ga,{closePrintModal:tr,setLatestMetaData:gt,setInvestigationDropdown:pt,setCustomTranslations:Te,getVisitpadPreferenceHandler:ur,updateVPPrefUsingDocPref:nr}),k===jt[6]&&e.jsxRuntimeExports.jsx(Ha,{showToast:sr}),k===jt[8]&&e.jsxRuntimeExports.jsx(Zn,{patientAbhaDetails:Fe,setPatientAbhaDetails:Le,getPatientDetails:Qt,isPartnerServiceEnabled:window?.partner_service_enabled==="1",partnerConfig:lt}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-[40px] hfl-items-center hfl-rounded-b-md hfl-border-t-1 hfl-border-Gray-200 hfl-bg-White hfl-p-4 ",children:Ot.created_on&&e.jsxRuntimeExports.jsxs(e.bs,{variant:"Medium",type:"Text sm",children:["Last Payment: ",mr(Ot.created_on),Ot.category_name&&` (${Ot.category_name})`]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-[100]",children:e.jsxRuntimeExports.jsx(e.qh,{toastList:g})})]})}),z?.visible&&e.jsxRuntimeExports.jsx(ne.PrintModal,{modalProps:{mfePrefix:"hfl",printType:z.printType,onCloseModal:tr,showToast:sr,currentPrintTime:z.currentPrintTime,whichPreview:z.whichPreview,envName:i},billPrintProps:z.printType==="bill"||z.printType==="bill_deposit_refund"?{billPatientDetails:z.details.billPatientDetails,billServiceDetails:z.details.billServiceDetails,billSummaryDetails:z.details.billSummaryDetails,preferences:{...Y?.print?.bill,...Y?.org_details,...Y?.branch_details,doc_sign_img:T,doc_sign_text:Tt},showPrintPreviewForBill:z.details.showPrintPreviewForBill,isWholeBill:z.details.isWholeBill,payloadDataforEmail:z.details.payloadDataforEmail,printDataFrom:z.printDataFrom,depositRefundBillDetails:z.details.depositRefundBillDetails}:void 0,optionFormProps:{selectedLanguage:He,showLanguageDropDown:z.printType==="visit"&&Ie?.print==="1"||z.printType==="visit"&&window.role_id!="11",showPrintPrefDropDown:!0,setSelectedLanguage:it=>ae(it),googleReview:!1,showEmailInput:!0,showPhoneInput:z.printType==="visit"},ampEventProps:{vpEventProps:"",setvpEventProps:()=>{},trackEventHandler:it=>{z.trackEventHandler?.(it)}},visitpadProps:z.printType==="visit"?{printDataFrom:z.printDataFrom,patientDetails:V,visitDetails:z.details,offlineMode:!1,visitId:z.visitId,preferences:z?.visitpadPref||j,endConsultationClicked:X,visitDate:z.visit_date,visitPadOrder:z?.visitpadPref?.visitpad_order?Ml(z?.visitpadPref?.visitpad_order,z?.visitpadPref?.visit_pad_json):ke,visitNumber:z.visit_number,customTranslations:ue,latestMetaData:Xt,investigationDropdown:Se,printDateTime:()=>"",getInvestigationTestNameOffline:()=>{},updateVPPrefUsingDocPref:nr,patientCustomFields:cr}:void 0,appointmentInfoProps:z.printType==="visit"&&z.printDataFrom==="patient_popup"?z.appointmentInfo:void 0})]})}),A&&e.jsxRuntimeExports.jsx(va,{fontBaseUrl:i.fontBaseUrl})]})})}exports.PatientPopupContainer=La;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e, b as D, g as xn, t as Ln, K as Fe, h as kn, P as Tt, Z as Or, k as ll, a as Oa, e as hr, A as ur, c as vn, N as _n, O as Ul, E as yn, q as Vn } from "./index-UPYT3B9g.js";
|
|
2
2
|
import cl, { createContext as On, useContext as kt, useState as Y, forwardRef as Wn, useRef as Mr, useEffect as Ke, useCallback as Lt, useMemo as Kt, useReducer as Wa } from "react";
|
|
3
3
|
import { o as Ga, R as Ct, c as Be, h as za, e as zn, v as an, k as nn, i as Yn } from "./common-utils-BidUvSFN.js";
|
|
4
|
-
import { G as qn, a as $n, b as Un, c as bn, U as Ya, d as Zn, e as wn, f as Kn, g as Cn, h as Xn, i as Jn, j as Qn, k as ei, l as ti, m as ri, n as li, o as jn, D as ai, p as ni, q as ii, r as si, s as oi, V as ci, t as Rn, u as di, v as ui, w as fi, x as hi, y as pi, z as mi, A as gi, B as xi, C as vi, F as At, E as _i, H as yi, I as bi, T as It, W as Pn, J as Sn, K as wi, L as Ci, M as ji, P as Ri } from "./PrintModal-
|
|
4
|
+
import { G as qn, a as $n, b as Un, c as bn, U as Ya, d as Zn, e as wn, f as Kn, g as Cn, h as Xn, i as Jn, j as Qn, k as ei, l as ti, m as ri, n as li, o as jn, D as ai, p as ni, q as ii, r as si, s as oi, V as ci, t as Rn, u as di, v as ui, w as fi, x as hi, y as pi, z as mi, A as gi, B as xi, C as vi, F as At, E as _i, H as yi, I as bi, T as It, W as Pn, J as Sn, K as wi, L as Ci, M as ji, P as Ri } from "./PrintModal-Di2l9BWm.js";
|
|
5
5
|
import { G as Pi, f as Si, h as sn, i as Ni } from "./APIAction-DLCcL2Li.js";
|
|
6
6
|
import { a as Di, H as Ai, D as Na, M as Da, b as Wl, S as Ii, C as Aa, O as Ia } from "./CommonConstant-Bj7SvPfU.js";
|
|
7
7
|
import { c as ol } from "./index.esm-Bn1Rklqj.js";
|
|
@@ -14278,7 +14278,9 @@ function So({ variable: s }) {
|
|
|
14278
14278
|
patient_registered_date: "",
|
|
14279
14279
|
patient_age: "",
|
|
14280
14280
|
patient_gender: ""
|
|
14281
|
-
}), it = window?.partner_config ? JSON.parse(window?.partner_config) : {}
|
|
14281
|
+
}), it = window?.partner_config ? JSON.parse(window?.partner_config) : {};
|
|
14282
|
+
console.log("PatientPopupContainer 124");
|
|
14283
|
+
const [Ve, mt] = Y([]), { patient_preferred_language: St } = V || {}, {
|
|
14282
14284
|
visit_pad_json: xt,
|
|
14283
14285
|
visitpad_order: Gt,
|
|
14284
14286
|
org_person_sign_text: Vt,
|