uawdijnntqw1x1x1
IP : 216.73.216.93
Hostname : panel.codeskitter.com
Kernel : Linux panel.codeskitter.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
Disable Function : apache_child_terminate, apache_note, apache_setenv, define_syslog_variables, dl, link, opcache_get_status, openlog, pcntl_exec, pcntl_fork, pcntl_setpriority, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid
OS : Linux
PATH:
/
home
/
users
/
unlimited
/
www
/
admin.medimeet.codeskitter.site
/
8dfc6
/
..
/
assets
/
Update-DZdUlnjv.js
/
/
import{Q as oe,r as F,w as ce,j as e,R as _e,B as c,x as q,F as ve,J as Z,y as A,C as ne,T as ie,E as _,G as ze,L as Te,aD as Re,X as Ae,H as N,M as Fe,P as K}from"./index-f5FVPPWf.js";import{u as he,L as Ie,h as ke,F as h,f as p}from"./index.esm-CxKpqEdJ.js";import{u as ee}from"./SettingData-HUsgVeqA.js";import{I as Ee,a as Ne}from"./IsdModal-7Szgl44l.js";import{i as me}from"./image-DDwLQVjO.js";import{P as de}from"./PatientFiles-CJC2dLX-.js";import{t as $e}from"./today-D_vLUvRX.js";import{T as Be,F as De}from"./index-NjlW3JBs.js";import{e as Le}from"./index-D-rZ_zLU.js";import{N as se,S as l,C as qe,b as C,R as Ve,D as Oe,g as Me,j as Ue,k as We,c as Qe,d as Ge,e as M,f as He,h as U,T as le}from"./Dashboard-QYea_GjR.js";import{g as Ye}from"./CancellationReqBadge-kpviUzow.js";import{A as Je}from"./AddNewAppointment-BJ7pZqHM.js";import{u as W,B as Ke,j as Xe}from"./HasPermission-D75jcuOi.js";import{u as xe}from"./UseSearchFilter-7ev3Ltxt.js";import{F as n,I as x,d as m}from"./input-aKY8cD2r.js";import{u as ae,I as V,A as Ze}from"./index-B8iLT9XL.js";import{B as $}from"./visually-hidden.style-BrEqndXz.js";import{T as es,a as ss,b as X,c as w,d as as,e as S}from"./tr-SHTCPR9-.js";import{D as B}from"./use-clickable-DJbYv-Vn.js";import{C as D,a as L}from"./card-body-U833268K.js";import{S as ts}from"./select-Dt5dI57S.js";import{I as rs}from"./input-group-BHnguFbm.js";import{V as ns}from"./v-stack-BQpqK5ry.js";import"./DeletePatientFile-DQM2O37z.js";import"./list-QBOCIodH.js";import"./UsePatientsData-2jGB5q0K.js";import"./UsersComboBox-BR1MkjhI.js";import"./popover-BeKqgCqh.js";import"./useMutation-DWP0Ot2c.js";import"./swiper-react-CbcsGzjN.js";import"./grid-CY4MOgwY.js";import"./AddPatients-BLpTyXQl.js";import"./menu-list-UQBnhbZh.js";import"./split-CzYrjwZo.js";function is({patientID:t}){const f=oe(),{isOpen:j,onOpen:i,onClose:d}=ae(),P=he(),u="Errortoast",o=F.useRef(null),[b,v]=F.useState([]),{hasPermission:z}=W(),I=ce(),k=y=>{v(y)},T=async()=>{const y=`get_appointment/patient/${t}`,r=await Z(A.token,y);return r==null?void 0:r.data.map(R=>{const{id:je,patient_id:ue,status:te,date:ge,time_slots:pe,type:J,payment_status:O,current_cancel_req_status:re,patient_f_name:fe,patient_l_name:be,patient_phone:ye,doct_f_name:Se,doct_l_name:Pe,doct_image:Ce,source:we}=R;return{id:je,image:Ce,Doctor:`${Se} ${Pe}`,Patient:`${fe} ${be} - #${ue}`,phone:ye,Status:Me(te),Date:ne(ge).format("DD MMM YYYY"),"Time Slots":ne(pe,"HH:mm:ss").format("hh:mm A"),Type:J==="Emergency"?e.jsx($,{colorScheme:"red",children:J}):e.jsx($,{colorScheme:"green",children:J}),"Payment Status":O==="Paid"?e.jsx($,{colorScheme:"green",children:O}):O==="Refunded"?e.jsx($,{colorScheme:"blue",children:O}):e.jsx($,{colorScheme:"red",children:"Not Paid"}),"Cancellation Status":Ye(re),source:we,filterStatus:te,current_cancel_req_status:re}})},{isLoading:E,data:a,error:s,isFetching:Q,isRefetching:G}=ee({queryKey:["appointments","patient",t,b],queryFn:T}),{handleSearchChange:H,filteredData:Y}=xe(a);return s?(P.isActive(u)||P({id:u,title:"Oops!",description:"Something bad happened.",status:"error",duration:2e3,isClosable:!0,position:"top"}),e.jsx(_e,{errorCode:s.name})):z("APPOINTMENT_VIEW")?e.jsxs(c,{ref:o,children:[E||!a?e.jsxs(c,{children:[e.jsxs(n,{mb:5,justify:"space-between",children:[e.jsx(l,{w:400,h:8}),e.jsx(l,{w:200,h:8})]}),[...Array(10)].map((y,r)=>e.jsx(l,{h:10,w:"100%",mt:2},r))]}):e.jsxs(c,{children:[e.jsxs(n,{mb:5,justify:"space-between",align:"center",children:[e.jsx(x,{size:"md",placeholder:"Search",w:400,maxW:"50vw",onChange:y=>H(y.target.value)}),e.jsx(c,{children:e.jsx(q,{size:"sm",colorScheme:"blue",onClick:()=>{i()},children:"Add New"})})]}),e.jsxs(n,{alignItems:"top",justifyContent:"space-between",children:[" ",e.jsx(qe,{colorScheme:"blue",onChange:k,value:b,children:e.jsxs(n,{mb:5,gap:4,alignItems:"center",children:[e.jsx(C,{value:"Confirmed",children:"Confirmed"}),e.jsx(C,{value:"Visited",children:"Visited"}),e.jsx(C,{value:"Completed",children:"Completed"}),e.jsx(C,{value:"Pending",children:"Pending"}),e.jsx(C,{value:"Cancelled",children:"Cancelled"}),e.jsx(C,{value:"Rejected",children:"Rejected"}),e.jsx(C,{value:"Cancellation",children:"Cancellation Initiated"})]})})," ",e.jsx(q,{isLoading:Q||G,size:"sm",colorScheme:"blue",onClick:()=>{I.invalidateQueries(["appointments","patient",t,b],{refetchInactive:!0})},rightIcon:e.jsx(Ve,{size:14}),children:"Refresh Table"})]}),e.jsx(Oe,{minPad:"1px 10px",data:Y,onActionClick:e.jsx(ds,{onClick:()=>{},navigate:f})})]}),j&&e.jsx(Je,{isOpen:j,onClose:d,PatientID:t})]}):e.jsx(se,{})}const ds=({onClick:t,rowData:f,navigate:j})=>{const{hasPermission:i}=W();return e.jsx(n,{justify:"center",children:i("APPOINTMENT_UPDATE")&&e.jsx(V,{size:"sm",variant:"ghost",_hover:{background:"none"},onClick:()=>{t(f),j(`/appointment/${f.id}`)},icon:e.jsx(Le,{fontSize:18,color:ve.colors.blue[500]})})})};function ls({patientID:t,queryActive:f}){const{hasPermission:j}=W(),[i,d]=F.useState(),{isOpen:P,onOpen:u,onClose:o}=ae(),b=async()=>(await Z(A.token,`get_prescription/patient/${t}`)).data,{isLoading:v,data:z,error:I}=ee({queryKey:["prescriptions-patient",t],queryFn:b,enabled:f}),{handleSearchChange:k,filteredData:T}=xe(z);if(I)return e.jsx(ie,{color:"red.500",children:"Error loading data"});const E=a=>{const s=window.open(a,"_blank");s&&(s.focus(),s.onload=()=>{s.load(),s.onafterprint=()=>{s.close()}})};return j("PRESCRIPTION_VIEW")?e.jsxs(c,{children:[v?e.jsxs(c,{children:[e.jsxs(n,{mb:5,justify:"space-between",children:[e.jsx(l,{w:400,h:8}),e.jsx(l,{w:200,h:8})]}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2}),e.jsx(l,{h:10,w:"100%",mt:2})]}):e.jsxs(c,{children:[e.jsx(n,{mb:4,alignItems:"center",justify:"space-between",children:e.jsx(x,{placeholder:"Search",w:400,maxW:"50vw",mr:2,icon:e.jsx(Ue,{}),onChange:a=>k(a.target.value),size:"md"})}),e.jsx(c,{borderWidth:"1px",borderRadius:"lg",overflow:"scroll",maxW:"100%",children:e.jsxs(es,{variant:"simple",colorScheme:"gray",fontSize:12,size:"sm",fontWeight:500,children:[e.jsx(ss,{background:_("blue.50","blue.700"),children:e.jsxs(X,{children:[e.jsx(w,{padding:2,children:"ID"}),e.jsx(w,{padding:2,children:"Appointment ID"}),e.jsx(w,{padding:2,children:"Patient"}),e.jsx(w,{padding:2,children:"Date"}),e.jsx(w,{padding:2,children:"Pulse Rate"}),e.jsx(w,{padding:2,children:"Temperature"}),e.jsx(w,{padding:2,textAlign:"center",children:"Action"})]})}),e.jsx(as,{children:z.length>0?T.map(a=>e.jsxs(X,{children:[e.jsx(S,{padding:2,children:a.id})," ",e.jsx(S,{padding:2,children:a.appointment_id}),e.jsx(S,{padding:2,children:`${a.patient_f_name} ${a.patient_l_name}`}),e.jsx(S,{padding:2,children:a.date}),e.jsx(S,{padding:2,children:a.pulse_rate}),e.jsx(S,{padding:2,children:a.temperature}),e.jsx(S,{padding:2,maxW:10,children:e.jsxs(n,{alignItems:"center",justifyContent:"center",children:[" ",e.jsx(V,{as:Ie,"aria-label":"Filter",icon:e.jsx(Ke,{fontSize:22}),colorScheme:"whatsapp",size:"sm",variant:"ghost",target:"_blank",rel:"noopener noreferrer",onClick:()=>{E(a!=null&&a.pdf_file?`${me}/${a==null?void 0:a.pdf_file}`:`${ze}/prescription/generatePDF/${a.id}`)}}),j("PRESCRIPTION_UPDATE")&&e.jsx(V,{isDisabled:!!(a!=null&&a.pdf_file),as:Te,"aria-label":"Filter",icon:e.jsx(Ze,{fontSize:24}),colorScheme:"blue",size:"sm",variant:"ghost",to:`/prescription/${a==null?void 0:a.id}/?appointmentID=${a==null?void 0:a.appointment_id}&patientID=${a==null?void 0:a.patient_id}`}),e.jsx(V,{"aria-label":"Filter",icon:e.jsx(Xe,{fontSize:20}),colorScheme:"red",size:"sm",variant:"ghost",onClick:()=>{u(),d(a)}})," "]})})]},a.id)):e.jsx(X,{children:e.jsx(S,{colSpan:"7",children:e.jsx(ie,{align:"center",children:"No data available in table"})})})})]})})]}),P&&e.jsx(We,{isOpen:P,onClose:o,data:i})]}):e.jsx(se,{})}function Ms(){const{id:t}=Re(),f=oe(),[j,i]=F.useState(),{register:d,handleSubmit:P}=ke(),u=ce(),o=he(),[b,v]=F.useState(),{isOpen:z,onOpen:I,onClose:k}=ae(),T=F.useRef(),{hasPermission:E}=W(),a=async()=>{const r=await Z(A.token,`get_patients/${t}`);return v(r.data.isd_code),r.data},{data:s,isLoading:Q}=ee({queryKey:["patient",t],queryFn:a}),G=async r=>{let g={id:t,isd_code:b,...r};try{i(!0);const R=await K(A.token,"update_patient",g);i(!1),R.response===200?(p(o,"success","Patient Updated!"),u.invalidateQueries(["patient",t]),u.invalidateQueries(["patients"])):p(o,"error",R.message)}catch(R){i(!1),p(o,"error",JSON.stringify(R))}},H=async r=>{try{i(!0);const g=await K(A.token,"update_patient",{id:t,image:r});i(!1),g.response===200?(p(o,"success","Patient Updated!"),u.invalidateQueries(["patient",t]),u.invalidateQueries(["patients"])):p(o,"error",g.message)}catch(g){i(!1),p(o,"error",JSON.stringify(g))}},Y=r=>{const g=r.target.files[0];H(g)},y=async()=>{try{i(!0);const r=await K(A.token,"remove_patient_image",{id:t});i(!1),r.response===200?(p(o,"success","Image Deleted!"),u.invalidateQueries("patient",t)):p(o,"error",r.message)}catch(r){i(!1),p(o,"error",JSON.stringify(r))}};return Q||j?e.jsx(Ae,{}):E("PATIENT_UPDATE")?e.jsxs(c,{children:[e.jsxs(n,{justify:"space-between",alignItems:"center",children:[e.jsx(N,{as:"h1",size:"lg",children:"Patients Details"}),e.jsx(q,{w:120,size:"sm",variant:_("blackButton","gray"),onClick:()=>{f(-1)},children:"Back"})]}),e.jsx(B,{mb:2,mt:3}),e.jsxs(Qe,{children:[e.jsxs(Ge,{children:[e.jsx(M,{children:"Details"}),e.jsx(M,{children:"Patient Files"}),e.jsx(M,{children:"Patient Appointments"}),e.jsx(M,{children:"Patient Prescriptions"})]}),e.jsxs(He,{children:[e.jsx(U,{children:e.jsxs(n,{gap:10,mt:2,as:"form",onSubmit:P(G),children:[e.jsxs(c,{w:"60%",children:[" ",e.jsx(D,{mt:5,bg:_("white","gray.700"),children:e.jsxs(L,{p:3,as:"form",children:[e.jsxs(n,{align:"center",justify:"space-between",children:[" ",e.jsxs(N,{as:"h3",size:"sm",children:["Basic Details -"," "]})," "]}),e.jsx(B,{mt:2,mb:5}),e.jsxs(n,{gap:10,mt:5,align:"flex-end",children:[e.jsxs(m,{isRequired:!0,children:[e.jsx(h,{children:"First Name"}),e.jsx(x,{size:"sm",borderRadius:6,placeholder:"First Name",...d("f_name",{required:!0}),defaultValue:s==null?void 0:s.f_name})]}),e.jsxs(m,{isRequired:!0,children:[e.jsx(h,{children:"Last Name"}),e.jsx(x,{size:"sm",borderRadius:6,placeholder:"Last Name",...d("l_name",{required:!0}),defaultValue:s==null?void 0:s.l_name})]})]}),e.jsxs(n,{gap:10,mt:5,children:[e.jsxs(m,{isRequired:!0,children:[e.jsx(h,{children:"Date Of Birth"}),e.jsx(x,{max:$e(),size:"sm",borderRadius:6,placeholder:"Select Date",type:"date",...d("dob",{required:!0}),defaultValue:s==null?void 0:s.dob})]}),e.jsxs(m,{children:[e.jsx(h,{children:"Gender"}),e.jsxs(ts,{size:"sm",borderRadius:6,placeholder:"Select Gender",...d("gender"),defaultValue:s==null?void 0:s.gender,children:[e.jsx("option",{value:"Female",children:"Female"})," ",e.jsx("option",{value:"Male",children:"Male"})]})]})]}),e.jsx(n,{gap:10,mt:5,children:e.jsxs(m,{children:[e.jsx(h,{children:"Notes"}),e.jsx(le,{placeholder:"Notes",size:"sm",resize:"vertical",...d("notes"),defaultValue:s==null?void 0:s.notes})]})})]})}),e.jsx(D,{mt:5,bg:_("white","gray.700"),children:e.jsxs(L,{p:3,as:"form",children:[e.jsxs(n,{align:"center",justify:"space-between",children:[" ",e.jsx(N,{as:"h3",size:"sm",children:"Contact Details -"})," "]}),e.jsx(B,{mt:2,mb:5}),e.jsxs(n,{gap:10,mt:5,children:[e.jsxs(m,{children:[e.jsx(h,{children:"Email"}),e.jsx(x,{size:"sm",borderRadius:6,type:"email",placeholder:"Email",...d("email"),defaultValue:s==null?void 0:s.email})]}),e.jsxs(m,{mt:0,isRequired:!0,children:[e.jsx(h,{children:"Phone "}),e.jsxs(rs,{size:"sm",children:[e.jsx(Ee,{cursor:"pointer",onClick:r=>{r.stopPropagation(),I()},children:b}),e.jsx(x,{borderRadius:6,placeholder:"Enter your phone number",type:"Tel",fontSize:16,...d("phone",{required:!0,pattern:/^[0-9]+$/}),defaultValue:s==null?void 0:s.phone})]})]})]})]})}),e.jsx(D,{mt:5,bg:_("white","gray.700"),children:e.jsxs(L,{p:3,as:"form",children:[e.jsxs(n,{align:"center",justify:"space-between",children:[" ",e.jsxs(N,{as:"h3",size:"sm",children:["Address -"," "]})," "]}),e.jsx(B,{mt:2,mb:5}),e.jsxs(n,{gap:10,children:[e.jsxs(m,{children:[e.jsx(h,{children:"State"}),e.jsx(x,{size:"sm",borderRadius:6,type:"email",placeholder:"State",...d("state"),defaultValue:s==null?void 0:s.state})]}),e.jsxs(m,{children:[e.jsx(h,{children:"City"}),e.jsx(x,{size:"sm",borderRadius:6,type:"text",placeholder:"City",...d("city"),defaultValue:s.city})]}),e.jsxs(m,{children:[e.jsx(h,{children:"Postal Code"}),e.jsx(x,{size:"sm",borderRadius:6,type:"number",placeholder:"Postal Code",...d("postal_code"),defaultValue:s.postal_code})]})]}),e.jsx(n,{gap:10,mt:5,children:e.jsxs(m,{children:[e.jsx(h,{children:"Address"}),e.jsx(le,{placeholder:"Address",size:"sm",resize:"vertical",...d("address"),defaultValue:s==null?void 0:s.address})]})})]})}),e.jsx(q,{w:"100%",mt:10,type:"submit",colorScheme:"green",size:"sm",isLoading:j,children:"Update"})]}),e.jsxs(c,{w:"35%",children:[e.jsx(D,{mt:5,bg:_("white","gray.700"),h:"fit-content",pb:5,children:e.jsxs(L,{p:2,children:[e.jsx(N,{as:"h3",size:"sm",textAlign:"center",children:"Profile Picture"}),e.jsx(B,{mt:2}),e.jsxs(n,{p:2,justify:"center",mt:5,position:"relative",children:[e.jsx(Fe,{borderRadius:"50%",h:150,objectFit:"cover",w:150,src:s!=null&&s.image?`${me}/${s==null?void 0:s.image}`:"/admin/profilePicturePlaceholder.png"}),(s==null?void 0:s.image)&&e.jsx(Be,{label:"Delete",fontSize:"md",children:e.jsx(V,{size:"sm",colorScheme:"red",variant:"solid",position:"absolute",right:5,icon:e.jsx(De,{}),onClick:()=>{y()}})})]}),e.jsxs(ns,{spacing:4,align:"stretch",mt:10,children:[e.jsx(x,{size:"sm",borderRadius:6,type:"file",display:"none",ref:T,onChange:Y,accept:".jpeg, .svg, .png , .jpg"}),e.jsx(q,{size:"sm",onClick:()=>{T.current.click()},colorScheme:"blue",children:"Upload Profile Picture"})]})]})}),e.jsx(D,{mt:5,bg:_("white","gray.700"),h:"fit-content",pb:5,children:e.jsx(L,{p:2,children:e.jsx(de,{id:t})})})]})]})}),e.jsx(U,{children:e.jsxs(c,{maxW:500,children:[" ",e.jsx(de,{id:t})]})}),e.jsx(U,{children:e.jsx(is,{patientID:t})}),e.jsx(U,{children:e.jsx(ls,{patientID:t,queryActive:!0})})]})]}),e.jsx(Ne,{isOpen:z,onClose:k,setisd_code:v})]}):e.jsx(se,{})}export{Ms as default};
/home/users/unlimited/www/admin.medimeet.codeskitter.site/8dfc6/../assets/Update-DZdUlnjv.js