hplx-feature-library 1.0.299 → 1.0.301
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/{APIAction-BgGlVURt.cjs → APIAction-4R25WW2g.cjs} +1 -1
- package/dist/{APIAction-C4GFv-ck.js → APIAction-CMfpd8Bv.js} +1 -1
- package/dist/CommonTypes-Bg9068wC.cjs +1 -0
- package/dist/CommonTypes-BzMrYraH.js +5 -0
- package/dist/PatientAddEdit/index.js +1 -1
- package/dist/{PatientAddEdit-D3R1OpAK.js → PatientAddEdit-B7fjeZlX.js} +31 -30
- package/dist/PatientAddEdit-WITRBHBI.cjs +7 -0
- package/dist/PatientPopup/index.js +1 -1
- package/dist/{PatientPopupContainer-CiG65wai.js → PatientPopupContainer-DuTcUe0x.js} +44 -43
- package/dist/{PatientPopupContainer-J3yRTsFc.cjs → PatientPopupContainer-niKHN__m.cjs} +7 -7
- package/dist/{PrintModal-BbP9sQ08.js → PrintModal-007mwtDw.js} +3 -3
- package/dist/{PrintModal-DUHc2_7D.cjs → PrintModal-DAu_emtt.cjs} +5 -5
- package/dist/SearchPatients/index.js +1 -1
- package/dist/SearchPatients-COBd6WAT.cjs +1 -0
- package/dist/{SearchPatients-D9McylH4.js → SearchPatients-D1PQUJ9C.js} +8 -7
- package/dist/UserProfile/index.js +1 -1
- package/dist/UserProfile-DoatDBHd.cjs +14 -0
- package/dist/{UserProfile-_JHPLC6G.js → UserProfile-HbBoPcvx.js} +4 -3
- package/dist/{common-utils-BMUxEK3j.js → common-utils-CNR4r7ZZ.js} +453 -456
- package/dist/common-utils-DvxWGiX-.cjs +6 -0
- package/dist/index.js +5 -5
- package/dist/print-pdf/index.js +1 -1
- package/dist/types/ApiResponseTypes.d.ts +0 -2
- package/package.json +1 -1
- package/dist/PatientAddEdit-CpgM_oWm.cjs +0 -7
- package/dist/SearchPatients-CWqWZLfl.cjs +0 -1
- package/dist/UserProfile-s5c0-7H7.cjs +0 -14
- package/dist/common-utils-yiZUv58F.cjs +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("./common-utils-
|
|
1
|
+
"use strict";const c=require("./common-utils-DvxWGiX-.cjs"),P=require("./dayjs.min-BawXyS7V.cjs"),A="/preferences/doctor",h="/preferences/visitpad",m="/preferences/branch",_="patient/search",u="../api/modelGetAddPatientSuggestion.php",g="appointments/get",f="/v1/patient/add",l="/v1/patients",d="../api/modelSavePatientImage.php",T="../api/modelDeletePatientImage.php",E="/patient/detail",I="../api/modelSendRegisterOtp.php",D="../api/modelVerifyRegisterOtp.php",w=async(r="",n={},e,t,o)=>{const{doc_rid:s=""}=n;let a="";Array.isArray(r)?a=r.map(i=>`&fields_required=${encodeURIComponent(i)}`).join(""):r&&(a=`&fields_required=${encodeURIComponent(r)}`);try{const i=await c.hplxAPI(o?.token,o.envName).get(`${A}/${s||e}?branch_id=${t}`+a),{data:p}=i||{};return Promise.resolve(p)}catch(i){return console.error("Error fetching doctor preference:",i),Promise.reject(i)}},N=async(r="",n,e)=>{try{const t=await c.ReArchAPI(e.token,e.envName).get(`${m}/${n}?fields_required=${r}`),{data:o}=t||{};return Promise.resolve(o)}catch(t){return console.log(t),Promise.reject(t)}},y=async(r,n,e)=>{try{let t="";Array.isArray(r)?t=r.map(i=>`fields_required=${encodeURIComponent(i)}`).join("&"):r&&(t=`fields_required=${encodeURIComponent(r)}`);const o=`v2${m}/${n}?${t}`,s=await c.ReArchAPI(e.token,e.envName).get(o),{data:a}=s||{};return Promise.resolve(a)}catch(t){return console.error("Error fetching branch preference:",t),Promise.reject(t)}},R=async(r,n,e,t,o)=>{try{const s={appnt_date:r,doctor_role_id:n,doctor_id:t,org_branch_id:e},a=await c.ReArchAPI(o.token,o.envName).post(g,{...s}),{data:i}=a||{};return Promise.resolve(i)}catch(s){return s instanceof Error&&console.error("Error fetching appointments:",s.message),s?.response?.status===401&&c.handle401Status(),Promise.reject(s)}},C=async(r,n)=>{let e=[];const t=await R(P.dayjs().format("YYYY-MM-DD"),r.doctor_role_id,r.branch_id,r.doctor_id,n);t?.appointments?.length&&(e=t.appointments),window.filteredUpcomingAppts=[],e.length&&(r.term?.length?window.filteredUpcomingAppts=e.filter(o=>o.org_person_name.length&&o.org_person_name.toLowerCase().includes(r.term.toLowerCase())&&o.appnt_date>=P.dayjs(new Date).format("YYYY-MM-DD")&&(o.remote_appnt_status==="CONFIRMED"||o.appnt_status===0||o.appnt_status===3||o.appnt_status===5)):window.filteredUpcomingAppts=e.filter(o=>o.appnt_date>=P.dayjs(new Date).format("YYYY-MM-DD")&&(o.remote_appnt_status==="CONFIRMED"||o.appnt_status===0||o.appnt_status===3||o.appnt_status===5)));try{const o=await c.ReArchAPI(n.token,n.envName).post(_,r),{data:s}=o||{};return Promise.resolve(s)}catch(o){return console.log(o),null}},v=async r=>{try{const n=await c.hplxAPI(r.token,r.envName).post(u),{data:e}=n||{},{apiError:t}=e||{};if(t)throw new Error(t);return Promise.resolve(e)}catch(n){return n instanceof Error&&console.error("Error fetching referred by list:",n.message),n?.response?.status===401&&c.handle401Status(),Promise.reject(n)}},j=async(r,n)=>{try{const e=await c.ReArchAPI(n.token,n.envName).post(f,{...r,token:n.token}),{data:t}=e||{};return Promise.resolve(t)}catch(e){return Promise.reject(e)}},O=async(r,n)=>{try{const e=await c.ReArchAPI(n.token,n.envName).put(l+"/"+r?.person_role_id,{...r}),{data:t}=e||{};return Promise.resolve(t)}catch(e){return console.log(e),Promise.reject(e)}},S=async(r,n)=>{try{const e=await c.hplxAPI(n.token,n.envName).post(d,r),{data:t}=e||{};return Promise.resolve(t)}catch(e){return console.log(e),Promise.reject(e)}},L=async(r,n)=>{try{const e=await c.hplxAPI(n.token,n.envName).post(T,r),{data:t}=e||{};return Promise.resolve(t)}catch(e){return console.log(e),Promise.reject(e)}},Y=async({callback:r,payload:n,token_env:e,isCallbackNeeded:t=!0})=>{try{const o=n;window?.partner_service_enabled==="1"&&(o.partner_service_enabled=!0);const s=await c.ReArchAPI(e.token,e.envName).post(E,{...o}),{data:a}=s||{},{error:i}=a||{};if(i)throw new Error(i);if(t)r(a);else return a}catch(o){console.log(o)}},$=async({doc_id:r="",doc_rid:n=""},e,t,o,s)=>{try{const a={branch_id:t,doctor_id:r||o,doctor_role_id:n||s},i=await c.hplxAPI(e.token,e.envName).post(h,a),{data:p}=i||{};return Promise.resolve(p)}catch(a){return console.error("Error fetching visitpad preference:",a),Promise.reject(a)}},G=async(r,n)=>{try{const e=new URLSearchParams;e.append("reg_mobile_number",r);const t=await c.hplxPHPAPI(n.token,n.envName).post(I,e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}});return Promise.resolve(t?.data)}catch(e){return console.log(e),Promise.reject(e)}},M=async(r,n,e)=>{try{const t=new URLSearchParams;t.append("reg_mobile_number",r),t.append("reg_mobile_otp",n);const o=await c.hplxPHPAPI(e.token,e.envName).post(D,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}});return Promise.resolve(o?.data)}catch(t){return console.log(t),Promise.reject(t)}};exports.ADD_PATIENT_IMAGE=d;exports.GET_PATIENT_DETAILS=E;exports.UPDATE_PATIENT_DETAIL=l;exports.addPatientDetails=j;exports.addPatientImage=S;exports.deletePatientImage=L;exports.getBranchPreferences=N;exports.getDoctorPreference=w;exports.getPatientDetails=Y;exports.getPatientList=C;exports.getReferredByList=v;exports.getV2BranchPreference=y;exports.getVisitpadPreference=$;exports.patientConsentOTPVerification=M;exports.patientConsentSendOTP=G;exports.updatePatientDetails=O;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as p, R as i, b as d, c as P } from "./common-utils-
|
|
1
|
+
import { h as p, R as i, b as d, c as P } from "./common-utils-CNR4r7ZZ.js";
|
|
2
2
|
import { d as l } from "./dayjs.min-DHTzfD6l.js";
|
|
3
3
|
const u = "/preferences/doctor", _ = "/preferences/visitpad", E = "/preferences/branch", f = "patient/search", g = "../api/modelGetAddPatientSuggestion.php", h = "appointments/get", T = "/v1/patient/add", A = "/v1/patients", w = "../api/modelSavePatientImage.php", N = "../api/modelDeletePatientImage.php", I = "/patient/detail", y = "../api/modelSendRegisterOtp.php", D = "../api/modelVerifyRegisterOtp.php", j = async (r = "", o = {}, e, t, s) => {
|
|
4
4
|
const { doc_rid: n = "" } = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=(i=>(i.visitpad="/md/viewPatientDashboard.php",i.consultations="/md/viewPatientList.php",i.appointments="/md/viewPatientAppointments.php",i.settings="/md/viewPreferenceSettings.php",i.privateDb="/md/viewPrivateDB.php",i.dashboardBase="/",i.referEarn="/md/inviteReferrals.php",i.teleConsults="/md/viewRemoteAppointments.php",i.pricing="/subscription/pricing",i.billSummary="/subscription/bill-summary",i.pediatricsCalculator="/md/viewPediatricCalculator.php",i))(e||{}),t=(i=>(i.PRODUCTION="PRODUCTION",i.STAGING="STAGING",i.DEVELOPMENT="DEVELOPMENT",i))(t||{});exports.EAPP_ROUTES=e;exports.E_ENVIRONMENT=t;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var e = /* @__PURE__ */ ((i) => (i.visitpad = "/md/viewPatientDashboard.php", i.consultations = "/md/viewPatientList.php", i.appointments = "/md/viewPatientAppointments.php", i.settings = "/md/viewPreferenceSettings.php", i.privateDb = "/md/viewPrivateDB.php", i.dashboardBase = "/", i.referEarn = "/md/inviteReferrals.php", i.teleConsults = "/md/viewRemoteAppointments.php", i.pricing = "/subscription/pricing", i.billSummary = "/subscription/bill-summary", i.pediatricsCalculator = "/md/viewPediatricCalculator.php", i))(e || {}), t = /* @__PURE__ */ ((i) => (i.PRODUCTION = "PRODUCTION", i.STAGING = "STAGING", i.DEVELOPMENT = "DEVELOPMENT", i))(t || {});
|
|
2
|
+
export {
|
|
3
|
+
e as E,
|
|
4
|
+
t as a
|
|
5
|
+
};
|
|
@@ -4,9 +4,10 @@ import { M as Nl } from "./index-F4mvLxgX.js";
|
|
|
4
4
|
import { useState as n, useEffect as M, useRef as re, useCallback as x, useMemo as xl } from "react";
|
|
5
5
|
import { c as gl } from "./index.esm-Bn1Rklqj.js";
|
|
6
6
|
import { d as pe } from "./dayjs.min-DHTzfD6l.js";
|
|
7
|
-
import {
|
|
8
|
-
import { H as
|
|
9
|
-
import {
|
|
7
|
+
import { E as Le } from "./CommonTypes-BzMrYraH.js";
|
|
8
|
+
import { H as ga, D as Fe, M as Ge, b as ue, S as _a, C as Ie, O as ze } from "./CommonConstant-BMwbE0IZ.js";
|
|
9
|
+
import { e as ba, i as ya, d as va, f as wa, p as ja, j as Ca, k as Na, l as _l, a as He, m as bl, g as yl, v as vl, n as wl } from "./common-utils-CNR4r7ZZ.js";
|
|
10
|
+
import { a as Pa, b as Sa, p as Da, c as Ea, d as Ta, e as Ba, f as Oa, h as Ra, u as Aa, g as ka } from "./APIAction-CMfpd8Bv.js";
|
|
10
11
|
const jl = () => /* @__PURE__ */ l.jsx("div", { className: "hfl-h-0 hfl-w-full hfl-border-1 hfl-border-Gray-200" }), Ma = ({ conflicts: N, handleAddPatient: _, redirectAction: I }) => {
|
|
11
12
|
const [S, y] = n(!1);
|
|
12
13
|
return /* @__PURE__ */ l.jsxs("div", { children: [
|
|
@@ -72,7 +73,7 @@ const jl = () => /* @__PURE__ */ l.jsx("div", { className: "hfl-h-0 hfl-w-full h
|
|
|
72
73
|
size: "sm",
|
|
73
74
|
textField: "Continue",
|
|
74
75
|
className: "hfl-text-Primary-700",
|
|
75
|
-
onClick: () =>
|
|
76
|
+
onClick: () => ba(h.person_role_id)
|
|
76
77
|
}
|
|
77
78
|
)
|
|
78
79
|
}
|
|
@@ -221,7 +222,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
221
222
|
]
|
|
222
223
|
}
|
|
223
224
|
);
|
|
224
|
-
},
|
|
225
|
+
}, Ja = (N) => {
|
|
225
226
|
const { closeModal: _, modalIsOpen: I, pref: S, variable: y } = N, { window_var: h, token: f, envName: m } = y, [Q, W] = n(!1), [D, z] = n({}), [u, se] = n(!1), [H, V] = n(null), [J, me] = n(!0), [xe, ge] = n(!1), [L, Z] = n([]), [qe, K] = n(!1), [E, ne] = n(""), [g, Pl] = n(), [b, p] = n({
|
|
226
227
|
name: "",
|
|
227
228
|
phone: "",
|
|
@@ -279,7 +280,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
279
280
|
duration: s
|
|
280
281
|
}
|
|
281
282
|
]);
|
|
282
|
-
}, $ = re(null), Qe = re(null), [el, ee] = n(!1), [zl, Se] = n(!1), [Hl, ll] = n(!1), [al, De] = n(!1), [tl, Ee] = n(!1), [he, Vl] = n(), O = g && g.visit_pad_json &&
|
|
283
|
+
}, $ = re(null), Qe = re(null), [el, ee] = n(!1), [zl, Se] = n(!1), [Hl, ll] = n(!1), [al, De] = n(!1), [tl, Ee] = n(!1), [he, Vl] = n(), O = g && g.visit_pad_json && ya(g.visit_pad_json) && JSON.parse(g.visit_pad_json), rl = va((...e) => {
|
|
283
284
|
const [t, r] = e;
|
|
284
285
|
Ql(t, r);
|
|
285
286
|
}), i = x(
|
|
@@ -315,18 +316,18 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
315
316
|
} else
|
|
316
317
|
return [];
|
|
317
318
|
}, Kl = (e) => {
|
|
318
|
-
if (
|
|
319
|
-
let t =
|
|
320
|
-
return e?.length && (t =
|
|
319
|
+
if (ze?.length) {
|
|
320
|
+
let t = ze;
|
|
321
|
+
return e?.length && (t = ze.filter(
|
|
321
322
|
(r) => r.toLowerCase().includes(e.toLowerCase())
|
|
322
323
|
// last keyboad input after ,
|
|
323
324
|
)), t;
|
|
324
325
|
} else
|
|
325
326
|
return [];
|
|
326
327
|
}, Xl = (e) => {
|
|
327
|
-
if (
|
|
328
|
-
let t =
|
|
329
|
-
return e?.length && (t =
|
|
328
|
+
if (Ie?.length) {
|
|
329
|
+
let t = Ie;
|
|
330
|
+
return e?.length && (t = Ie.filter(
|
|
330
331
|
(r) => r.toLowerCase().includes(e.toLowerCase())
|
|
331
332
|
// last keyboad input after ,
|
|
332
333
|
)), t;
|
|
@@ -334,7 +335,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
334
335
|
return [];
|
|
335
336
|
}, sl = re(null), de = re(null), Te = re(null), nl = window.location?.pathname.includes("/frontdesk");
|
|
336
337
|
M(() => {
|
|
337
|
-
const e =
|
|
338
|
+
const e = wa(a.age, B);
|
|
338
339
|
e && F((t) => ({
|
|
339
340
|
...t,
|
|
340
341
|
dob: e
|
|
@@ -375,7 +376,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
375
376
|
Pl(S);
|
|
376
377
|
try {
|
|
377
378
|
const e = await Sa({ token: f, envName: m }), { total_ref_doc_details: t, through_channel: r } = e;
|
|
378
|
-
t.length && Ll(
|
|
379
|
+
t.length && Ll(ja(t)), r.length && Tl(Ca(r));
|
|
379
380
|
} catch (e) {
|
|
380
381
|
console.log("ERROR", e);
|
|
381
382
|
}
|
|
@@ -415,7 +416,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
415
416
|
case "Appointment":
|
|
416
417
|
return "emrPatientPopUp.php?pid=";
|
|
417
418
|
default:
|
|
418
|
-
return
|
|
419
|
+
return Le.visitpad + "?pid=";
|
|
419
420
|
}
|
|
420
421
|
}, la = x(
|
|
421
422
|
(e) => {
|
|
@@ -537,7 +538,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
537
538
|
return;
|
|
538
539
|
}
|
|
539
540
|
const s = new FormData();
|
|
540
|
-
s.append("name", a.name), s.append("phone", a.phone), s.append("gender",
|
|
541
|
+
s.append("name", a.name), s.append("phone", a.phone), s.append("gender", Na(a.gender)), s.append("honorific", a.honorific), s.append("patient_preferred_language", a.patient_preferred_language), s.append("age", G && G.length ? G : _l(a?.age, B) || ""), s.append("age_selector", a.age_selector), s.append("blood_group", a.blood_group), s.append("email", a.email), s.append("address", a.address), s.append("city", a.city), s.append("existing_bid_str", a.existingBidStr), s.append("pincode", a.pincode), s.append("ref_doc_id", a.refDocId), s.append("ref_doc_name", a.ref_doc_name), s.append("ref_doc_spec", a.ref_doc_spec), s.append("through_channel", a.throughChannel), s.append("care_of", a.careOf), s.append("phone_secondary", a.phoneSecondary), s.append("occupation", a.occupation), s.append("tag", a.tag), s.append("marital_status", a.marital_status), s.append("married_since", a.married_since), s.append("spouse_name", a.spouse_name), s.append("spouse_blood_group", a.spouse_blood_group), s.append("aadhar_number", a.aadhar_number), s.append("custom_fields", JSON.stringify(a.custom_fields || [])), e && s.append("reg_as_new", "1");
|
|
541
542
|
const c = Object.fromEntries(s.entries()), w = Object.fromEntries(
|
|
542
543
|
Object.entries(c).map(([te, ca]) => [te, String(ca)])
|
|
543
544
|
), j = {
|
|
@@ -565,7 +566,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
565
566
|
g,
|
|
566
567
|
O,
|
|
567
568
|
t
|
|
568
|
-
) :
|
|
569
|
+
) : He(Re(t) + d.person_role_id.toString() + Oe(t)), _();
|
|
569
570
|
return;
|
|
570
571
|
} else {
|
|
571
572
|
try {
|
|
@@ -582,7 +583,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
582
583
|
g,
|
|
583
584
|
O,
|
|
584
585
|
t
|
|
585
|
-
) :
|
|
586
|
+
) : He(Re(t) + d.person_role_id.toString() + Oe(t)), _());
|
|
586
587
|
}
|
|
587
588
|
} catch (r) {
|
|
588
589
|
console.log(r);
|
|
@@ -609,13 +610,13 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
609
610
|
try {
|
|
610
611
|
const e = {
|
|
611
612
|
"/md/viewRemoteAppointments.php": ["onlineConsultationHead", "bannerPopupWrap", "calendarViewClassDiv"],
|
|
612
|
-
[
|
|
613
|
+
[Le.consultations]: [
|
|
613
614
|
"onlineConsultationHead",
|
|
614
615
|
"newPaddingMarginEMR",
|
|
615
616
|
"bannerPopupWrap",
|
|
616
617
|
"consultations_mfe"
|
|
617
618
|
],
|
|
618
|
-
[
|
|
619
|
+
[Le.appointments]: ["appointments_mfe"]
|
|
619
620
|
}, t = window.location?.pathname || "", r = e[t];
|
|
620
621
|
if (!r?.length) return;
|
|
621
622
|
const s = document.getElementById("react_emr_mfe"), c = document.getElementById("react_curtains_mfe"), w = document.querySelector(".offlineEMR3");
|
|
@@ -683,7 +684,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
683
684
|
g,
|
|
684
685
|
O,
|
|
685
686
|
e
|
|
686
|
-
) :
|
|
687
|
+
) : He(
|
|
687
688
|
Re(e) + D?.person_role_id?.toString() + Oe(e)
|
|
688
689
|
), _();
|
|
689
690
|
} else
|
|
@@ -943,7 +944,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
943
944
|
style: {
|
|
944
945
|
boxShadow: "0px 24px 48px -12px rgba(16, 24, 40, 0.18)"
|
|
945
946
|
},
|
|
946
|
-
children:
|
|
947
|
+
children: ga.map((e) => /* @__PURE__ */ l.jsx(
|
|
947
948
|
fe,
|
|
948
949
|
{
|
|
949
950
|
className: "hfl-text-Primary-700",
|
|
@@ -1195,15 +1196,15 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
1195
1196
|
ce,
|
|
1196
1197
|
{
|
|
1197
1198
|
value: {
|
|
1198
|
-
label: a?.patient_preferred_language ?
|
|
1199
|
+
label: a?.patient_preferred_language ? Fe[a.patient_preferred_language] : "English"
|
|
1199
1200
|
},
|
|
1200
1201
|
placeholder: "English",
|
|
1201
1202
|
label: "Preferred Language",
|
|
1202
1203
|
onChange: (e) => {
|
|
1203
1204
|
i("patient_preferred_language", e.value);
|
|
1204
1205
|
},
|
|
1205
|
-
options: Object.keys(
|
|
1206
|
-
label:
|
|
1206
|
+
options: Object.keys(Fe).map((e) => ({
|
|
1207
|
+
label: Fe[e],
|
|
1207
1208
|
value: e
|
|
1208
1209
|
})),
|
|
1209
1210
|
className: "!hfl-h-[40px] hfl-w-[200px]",
|
|
@@ -1315,14 +1316,14 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
1315
1316
|
ce,
|
|
1316
1317
|
{
|
|
1317
1318
|
value: {
|
|
1318
|
-
label: a.marital_status &&
|
|
1319
|
+
label: a.marital_status && Ge.find((e) => e === a.marital_status) || ""
|
|
1319
1320
|
},
|
|
1320
1321
|
placeholder: "Marital Status",
|
|
1321
1322
|
label: "Marital Status",
|
|
1322
1323
|
onChange: (e) => {
|
|
1323
1324
|
i("marital_status", e.label);
|
|
1324
1325
|
},
|
|
1325
|
-
options:
|
|
1326
|
+
options: Ge.map((e) => ({
|
|
1326
1327
|
label: e,
|
|
1327
1328
|
value: e
|
|
1328
1329
|
})),
|
|
@@ -1369,7 +1370,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
1369
1370
|
}
|
|
1370
1371
|
)
|
|
1371
1372
|
] }),
|
|
1372
|
-
a?.marital_status !==
|
|
1373
|
+
a?.marital_status !== Ge[0] && /* @__PURE__ */ l.jsxs("div", { className: "hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-4", children: [
|
|
1373
1374
|
/* @__PURE__ */ l.jsx(
|
|
1374
1375
|
v,
|
|
1375
1376
|
{
|
|
@@ -1421,7 +1422,7 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
1421
1422
|
suffixClassName: "hfl-w-[100px]",
|
|
1422
1423
|
suffixDropdownClassName: "hfl-ml-[160px]",
|
|
1423
1424
|
options: Ml,
|
|
1424
|
-
suffixOptions:
|
|
1425
|
+
suffixOptions: _a,
|
|
1425
1426
|
handleValChange: (e) => {
|
|
1426
1427
|
i("ref_doc_name", e);
|
|
1427
1428
|
},
|
|
@@ -1865,5 +1866,5 @@ const Ve = 15, Cl = 3, Fa = ({
|
|
|
1865
1866
|
);
|
|
1866
1867
|
};
|
|
1867
1868
|
export {
|
|
1868
|
-
|
|
1869
|
+
Ja as P
|
|
1869
1870
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const e=require("./index-D5vZvm7Z.cjs");;/* empty css */const nt=require("./index-CZONCDCp.cjs"),a=require("react"),lt=require("./index.esm-BdlMQ1M7.cjs"),oe=require("./dayjs.min-BawXyS7V.cjs"),De=require("./CommonTypes-Bg9068wC.cjs"),x=require("./CommonConstant-BUchL6Rc.cjs"),c=require("./common-utils-DvxWGiX-.cjs"),B=require("./APIAction-4R25WW2g.cjs"),rt=()=>e.jsxRuntimeExports.jsx("div",{className:"hfl-h-0 hfl-w-full hfl-border-1 hfl-border-Gray-200"}),Wt=({conflicts:R,handleAddPatient:_,redirectAction:G})=>{const[C,b]=a.useState(!1);return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-mx-[20%] hfl-my-5 hfl-text-center",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:"hfl-text-Error-700",children:"Patient/s with similar information already exists in your Clinic. To continue with an existing patient click on “Continue."})}),e.jsxRuntimeExports.jsxs("table",{className:"hfl-mx-7",children:[e.jsxRuntimeExports.jsx("thead",{children:e.jsxRuntimeExports.jsxs("tr",{className:"hfl-w-full",children:[e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[40px] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"#"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Name"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Phone No"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Email"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Branch"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-rounded-tr hfl-border-b hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]"})]})}),R.map((o,d)=>e.jsxRuntimeExports.jsxs("tr",{className:"hfl-w-full hfl-border-1 hfl-border-Gray-100",children:[e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-800",children:d+1})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-800",children:o.org_person_name||o.name})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-500",children:o.org_person_phone||o.phone})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-500",children:o.org_person_email||o.email})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-500",children:"In Same Branch"})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:window.role_id=="11"&&e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"sm",textField:"Continue",className:"hfl-text-Primary-700",onClick:()=>c.goToPatientDashboard(o.person_role_id)})})]}))]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-my-7 hfl-flex hfl-items-center hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:"hfl-text-Success-800",children:"If your patient is not in the above list"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.Ku,{disabled:C,hierarchy:"Primary",size:"xl",textField:"Create As New Patient",className:"hfl-bg-Primary-700",onClick:()=>{b(!0),_(!0,G)}})})]})};function Kt(R){const{editPatient:_,setEditPatient:G,createAsNew:C,setCreateAsNew:b}=R,o=()=>_?"Primary":"Secondary",d=()=>C?"Primary":"Secondary";return e.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-6 hfl-flex hfl-h-20 hfl-w-full hfl-items-center hfl-justify-center hfl-gap-4 hfl-border-1 hfl-border-Error-200 hfl-bg-Error-25",children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text md",className:"hfl-text-Error-700",children:"Are you updating"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:o(),size:"lg",textField:"Exisitng Patient",onClick:()=>{G(!0),b(!1)}}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text md",className:"hfl-text-Error-700",children:"or creating a"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:d(),size:"lg",textField:"New Patient",onClick:()=>{b(!0),G(!1)}})]})}const Te=15,at=3,Zt=({isOpen:R,onClose:_,onSubmit:G,otpErrorMsg:C,setOtpErrorMsg:b,optHeading:o,otpSubHeading:d,veriftButtonTitle:m,resendOtp:J})=>{const[$,w]=a.useState(""),[F,p]=a.useState(Te),[se,I]=a.useState(!1),[z,Y]=a.useState(0);a.useEffect(()=>{R&&(w(""),b(""),p(Te),I(!1),Y(0))},[R,b]),a.useEffect(()=>{if(F>0&&R){const O=setInterval(()=>{p(W=>W-1)},1e3);return()=>clearInterval(O)}else F===0&&R&&I(!0)},[F,R]);const he=O=>{O.preventDefault(),String($).length===6&&G($)},de=O=>{C&&b("");const W=O.target.value;/^\d*$/.test(W)&&w(W)},fe=()=>{se&&z<at&&(J(),Y(O=>O+1),p(Te),I(!1))};return e.jsxRuntimeExports.jsxs(nt.Modal,{isOpen:R,onRequestClose:_,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",zIndex:1032},content:{maxWidth:"400px",maxHeight:"350px",display:"flex",flexDirection:"column",justifyContent:"center",padding:"24px",margin:"auto",borderRadius:"12px"}},ariaHideApp:!1,children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-end hfl-justify-end",children:e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Tertiary-Grey",icon:"Only",iconFile:"hx_close",onClick:_,size:"md",textField:""})}),e.jsxRuntimeExports.jsxs("form",{className:"hfl-z-5 hfl-relative hfl-flex hfl-h-full hfl-flex-col hfl-items-center hfl-justify-center hfl-text-center",onSubmit:he,children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Semibold",type:"Text lg",children:o}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",className:"hfl-mx-auto hfl-w-[290px] hfl-pt-2 hfl-text-Gray-500",children:d}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mx-auto hfl-max-h-[150px] hfl-w-[315px] hfl-py-5",children:e.jsxRuntimeExports.jsx(e.wu,{inputProps:{autoFocus:!0,value:$,pattern:"[0-9]+",onChange:de},size:"xs",digits:6,errorMsg:C})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mb-4 hfl-h-4",children:z>=at?e.jsxRuntimeExports.jsx(e.bi,{type:"Text sm",variant:"Regular",className:"hfl-text-Error-500",children:"Maximum resend attempts reached."}):se?e.jsxRuntimeExports.jsx(e.bi,{variant:"Semibold",type:"Text sm",className:"hfl-cursor-pointer hfl-text-Primary-700 hfl-underline",onClick:fe,children:"Resend OTP"}):e.jsxRuntimeExports.jsxs(e.bi,{type:"Text sm",variant:"Regular",className:"hfl-text-Gray-500",children:["Resend OTP in 00:",F<10?`0${F}`:F]})}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:m,disabled:String($).length<6})]})]})},Jt=R=>{const{closeModal:_,modalIsOpen:G,pref:C,variable:b}=R,{window_var:o,token:d,envName:m}=b,[J,$]=a.useState(!1),[w,F]=a.useState({}),[p,se]=a.useState(!1),[I,z]=a.useState(null),[Y,he]=a.useState(!0),[de,fe]=a.useState(!1),[O,W]=a.useState([]),[ke,K]=a.useState(!1),[P,le]=a.useState(""),[g,it]=a.useState(),[j,u]=a.useState({name:"",phone:"",age:"",gender:"",email:"",aadhar_number:""}),[re,ot]=a.useState([]),[ae,H]=a.useState({name:!1,phone:!1}),[ce,ht]=a.useState([]),[ue,dt]=a.useState([]),[pe,ft]=a.useState([]),[ct,xe]=a.useState(!1),[ut,me]=a.useState(!1),[pt,ge]=a.useState(!1),[_e,xt]=a.useState([]),[k,mt]=a.useState(!1),[s,L]=a.useState({name:"",phone:"",dob:"",gender:"",honorific:"",patient_preferred_language:C?.visit_pad_json?JSON.parse(C?.visit_pad_json)?.defaultLanguage?.rows:"",age:"",age_selector:"years",blood_group:"",email:"",address:"",city:"",existingBidStr:"",pincode:"",ref_doc_name:"",ref_doc_spec:"",temp_appnt_id:"",throughChannel:"",refDocId:"",careOf:"",phoneSecondary:"",occupation:"",tag:"",phone_otp:"",regAsNew:"",image_link:"",marital_status:"",spouse_blood_group:"",married_since:"",spouse_name:"",org_person_dob:"",aadhar_number:"",custom_fields:[]}),[gt,_t]=a.useState([]),{name:Ae,phone:A,age:N,dob:M,gender:Be}=s,[Oe,Le]=a.useState(!1),[jt,je]=a.useState(s.gender),[S,Me]=a.useState("Years"),[Ge,Fe]=a.useState(""),[Ie,be]=a.useState(!1),[bt,yt]=a.useState([]),v=(t,l,r,n)=>{yt([{id:1,title:t,description:l,type:r,duration:n}])},q=a.useRef(null),ze=a.useRef(null),[He,X]=a.useState(!1),[Et,ye]=a.useState(!1),[Rt,Ve]=a.useState(!1),[qe,Ee]=a.useState(!1),[Ue,Re]=a.useState(!1),[ne,vt]=a.useState(),D=g&&g.visit_pad_json&&c.isJson(g.visit_pad_json)&&JSON.parse(g.visit_pad_json),$e=c.debounceFn((...t)=>{const[l,r]=t;Bt(l,r)}),i=a.useCallback((t,l)=>{ye(!1),L(r=>({...r,[t]:l})),(t==="name"||t==="phone"&&l.length>=3)&&$e(t,l)},[$e]),Ct=t=>{i("throughChannel",t.value.trim()),xe(!1)},T=a.useMemo(()=>ne?.branch_details?.enable_mobile_otp=="1",[ne?.branch_details?.enable_mobile_otp]),wt=t=>{i("occupation",t.trim()),me(!1)},Pt=t=>{i("city",t.trim()),ge(!1)},Nt=t=>{const{value:l}=t.target,r=Tt(l);ht(r)},St=t=>{const{value:l}=t.target,r=kt(l);dt(r)},Dt=t=>{const{value:l}=t.target,r=At(l);xt(r)},Tt=t=>{if(pe?.length){let l=pe;return t?.length&&(l=pe.filter(r=>r.title.toLowerCase().includes(t.toLowerCase()))),l}else return[]},kt=t=>{if(x.OccupationList?.length){let l=x.OccupationList;return t?.length&&(l=x.OccupationList.filter(r=>r.toLowerCase().includes(t.toLowerCase()))),l}else return[]},At=t=>{if(x.CityList?.length){let l=x.CityList;return t?.length&&(l=x.CityList.filter(r=>r.toLowerCase().includes(t.toLowerCase()))),l}else return[]},Ye=a.useRef(null),ie=a.useRef(null),ve=a.useRef(null),We=window.location?.pathname.includes("/frontdesk");a.useEffect(()=>{const t=c.calculateDOB(s.age,S);t&&L(l=>({...l,dob:t}))},[S,s.age]);const Ce=a.useCallback(t=>{je(t),i("gender",t),u(l=>({...l,gender:""}))},[i]),Ke=t=>{(Ye.current&&!Ye.current.contains(t.target)||ie.current&&!ie.current.contains(t.target))&&H({name:!1,phone:!1}),ve.current&&!ve.current.contains(t.target)&&be(!1)},Ze=a.useCallback(()=>{le(s.image_link),K(!1),X(!1)},[s.image_link]),Je=a.useCallback(async()=>{const t=await B.getBranchPreferences("patient_config",o?.org_branch_id_for_seg?.toString()||"",{token:d,envName:m});vt(t)},[d,m,o?.org_branch_id_for_seg]);a.useEffect(()=>(document.addEventListener("mousedown",Ke),()=>{document.removeEventListener("mousedown",Ke)}),[]),a.useEffect(()=>{o.doctor_speciality==="Gynaecologist"&&!s.gender&&Ce("1")},[s.gender,Ce,o.doctor_speciality]),a.useEffect(()=>{s.image_link&&Ze(),s.honorific&&Fe(s.honorific)},[s.honorific,s.image_link,Ze]),a.useEffect(()=>{We&&Le(!0)},[We]),a.useEffect(()=>{Je()},[Je]),a.useEffect(()=>{(async()=>{it(C);try{const t=await B.getReferredByList({token:d,envName:m}),{total_ref_doc_details:l,through_channel:r}=t;l.length&&_t(c.parseReferredByDocList(l)),r.length&&ft(c.parseThroughChannelList(r))}catch(t){console.log("ERROR",t)}})()},[C,d,m]);const Bt=async(t,l)=>{const r={branch_id:o?.org_branch_id_for_seg||"",doctor_id:o?.person_id_for_seg||"",doctor_role_id:o?.doctor_role_id_for_seg||"",term:encodeURIComponent(l),limit:30},n=await B.getPatientList(r,{token:d,envName:m});if(!n){H({name:!1,phone:!1});return}!n.apiError&&Number(n.total_persons)>0?(ot(n.persons),H(t==="name"?{...ae,name:!0}:{...ae,phone:!0})):H({name:!1,phone:!1})},U=a.useCallback(async()=>{if(!T||!Y)return;Re(!0),(await B.patientConsentSendOTP(A,b)).apiError?v("OTP Failed","Unable to send OTP. Please try again.","Error",3e3):v("Success","OTP sent successfully","Success",1500)},[T,Y,A,b]),Ot=a.useCallback(async t=>{(await B.patientConsentOTPVerification(A,t,b)).apiError?v("Invalid OTP","Please enter correct OTP","Error",3e3):(mt(!0),v("Success","OTP verified successfully","Success",1500),Re(!1))},[A,b]),we=t=>{switch(t){case"Appointment":return"#Appnt";default:return""}},Pe=t=>{switch(t){case"Bill":case"Appointment":return"emrPatientPopUp.php?pid=";default:return De.EAPP_ROUTES.visitpad+"?pid="}},Lt=a.useCallback(t=>{const l=r=>{L({name:r?.name||"",phone:r?.phone_number||"",gender:r?.gender||"",honorific:r?.honorific||"",patient_preferred_language:r?.patient_preferred_language||"",ref_doc_spec:r?.ref_doc_spec||"",age:r?.age.toString()||"",age_selector:"2",dob:r.org_person_dob||"",org_person_dob:r.org_person_dob||"",blood_group:r?.blood_group||"",email:r?.email||"",address:r?.address||"",city:r?.city||"",existingBidStr:r?.org_person_bid_str||"",pincode:r?.pincode||"",ref_doc_name:r?.ref_doc_name||"",temp_appnt_id:"",throughChannel:r?.through_channel||"",refDocId:r?.ref_doc_id||"",careOf:r?.care_of||"",phoneSecondary:r?.phone_secondary||"",occupation:r?.occupation||"",tag:r?.tag||"",phone_otp:"",regAsNew:"",image_link:r?.image_link||"",marital_status:r.marital_status||"",spouse_blood_group:r.spouse_blood_group||"",married_since:r.married_since||"",spouse_name:r.spouse_name||"",aadhar_number:r.aadhar_number||"",custom_fields:r.custom_fields||[]}),je(r?.gender)};B.getPatientDetails({callback:l,payload:t,token_env:{token:d,envName:m}})},[m,d]),Z=a.useCallback((t="")=>{const l=t?.toLowerCase();return M!==""?"":N!==""&&Number(N)<0&&M===""?"Invalid Age":l==="weeks"&&N!==""&&Number(N)<5907||l==="days"&&N!==""&&Number(N)<9999||l==="months"&&N!==""&&Number(N)<1358||l==="years"&&N!==""&&Number(N)<114?"":"Invalid Age"},[M,N]),Xe=async t=>{Ve(!0);const l={branch_id:o?.org_branch_id_for_seg?.toString()||"",person_id:o?.person_id_for_seg||"",person_role_id:o?.doctor_role_id_for_seg||"",patient_role_id:t.person_role_id||""};Lt(l),H({name:!1,phone:!1}),fe(!0),F(t)},Qe=a.useCallback(()=>{let t=!0;return s.name?s.name.length<2&&(u(l=>({...l,name:"Enter at least 2 letters "})),t=!1):(u(l=>({...l,name:"Enter the Name of the Patient"})),t=!1),(g&&g.phone_number_length&&s.phone.length!==10||s.phone.length&&s.phone.length!==10)&&(u(l=>({...l,phone:"Please enter 10 digit number"})),t=!1),s.aadhar_number&&s.aadhar_number.length!=12&&(u(l=>({...l,aadhar_number:"Please enter 12 digit aadhar number"})),t=!1),Z(S).length&&M?.length===0&&(u(l=>({...l,age:"Invalid Age."})),t=!1),Be===""&&(u(l=>({...l,gender:"Select Gender"})),t=!1),j.email.length&&(s.email&&!lt.create$6().email().isValidSync(s.email)&&u(l=>({...l,email:"Email format is wrong"})),t=!1),t},[s.name,s.phone.length,s.aadhar_number,s.email,g,Z,S,M?.length,Be,j.email.length]),Q=a.useCallback(async(t,l)=>{const r=new FormData;r.append("pid",t),r.append("bidstr",l),r.append("imgData",P);const n=await B.addPatientImage(r,{token:d,envName:m});n.apiError&&v("Error",n.apiError,"Error",3e3)},[P,m,d]),et=a.useCallback(async t=>{const l=new FormData;l.append("pid",t);const r=await B.deletePatientImage(l,{token:d,envName:m});r.apiError&&v("Error",r.apiError,"Error",3e3)},[m,d]),Ne=a.useCallback(async(t,l)=>{try{if(!Qe()){v("Invalid form","Please fill in the required fields","Error",3e3);return}if(T&&!k&&!p){v("Consent Required","Please provide patient consent.","Error",3e3);return}const n=new FormData;n.append("name",s.name),n.append("phone",s.phone),n.append("gender",c.getGenderKey(s.gender)),n.append("honorific",s.honorific),n.append("patient_preferred_language",s.patient_preferred_language),n.append("age",M&&M.length?M:c.calculateDate(s?.age,S)||""),n.append("age_selector",s.age_selector),n.append("blood_group",s.blood_group),n.append("email",s.email),n.append("address",s.address),n.append("city",s.city),n.append("existing_bid_str",s.existingBidStr),n.append("pincode",s.pincode),n.append("ref_doc_id",s.refDocId),n.append("ref_doc_name",s.ref_doc_name),n.append("ref_doc_spec",s.ref_doc_spec),n.append("through_channel",s.throughChannel),n.append("care_of",s.careOf),n.append("phone_secondary",s.phoneSecondary),n.append("occupation",s.occupation),n.append("tag",s.tag),n.append("marital_status",s.marital_status),n.append("married_since",s.married_since),n.append("spouse_name",s.spouse_name),n.append("spouse_blood_group",s.spouse_blood_group),n.append("aadhar_number",s.aadhar_number),n.append("custom_fields",JSON.stringify(s.custom_fields||[])),t&&n.append("reg_as_new","1");const f=Object.fromEntries(n.entries()),y=Object.fromEntries(Object.entries(f).map(([te,Yt])=>[te,String(Yt)])),E={...y,custom_fields:JSON.parse(y.custom_fields||"[]"),doctor_role_id:o.doctor_role_id_for_seg||"",doctor_id:o.person_id_for_seg||"",org_branch_id:o.org_branch_id_for_seg||"",source:"emr",ip:""},h=await B.addPatientDetails(E,{token:d,envName:m});if(h.apiError)v("Error",h.apiError,"Error",3e3),ye(!1);else{if(t){try{P&&await Q(h.person_role_id.toString(),h.org_person_bid_str.toString())}catch(te){console.log(te)}l!=="Rx"&&D&&D?.mode_of_patient_popup?.include=="1"&&typeof window.patientPopupHandler<"u"?window.patientPopupHandler("addpatient",h.person_role_id.toString(),h.person_id.toString(),g,D,l):c.goToPage(Pe(l)+h.person_role_id.toString()+we(l)),_();return}else{try{P&&await Q(h.person_role_id.toString(),h.org_person_bid_str.toString())}catch(te){console.log(te)}ee()}h?.conflicts?.length>0?($(!0),W(h.conflicts)):_(),Array.isArray(h?.person)||v("Success","Patient Added Successfully","Success",3e3),h!=null&&!h?.conflicts?.length&&h?.person_role_id&&(l!=="Rx"&&D&&D?.mode_of_patient_popup?.include=="1"&&typeof window.patientPopupHandler<"u"?window.patientPopupHandler("addpatient",h.person_role_id.toString(),h.person_id.toString(),g,D,l):c.goToPage(Pe(l)+h.person_role_id.toString()+we(l)),_())}}catch(r){console.log(r)}},[Qe,T,k,p,s,M,S,o,d,m,D,_,P,Q,g]),Mt=()=>{try{const t={"/md/viewRemoteAppointments.php":["onlineConsultationHead","bannerPopupWrap","calendarViewClassDiv"],[De.EAPP_ROUTES.consultations]:["onlineConsultationHead","newPaddingMarginEMR","bannerPopupWrap","consultations_mfe"],[De.EAPP_ROUTES.appointments]:["appointments_mfe"]},l=window.location?.pathname||"",r=t[l];if(!r?.length)return;const n=document.getElementById("react_emr_mfe"),f=document.getElementById("react_curtains_mfe"),y=document.querySelector(".offlineEMR3");[n,f,y].forEach(E=>{E&&E.classList.contains("hidden")&&E.classList.remove("hidden")});for(const E of r){const h=document.getElementsByClassName(E);h.length&&!h[0].classList.contains("hidden")&&h[0].classList.add("hidden")}}catch(t){console.error("Error in manipulating DOM:",t)}},tt=a.useCallback(async t=>{const l={patient_id:w?.person_id,honorific:s?.honorific,name:s?.name,gender:s?.gender,age:s?.age,org_person_dob:s?.dob?s.dob:c.calculateDate(s?.age,S)||void 0,phone_number:s?.phone,email:s?.email,blood_group:s?.blood_group,patient_preferred_language:s?.patient_preferred_language,address:s?.address,city:s?.city,pincode:s?.pincode,org_person_bid_str:s?.existingBidStr,ref_doc_name:s?.ref_doc_name,ref_doc_spec:s?.ref_doc_spec,through_channel:s?.throughChannel,ref_doc_id:s?.refDocId,care_of:s?.careOf,phone_secondary:s?.phoneSecondary,occupation:s?.occupation,tag:s?.tag,marital_status:s.marital_status,married_since:s.married_since,spouse_name:s.spouse_name,spouse_blood_group:s.spouse_blood_group,image_link:s?.image_link,remote_consultation_id:"0",oc_status:!1,aadhar_number:s?.aadhar_number,person_role_id:o.doctor_role_id_for_seg||"",person_id:o.person_id_for_seg||"",branch_id:o.org_branch_id_for_seg||""},r=await B.updatePatientDetails(l,{token:d,envName:m});if(p){r&&ye(!1);const{message:n,status:f}=r||{};if(f){v("Patient Edited","Patient Edited Successfully","Success",1500);try{s?.image_link&&!P?et(w?.person_role_id):P&&qe&&(Ee(!1),await Q(w?.person_role_id,s?.existingBidStr))}catch(y){console.log(y)}t!=="Rx"&&D&&D?.mode_of_patient_popup?.include=="1"&&typeof window.patientPopupHandler<"u"?window.patientPopupHandler("addpatient",w?.person_role_id,w?.person_id,g,D,t):c.goToPage(Pe(t)+w?.person_role_id?.toString()+we(t)),_()}else v("Patient Not Edited",n||"Patient Not Edited","Failure",1500)}},[w?.person_id,w?.person_role_id,s,S,o,d,m,p,D,_,P,qe,et,Q,g]),Gt=async()=>{try{K(!1);const t=await navigator.mediaDevices.getUserMedia({video:!0});q.current&&(q.current.srcObject=t),X(!0)}catch(t){console.error("Error accessing camera:",t)}},Ft=()=>{const t=ze.current,l=q.current;if(t&&l){t.width=l.videoWidth,t.height=l.videoHeight;const r=t.getContext("2d");if(r){r.drawImage(l,0,0,t.width,t.height);const n=t.toDataURL();le(n),K(!1),X(!1),ee()}}},It=()=>{document.getElementById("upload-local-file")?.click()},zt=t=>{K(!1),X(!1);const l=t.target.files?.[0];if(!l)return;const r=new FileReader;r.readAsDataURL(l),r.onloadend=()=>{const n=r.result;n&&le(n.toString()),t.target.value=""}},st=()=>{K(!0),le(""),X(!1),ee()},ee=()=>{if(q.current){const t=q.current.srcObject;t instanceof MediaStream&&t.getTracks().forEach(l=>l.stop()),q.current.srcObject=null}},Ht=a.useMemo(()=>[...ne?.patient_config?.custom_fields||[]].sort((r,n)=>r.sort-n.sort).map(r=>{const n=s.custom_fields?.find(f=>f.id===r.id);return{...r,value:n?.value||"",title:n?.value?n?.title:r.title}}),[ne?.patient_config?.custom_fields,s.custom_fields]),Se=(t,l,r)=>{L(n=>{const f=n.custom_fields?.length?n.custom_fields.map(E=>E.id===t?{...E,value:r}:E):[];return f.some(E=>E.id===t)||f.push({id:t,value:r,title:l}),{...n,custom_fields:f}})},Vt=()=>Ht?.map(t=>{const{id:l,type:r,value:n,title:f}=t||{};if(!l||!r||!f)return null;switch(r){case"text":return e.jsxRuntimeExports.jsx(e.Pi,{label:f,labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:n||"",placeholder:`Enter ${f}`,onChange:y=>{Se(l,f,y.target.value)}},width:"22em"},l);case"date":return e.jsxRuntimeExports.jsx(e.ZC,{label:f,placeholder:`Select ${f}`,selectDate:n?new Date(n):null,dateVar:y=>{Se(l,f,y.toDateString()||"")},isborderRequired:!0,width:"22em",clearDate:y=>{Se(l,f,y)},openUp:!0,backSpaceClearDate:!0},l);default:return null}}),V=a.useCallback(t=>{z(t),p?tt(t):Ne(!1,t)},[p,tt,Ne]),qt=a.useCallback(()=>{if(T&&!p&&!k){z("Rx"),U();return}V("Rx")},[T,p,k,U,V]),Ut=a.useCallback(()=>{if(T&&!p&&!k){z("Bill"),U();return}V("Bill")},[T,p,k,U,V]),$t=a.useCallback(()=>{if(T&&!p&&!k){z("Appointment"),U();return}V("Appointment")},[T,p,k,U,V]);return a.useEffect(()=>{k&&I&&(V(I),z(null))},[k,I,V]),e.jsxRuntimeExports.jsx(nt.Modal,{isOpen:G,onRequestClose:()=>{ee(),_()},shouldCloseOnOverlayClick:!1,style:{content:{zIndex:1030,padding:"0px",maxWidth:"840px",maxHeight:"624px",margin:"auto",borderRadius:"12px"},overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",zIndex:1030}},children:e.jsxRuntimeExports.jsxs("div",{id:"add-patient-modal",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-h-16 hfl-w-full hfl-flex-row hfl-items-center hfl-justify-between hfl-border-b-1 hfl-border-b-Gray-200 hfl-px-6",id:"add-patient-header","data-qa":"testid_addPatient",children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text xl",children:J?"Patient(s) with Same phone number or Email":"Add New Patient"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-items-center",children:e.jsxRuntimeExports.jsx("span",{className:"hx_close hfl-ml-4 hover:hfl-cursor-pointer",onClick:()=>{ee(),_()}})})]}),J?e.jsxRuntimeExports.jsx(Wt,{conflicts:O,handleAddPatient:Ne,redirectAction:I,manipulateExistingDOM:Mt}):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",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Patient Name*",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",prefix:e.jsxRuntimeExports.jsxs("div",{ref:ve,className:"-hfl-ml-2 hfl-flex hfl-w-16 hfl-items-center hfl-justify-between hfl-bg-Gray-50",onClick:()=>be(t=>!t),children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:Ge}),!Ge.length&&e.jsxRuntimeExports.jsx("div",{className:`${Ie?"hx_up":"hx_down"} -hfl-mr-2`})]}),errorMsg:j.name?j.name:void 0,inputProps:{type:"text",value:Ae,placeholder:"Enter Name",onChange:t=>{i("name",t.target.value)},onBlur:()=>{const t=!(s.name.length>0);s.name.length>0&&s.name.length<2&&!Rt?u(l=>({...l,name:"Enter at least 2 letters "})):u(l=>({...l,name:t?"Enter the Name of the Patient":""})),Ve(!1),H({name:!1,phone:!1})}},start_icon:"hx_person",width:"16em"}),Ie&&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:x.HonorificList.map(t=>e.jsxRuntimeExports.jsx(e.ki,{className:"hfl-text-Primary-700",label:t.label,onSelect:()=>{Fe(t.label),be(!1),je(t.gender),i("honorific",t.label),i("gender",t.gender),L(l=>({...l,gender:t.gender,honorific:t.label}))}}))}),ae.name&&Ae.length>0&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-absolute hfl-z-[1000] hfl-mt-[2px] hfl-flex hfl-w-[350px] hfl-flex-col hfl-space-y-2 hfl-rounded-lg hfl-border-1 hfl-border-Gray-300 hfl-bg-White hfl-px-[16px] hfl-py-[10px]",style:{boxShadow:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)"},ref:ie,children:[e.jsxRuntimeExports.jsx(e.bi,{className:"hfl-text-Primary-600",variant:"Regular",type:"Text md",children:"Existing Patients"}),re&&re?.slice(0,7)?.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-between hfl-gap-[36px]",onMouseDown:()=>Xe(t),children:[e.jsxRuntimeExports.jsxs(e.bi,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:[t?.org_person_name?.length>13?t?.org_person_name?.substring(0,11)+"...":t?.org_person_name,`(${t.ageStr||c.calculateAge(t.age)}, ${c.getGender(parseInt(t.org_person_gender.toString()))})`]}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:t.org_person_phone||""})]},t?.person_role_id))]})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-end hfl-gap-3",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:`Phone Number ${g&&g.phone_number_length?"*":""}`,labelColor:"hfl-text-Gray-600",labelSize:"Text sm",errorMsg:j.phone?j.phone:void 0,inputProps:{maxLength:10,value:A,placeholder:"Enter Number",onChange:t=>{i("phone",t.target.value.replace(/[^0-9]/g,""))},onBlur:()=>{const{isError:t=!1,msg:l=""}=g&&g.phone_number_length||A?c.validateMobileNo(A):{};u(r=>({...r,phone:t?l:""})),H({name:!1,phone:!1})}},width:"21em",start_icon:"hx_phone"}),ae.phone&&A.length>0&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-absolute hfl-z-[1000] hfl-mt-[2px] hfl-flex hfl-w-[350px] hfl-flex-col hfl-space-y-2 hfl-rounded-lg hfl-border-1 hfl-border-Gray-300 hfl-bg-White hfl-px-[24px] hfl-py-[10px]",style:{boxShadow:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)"},ref:ie,children:[e.jsxRuntimeExports.jsx(e.bi,{className:"hfl-text-Primary-600",variant:"Regular",type:"Text md",children:"Existing Patients"}),re&&re?.slice(0,7)?.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-between hfl-gap-[36px]",onMouseDown:()=>Xe(t),children:[e.jsxRuntimeExports.jsxs(e.bi,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:[t.org_person_name?.length>13?t.org_person_name?.substring(0,11)+"...":t.org_person_name,`(${t.ageStr||c.calculateAge(t.age)}, ${c.getGender(parseInt(t.org_person_gender.toString()))})`]}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:t.org_person_phone})]},t?.person_role_id))]})]})})]}),T&&!p&&Ue&&e.jsxRuntimeExports.jsx(Zt,{isOpen:Ue,onClose:()=>Re(!1),onSubmit:t=>Ot(t),optHeading:"Verify with a OTP",otpSubHeading:`Please enter the OTP shared on ${A}`,veriftButtonTitle:"Verify OTP",resendOtp:U,otpErrorMsg:"",setOtpErrorMsg:()=>{}}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-space-x-2 hfl-pt-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-h-[40px] hfl-space-y-1",children:[e.jsxRuntimeExports.jsx(e.bi,{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-[40px] hfl-w-44 ${j.gender?"hfl-border-Error-300":""}`,options:[{label:"M",value:"0"},{label:"F",value:"1"},{label:"Other",value:"2"}],value:jt,onChange:t=>Ce(t),disabled:!1}),!!j.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:j.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.tj,{label:"Age or DOB*",className:"hfl-w-20",classNamedoubleInput:"hfl-relative",suffixClassName:"hfl-w-16 hfl-border-0",suffixDropdownClassName:"hfl-ml-[80px]",input1value:s.age,input2value:S,end_icon:"hx_down",errorMsg:j.age?j.age:void 0,inputProps:{type:"number",min:0,maxLength:3,placeholder:"Age",onChange:t=>{i("age",t.target.value.replace(/[^0-9]/g,"")),L(l=>({...l,dob:""}))},onBlur:()=>{u(t=>({...t,age:Z(S)}))}},onlySuffixDropdownItemsAllowed:!0,suffixInputProps:{placeholder:"Select format"},suffixOptions:[{label:"Years",value:"years"},{label:"Weeks",value:"weeks"},{label:"Months",value:"months"},{label:"Days",value:"days"}],handleValChange:t=>{i("age",t),u(l=>({...l,age:Z(S)}))},handleSuffixValChange:t=>{Me(t),u(l=>({...l,age:Z(t)}))},onSuffixDropdownClick:t=>{Me(t.label),L(l=>({...l,age_selector:t.value,dob:""})),u(l=>({...l,age:Z(t.value)}))}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-[24px] hfl-space-y-1",children:e.jsxRuntimeExports.jsx(e.ZC,{className:"hfl-relative",placeholder:"DOB",width:"8em",height:"!hfl-h-[40px]",label:"",labelSize:"Text sm",labelColor:"hfl-text-Gray-700",selectDate:s?.dob&&c.isValidDate(new Date(s?.dob))?new Date(oe.dayjs(new Date(s?.dob)).format("DD-MMM-YYYY")):"",dateVar:t=>{L(l=>({...l,dob:oe.dayjs(t).format("YYYY-MM-DD"),age:""})),u(l=>({...l,age:""}))},isborderRequired:!0,maxDate:new Date})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-1",children:e.jsxRuntimeExports.jsx(e.Ap,{value:{label:s?.patient_preferred_language?x.DefinedLanguages[s.patient_preferred_language]:"English"},placeholder:"English",label:"Preferred Language",onChange:t=>{i("patient_preferred_language",t.value)},options:Object.keys(x.DefinedLanguages).map(t=>({label:x.DefinedLanguages[t],value:t})),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-pb-6 hfl-pt-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-6/12 hfl-flex-col ",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"City",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.city,placeholder:"Enter City",onChange:t=>{i("city",t.target.value),ge(!0),Dt(t)},onBlur:t=>{t.stopPropagation(),ge(!1)}},width:23.5+"em"}),pt&&_e&&_e.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:_e.map(t=>e.jsxRuntimeExports.jsx(e.ki,{label:t,className:"hfl-text-Primary-700",onSelect:()=>Pt(t)}))})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-pt-4",children:e.jsxRuntimeExports.jsx(e.Pi,{className:"hfl-mb-3",label:"Pin",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.pincode,placeholder:"Enter Pin",onChange:t=>{i("pincode",t.target.value)}},width:22.5+"em"})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-flex-col",style:{height:"100%"},children:e.jsxRuntimeExports.jsx(e.bu,{className:"hfl-w-[355px]",label:"Address",inputProps:{value:s?.address,placeholder:"Enter Address",onChange:t=>{i("address",t.target.value)}},isDynamicHeight:!0,"data-qa":"enter-address"})})]}),de?e.jsxRuntimeExports.jsx(Kt,{setEditPatient:se,editPatient:p,createAsNew:Y,setCreateAsNew:he}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),Oe?e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-stroke-Gray-200 hfl-stroke-1 hfl-pb-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.bi,{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-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:s.marital_status&&x.MARITAL_STATUS.find(t=>t===s.marital_status)||""},placeholder:"Marital Status",label:"Marital Status",onChange:t=>{i("marital_status",t.label)},options:x.MARITAL_STATUS.map(t=>({label:t,value:t})),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:s?.married_since&&c.isValidDate(new Date(s?.married_since))?new Date(oe.dayjs(new Date(s?.married_since)).format("DD-MMM-YYYY")):"",dateVar:t=>{L(l=>({...l,married_since:oe.dayjs(t).format("YYYY-MM-DD")}))},isborderRequired:!0,maxDate:new Date})})]}),e.jsxRuntimeExports.jsx(e.Ap,{label:"Blood Group",placeholder:"Enter blood group",value:{label:s.blood_group&&x.bloodGroups.find(t=>t.value===s.blood_group)?.label||"Blood group"},onChange:t=>{i("blood_group",t.value)},options:x.bloodGroups,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"blood-group"})]}),s?.marital_status!==x.MARITAL_STATUS[0]&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-4",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Spouse Name",start_icon:"hx_person",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s.spouse_name,placeholder:"Enter Spouse Name",onChange:t=>{i("spouse_name",t.target.value)}},width:"21em"}),e.jsxRuntimeExports.jsx(e.Ap,{label:"Spouse Blood Group",placeholder:"Enter blood group",value:{label:s.spouse_blood_group?x.bloodGroups.find(t=>t.value===s.spouse_blood_group)?.label||"Spouse Blood group":"Blood group"},onChange:t=>{i("spouse_blood_group",t.value)},options:x.bloodGroups,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"blood-group"})]})]}),e.jsxRuntimeExports.jsx(rt,{}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-6",children:e.jsxRuntimeExports.jsx(e.tj,{classNameDatePicker:"hfl-relative",classNamedoubleInput:"hfl-relative",label:"Referred By",input1value:s.ref_doc_name,input2value:s.ref_doc_spec,end_icon:"hx_down",inputProps:{placeholder:"Doctor Name"},suffixInputProps:{placeholder:"Speciality"},className:"hfl-w-48",suffixClassName:"hfl-w-[100px]",suffixDropdownClassName:"hfl-ml-[160px]",options:gt,suffixOptions:x.SpecialityList,handleValChange:t=>{i("ref_doc_name",t)},handleSuffixValChange:t=>{i("ref_doc_spec",t.value)},onDropdownClick:t=>{i("ref_doc_name",t.doctor_name),i("refDocId",t.doctor_id),i("ref_doc_spec",t.specialist)},onSuffixDropdownClick:t=>{i("ref_doc_spec",t.value)}})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-pb-6 hfl-pt-4",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Existing ID (if any)",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.existingBidStr,placeholder:"Enter ID",onChange:t=>{i("existingBidStr",t.target.value)}},width:"23em"}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Email",showEmailSuggestions:!0,labelColor:"hfl-text-Gray-600",errorMsg:j.email?j.email:void 0,labelSize:"Text sm",start_icon:"hx_mail",inputProps:{value:s.email,placeholder:"Enter Email",onChange:t=>{i("email",t.target.value.trim())},onBlur:t=>{t.target.value&&!lt.create$6().email().isValidSync(t.target.value)?u(l=>({...l,email:"Email format is wrong"})):u(l=>({...l,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",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Channel (How did the patient hear about you?)",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.throughChannel,placeholder:"Enter Channel",onChange:t=>{i("throughChannel",t.target.value),xe(!0),Nt(t)},onBlur:t=>{t.stopPropagation(),xe(!1)}},width:"22em"}),ct&&ce&&ce.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:ce.map(t=>{const{title:l,...r}=t;return e.jsxRuntimeExports.jsx(e.ki,{label:l,className:"hfl-text-Primary-700",...r,onSelect:()=>Ct({value:t.value})},t.value)})})]}),e.jsxRuntimeExports.jsx(e.Pi,{label:"C/O",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.careOf,placeholder:"Enter C/O",onChange:t=>{i("careOf",t.target.value)}},width:"22em"})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Occupation",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.occupation,placeholder:"Enter Occupation",onChange:t=>{i("occupation",t.target.value),me(!0),St(t)},onBlur:t=>{t.stopPropagation(),me(!1)}},width:"22em"}),ut&&ue&&ue.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:ue.map(t=>e.jsxRuntimeExports.jsx(e.ki,{label:t,className:"hfl-text-Primary-700",onSelect:()=>wt(t)}))})]}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Tag",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s.tag,placeholder:"Enter Tag",onChange:t=>{i("tag",t.target.value)}},width:"22em"}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Mobile 2",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s.phoneSecondary,maxLength:10,placeholder:"Enter Secondary Number",onChange:t=>{i("phoneSecondary",t.target.value.replace(/[^0-9]/g,""))}},width:"22em"}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Aadhar Number",labelColor:"hfl-text-Gray-600",errorMsg:j.aadhar_number?j.aadhar_number:void 0,labelSize:"Text sm",inputProps:{value:s.aadhar_number,placeholder:"Aadhar Card Number",maxLength:12,onChange:t=>{i("aadhar_number",t.target.value)},onBlur:()=>{u(t=>({...t,aadhar_number:s.aadhar_number&&s.aadhar_number.length!=12?"Please enter 12 digit aadhar number":""}))}},width:"22em"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-grid hfl-grid-cols-2 hfl-gap-x-11 hfl-gap-y-6",children:Vt()})]}),e.jsxRuntimeExports.jsx(rt,{}),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-[153px] hfl-w-[200px] hfl-items-center hfl-justify-center
|
|
2
|
+
hfl-rounded-3xl hfl-border-4
|
|
3
|
+
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
|
|
4
|
+
${ke?"":"hfl-hidden"}`,children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Camera",className:"hfl-mb-2",onClick:Gt,icon:"Left",iconFile:"hx_camera"}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("input",{id:"upload-local-file",type:"file",style:{display:"none"},accept:"image/*",onChange:zt}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"lg",textField:"Upload",icon:"Left",iconFile:"hx_image-add",onClick:It})]})]}),e.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-flex
|
|
5
|
+
${He?"":"hfl-hidden"}`,children:[e.jsxRuntimeExports.jsx("canvas",{ref:ze,style:{display:"none"}}),e.jsxRuntimeExports.jsx("video",{ref:q,className:"hfl-object-fit hfl-h-full hfl-w-full hfl-rounded-3xl",autoPlay:!0}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-absolute hfl-bottom-0 hfl-left-0 hfl-right-0 hfl-flex hfl-justify-around",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Cancel",className:"hfl-mb-2 hfl-bg-Error-600 hover:hfl-bg-Error-700",onClick:st}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Capture",className:"hfl-mb-2 hfl-bg-Primary-600",onClick:Ft})]})]}),e.jsxRuntimeExports.jsx("div",{className:ke||P||He?"hfl-hidden":"",onClick:()=>{Ee(!0),K(!0)},"data-qa":"profile-img",children:e.jsxRuntimeExports.jsxs("svg",{width:"76",height:"72",viewBox:"0 0 76 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M75.375 26.0477V57.1667C75.6016 59.1092 75.3857 61.0778 74.7434 62.925C74.1011 64.7722 73.0491 66.4501 71.6663 67.8329C70.2834 69.2158 68.6055 70.2678 66.7583 70.9101C64.9111 71.5524 62.9425 71.7683 61 71.5417H15C13.0575 71.7683 11.0889 71.5524 9.2417 70.9101C7.3945 70.2678 5.71661 69.2158 4.33373 67.8329C2.95086 66.4501 1.89887 64.7722 1.25659 62.925C0.614305 61.0778 0.398381 59.1092 0.624996 57.1667V18.8333C0.398381 16.8908 0.614305 14.9222 1.25659 13.075C1.89887 11.2278 2.95086 9.54994 4.33373 8.16707C5.71661 6.7842 7.3945 5.73221 9.2417 5.08992C11.0889 4.44764 13.0575 4.23172 15 4.45833H48.7333C48.9029 4.46277 49.0695 4.50469 49.221 4.58109C49.3725 4.65748 49.5052 4.76645 49.6096 4.90019C49.7141 5.03393 49.7876 5.18911 49.825 5.35462C49.8624 5.52013 49.8626 5.69187 49.8258 5.8575C48.9214 10.3365 49.831 14.9913 52.355 18.8004C54.879 22.6094 58.8112 25.2613 63.2885 26.1742C66.8321 26.8826 70.5088 26.4602 73.7995 24.9667C73.975 24.8968 74.1649 24.8712 74.3526 24.8921C74.5403 24.9131 74.72 24.9799 74.8757 25.0868C75.0314 25.1936 75.1584 25.3372 75.2455 25.5048C75.3326 25.6724 75.3771 25.8588 75.375 26.0477Z",fill:"#396CE8"}),e.jsxRuntimeExports.jsx("path",{d:"M69.2877 46.2877L52.2217 29.2217C51.4989 28.5016 50.5202 28.0973 49.5 28.0973C48.4798 28.0973 47.5011 28.5016 46.7783 29.2217L27.8417 48.1583C27.4834 48.5095 27.0017 48.7062 26.5 48.7062C25.9983 48.7062 25.5166 48.5095 25.1583 48.1583L21.555 44.555C20.8322 43.835 19.8536 43.4307 18.8333 43.4307C17.8131 43.4307 16.8344 43.835 16.1117 44.555L6.71233 53.9543C6.49661 54.1698 6.37527 54.4621 6.375 54.767V57.1667C6.375 63.2233 8.94333 65.7917 15 65.7917H61C67.0567 65.7917 69.625 63.2233 69.625 57.1667V47.1003C69.6247 46.7954 69.5034 46.5031 69.2877 46.2877Z",fill:"#396CE8"}),e.jsxRuntimeExports.jsx("path",{d:"M22.6667 31.2917C22.0374 31.2939 21.4139 31.1722 20.8317 30.9335C20.2494 30.6948 19.7199 30.3438 19.2734 29.9004C18.3715 29.005 17.8623 27.7881 17.8577 26.5172C17.8532 25.2464 18.3536 24.0258 19.249 23.124C20.1444 22.2221 21.3613 21.7129 22.6322 21.7083H22.6667C23.9375 21.7083 25.1563 22.2132 26.0549 23.1118C26.9535 24.0104 27.4583 25.2292 27.4583 26.5C27.4583 27.7708 26.9535 28.9896 26.0549 29.8882C25.1563 30.7868 23.9375 31.2917 22.6667 31.2917Z",fill:"#396CE8"}),e.jsxRuntimeExports.jsx("path",{d:"M74.5317 7.21833L68.7817 1.46833C68.2421 0.930873 67.5116 0.629108 66.75 0.629108C65.9884 0.629108 65.2579 0.930873 64.7183 1.46833L58.9683 7.21833C58.4605 7.76333 58.184 8.48418 58.1972 9.229C58.2103 9.97382 58.512 10.6845 59.0388 11.2112C59.5655 11.738 60.2762 12.0397 61.021 12.0528C61.7658 12.066 62.4867 11.7895 63.0317 11.2817L63.875 10.4422V18.8333C63.875 19.5958 64.1779 20.3271 64.7171 20.8663C65.2562 21.4054 65.9875 21.7083 66.75 21.7083C67.5125 21.7083 68.2438 21.4054 68.7829 20.8663C69.3221 20.3271 69.625 19.5958 69.625 18.8333V10.4422L70.4683 11.2817C71.0133 11.7895 71.7342 12.066 72.479 12.0528C73.2238 12.0397 73.9345 11.738 74.4612 11.2112C74.988 10.6845 75.2897 9.97382 75.3028 9.229C75.316 8.48418 75.0395 7.76333 74.5317 7.21833Z",fill:"#396CE8"})]})}),e.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-h-full hfl-w-full
|
|
6
|
+
${P?"":"hfl-hidden"}`,children:[e.jsxRuntimeExports.jsx("img",{src:P,alt:"ProfilePicturePreview",className:"hfl-h-full hfl-w-full hfl-rounded-3xl hfl-object-cover"}),e.jsxRuntimeExports.jsx("div",{className:`hfl-absolute hfl-right-2 hfl-top-2 hfl-flex hfl-h-[40px]
|
|
7
|
+
hfl-w-[40px] hfl-cursor-pointer hfl-items-center hfl-justify-center hfl-rounded-full hfl-bg-White`,onClick:()=>{Ee(!0),st()},children:e.jsxRuntimeExports.jsx("i",{className:"hx_delete hfl-text-[22px]"})})]})]})})]}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-items-center hfl-justify-center",children:[e.jsxRuntimeExports.jsxs(e.bi,{variant:"Regular",type:"Text md",children:["If you want to add more details,"," "]}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text md",className:"hfl-cursor-pointer hfl-text-Primary-700",onClick:()=>{Le(!0)},children:"Click Here"})]})]}),e.jsxRuntimeExports.jsx("div",{className:`${Oe?"":"hfl-flex hfl-w-full"} hfl-sticky hfl-bottom-0 hfl-bg-White`,children:J?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-h-[118px] hfl-w-full hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-1",style:{boxShadow:"-3px -1px 4px rgba(0, 0, 0, 0.25)"},children:[window.location?.href.indexOf("/frontdesk")==-1&&e.jsxRuntimeExports.jsx(e.Ku,{disabled:Et,hierarchy:"Primary",size:"sm",textField:"Add & Create Rx",className:"hfl-bg-Primary-600",onClick:qt}),e.jsxRuntimeExports.jsx("div",{children:window.location?.href.indexOf("/frontdesk")==-1&&e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",children:"or"})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-start hfl-gap-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"sm",textField:"Add & Create Bill",className:"hfl-w-[190px] hfl-flex-1 hfl-justify-center hfl-text-Primary-700",onClick:Ut}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"sm",textField:"Add & Create Appointment",className:"hfl-w-[190px] hfl-flex-1 hfl-justify-center hfl-text-Primary-700",onClick:$t})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-[100]",children:e.jsxRuntimeExports.jsx(e.qh,{toastList:bt})})]})})]})})};exports.PatientAddEdit=Jt;
|