PageSourceSearch

https://smenarnabitcoin.cz/assets/EditPatientInAppointment-C5OiQZko.js

js smenarnabitcoin.cz collected 2026-10-06 19:43:28 UTC 3,633 bytes, 1 lines download raw bytes

1import{f as T,E as z,r as a,j as o,P as M,G as B,H as G,I as j,cd as D,c0 as J,e as x,a5 as V,fa as $,s as k}from"./index-BiR4tHPa.js";import{E as q}from"./EditPatientHeader-C15xyG6N.js";import{A as K}from"./AddEditPatient-DBM4pn2a.js";import{p as Q}from"./style-g158jnvn.js";import"./editPatientHeader.module-CTIPAsEB.js";import"./SearchableSelect-Q4yLFKo6.js";import"./addEditPatient.module-DDGDyjuN.js";import"./MaterialUiDatePicker-vRODdoO2.js";import"./useMobilePicker-ChVQmibs.js";import"./useThemeProps-Bm86sZ3E.js";import"./AdapterDayjs-C_KT9Vl8.js";import"./dateViewRenderers-BEc2yG4Q.js";import"./Accordion-BluZk8dt.js";const ce=()=>{var f,P,y,w,_;const{t:m}=T("patientsDetails"),{id:p}=z(),[i,E]=a.useState(""),v=async()=>{try{const t=await D(p);console.log(t,"single old patient response"),E(t.data.document[0].patient_id)}catch(t){console.log(t,"single old patient error")}};a.useEffect(()=>{v()},[]);const[e,u]=a.useState({database_name:"yb_db",collection_name:"patient_details",new_data:{name:"",email:"",phone:"",gender:"",dob:"",age:"",bloodGroup:"",diagnosis:[],address:{houseNo:"",street:"",city:"",district:"",state:"",zipCode:"",country:""},photo:{photoId:"",image_path:"",url:"",timestamp:""},dateOfJoining:"",medicalAlert:"",emergencyContact:{name:"",relationship:"",phone:""},insurance:{policyNumber:"",provider:"",policyInfo:""},medicalHistory:{conditions:[],surgeries:[],allergies:[],medications:[]},familyMedicalHistory:{father:[],mother:[]},primaryCarePhysician:{name:"",phone:"",clinic:""},specialists:[{name:"",specialty:"",phone:""}],immunizationRecords:[{vaccine:"",date:""}],consentForms:[{formId:"",data:"",type:"",status:""}],reference:{source:"",name:""},status:"",previousId:"",notes:""}}),[h,I]=a.useState({name:"",phone:""}),[N,c]=a.useState(!1),[L,l]=a.useState(!1);let g={phoneLength:""};const[A,C]=a.useState(g),F=t=>{const s=String(t||"").replace(/[^\d+]/g,"").replace(/^\+/,"");if(!s)return!1;try{const n=Q(`+${s}`),r=n!=null&&n.nationalNumber?String(n.nationalNumber).length:0;return(n==null?void 0:n.country)==="IN"?r===10:r>=6&&r<=15}catch{const n=s.replace(/\D/g,"").length;return n>=8&&n<=15}},H=async()=>{l(!0);try{const t=await J(i,"","");console.log(t,"get single patient response"),u({...e,new_data:{...t.data.document[0]}}),l(!1)}catch(t){console.log(t,"get single patient error"),l(!1)}},O=async t=>{var r,b,S;t.preventDefault();let s=!1;const n={...g};
1if(F((r=e==null?void 0:e.new_data)==null?void 0:r.phone)||(n.phoneLength="Please enter a valid phone number",s=!0,x("Please enter a valid phone number")),C(n),!s){c(!0),t.preventDefault();try{const d=await V((b=e==null?void 0:e.new_data)==null?void 0:b._id,e==null?void 0:e.new_data),R=await $((S=e==null?void 0:e.new_data)==null?void 0:S.id,h);k(R.data.message),console.log(d,"edit patient response"),c(!1)}catch(d){console.log(d,"edit patient response"),c(!1),x("Something went wrong !")}}};return a.useEffect(()=>{I({name:e.new_data.name,phone:e.new_data.phone})},[e]),a.useEffect(()=>{i!==""&&H()},[i]),console.log(e,"patient data"),console.log(h,"phone name data"),o.jsxs("div",{children:[o.jsx(M,{activeMenu:m("editAppointment"),motherMenu:m("manageAppointment")}),o.jsx(B,{children:o.jsx(G,{children:o.jsx(j,{children:o.jsxs(j.Body,{children:[o.jsx(q,{id:p,patientId:i,patientData:e.new_data}),o.jsx(K,{data:e,setData:u,handleSubmit:O,phone:(P=(f=e==null?void 0:e.new_data)==null?void 0:f.phone)==null?void 0:P.slice(2),emergencyPhone:(_=(w=(y=e==null?void 0:e.new_data)==null?void 0:y.emergencyContact)==null?void 0:w.phone)==null?void 0:_.slice(2),btnLoader:N,loader:L,errors:A})]})})})})]})};export{ce as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.