PageSourceSearch

https://ehr.roojh.com/assets/ProviderReport-D1EeFGww.js

js roojh.com collected 2026-10-02 00:58:37 UTC 12,210 bytes, 1 lines download raw bytes

1import{R as l,r as ae,C as T,j as e,a as R}from"./index-D4lotr7Z.js";import{r as se}from"./runtime-env-Cvu3xOmX.js";import{p as re}from"./provider.service-B5X-lQXN.js";import{d as x}from"./dayjs.min-DCQiHxCv.js";import{C as ne}from"./calendar-GnNJZ2vA.js";import{h as k}from"./moment-C5S46NFB.js";import{E as ie}from"./export-VJpV-ar8.js";import{d as oe}from"./ArrowBackIosNew-BPknCOSX.js";import{S as ce}from"./index-CXwiGDc5.js";import{L as C}from"./useMobilePicker-CKllrug1.js";import{A as I}from"./AdapterDayjs-CILqFqtG.js";import{D as Y}from"./DemoContainer-CaB8jC_j.js";import{D as M}from"./DatePicker-NBLjmVFD.js";import{T as de,a as le,b as pe,c as F,d as a,e as xe}from"./TableRow-_RVWG_dk.js";import{P as me}from"./Paper-BCFCRGfB.js";import{T as he}from"./TablePagination-DZo0kg2j.js";import{s as D}from"./styled-IWxKkAxA.js";import"./routing-constants-QzMPThW3.js";import"./createSvgIcon-LvZTTPqL.js";import"./debounce-Be36O1Ab.js";import"./isMuiElement-ZYg9Y2qV.js";import"./useId-BUeoiS-O.js";import"./useControlled-CCDshwCT.js";import"./useIsFocusVisible-C9U87ZAK.js";import"./type-Bapp7iJm.js";import"./upperFirst-DR6YNnKR.js";import"./isSymbol-Dt9kT11U.js";import"./assertThisInitialized-B9jnkVVz.js";import"./asyncToGenerator-BfWTt6ZC.js";import"./debounce-BZ_PP26j.js";import"./index-CLSMDfQE.js";import"./Grow-CPFdQHrT.js";import"./Popper-cpKpSwef.js";import"./InputAdornment-ORPF74_x.js";import"./useFormControl-2aVZy31S.js";import"./IconButton-YqbmQhms.js";import"./ButtonBase-ByQda188.js";import"./index-93mu-lTl.js";import"./TextField-B6XNXdBC.js";import"./OutlinedInput-BNj5Ij2C.js";import"./formControlState-Dq1zat_P.js";import"./Select-BBX6RKCM.js";import"./Menu-BRdsM7NL.js";import"./FormControl-BW2GCaVq.js";import"./visuallyHidden-Dan1xhjv.js";import"./createStyled-DB8WR3tf.js";import"./colorManipulator-DsZEf9BK.js";import"./useThemeProps-GJDJCNzT.js";import"./Dialog-jPsGMWtz.js";import"./DialogContent-DiJMiHrF.js";import"./dialogTitleClasses-DP3u5uoA.js";import"./Button-BzKGz5zt.js";import"./DialogActions-Bovnh7mW.js";import"./ListItem-6FUbsoxo.js";import"./Chip-MPE_XbjW.js";import"./Stack-BmXq-Hth.js";import"./KeyboardArrowRight-Bm7JlmhR.js";import"./LastPage-QN56dRDN.js";import"./MenuItem-CjUgLYEz.js";import"./Toolbar-BqxtKhML.js";const A=D(a)(({theme:f})=>({position:"sticky",backgroundColor:"grey",zIndex:9999}));D(A)({left:0});D(A)({left:100});const c={minWidth:"auto",background:"#EFF5FF",height:"37px",color:"#204289 !important",padding:"0px 16px 0px 16px !important",fontSize:"11px"},St=()=>{const[f,N]=l.useState([]),[L,z]=l.useState(0),[E,B]=l.useState(10),[$,y]=l.useState(0),[u,m]=l.useState({startDate:"",endDate:"",pageNo:1,pageSize:100}),d=ae.useRef(u),j=x(),_=x("2024-06-20"),[U,h]=l.useState(!0),[S,W]=l.useState(j),[H,O]=l.useState(j),[w,ge]=l.useState(j);l.useEffect(()=>{const t={startDate:b(new Date),endDate:b(new Date),pageNo:1,pageSize:10};m(s=>({...s,...t})),g(t)},[]),l.useEffect(()=>{d.current=u},[u]);const b=t=>{if(t){const s=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${s}-${n}-${i}`}},V=t=>{const s=new Date,n=new Date(t);let i=s.getFullYear()-n.getFullYear(),r=s.getMonth()-n.getMonth(),o=s.getDate()-n.getDate();if(o<0){r--;const p=new Date(s.getFullYear(),s.getMonth(),0).getDate();o+=p}return r<0&&(i--,r+=12),i+"y "+r+"m "+o+"d "},P=t=>{const s=new Date(t),n={timeZone:"Asia/Kolkata",day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};return s.toLocaleString("en-IN",n).replace(/\//g,"-").replace(",","")},G=t=>{const s=x("2024-06-19"),n=x(t);return n.isAfter(s)||n.isSame(s)},g=async t=>{var n,i;if(!G(t.startDate)){T.info("From date must be greater or equal to 20-June-2024");return}h(!0);const s="startDate="+t.startDate+"&endDate="+t.endDate+"&pageNo="+t.pageNo+"&limit="+t.pageSize;N([]),y(0);try{const r=await re.getReportList(s);r&&((n=r==null?void 0:r.data)==null||n.users.map(o=>{o.age="",o.age=o.dob?V(new Date(o.dob)):"",o.createdAt=o.createdAt?P(o.createdAt):"",o.visitDate=o.visitDate?P(o.visitDate):""}),N([...(i=r==null?void 0:r.data)==null?void 0:i.users]),y(r==null?void 0:r.data.totalCount),h(!1))}catch(r){h(!1),console.log("error",r)}},q=(t,s)=>
1{const n={startDate:d.current.startDate,endDate:d.current.endDate,pageNo:s+1,pageSize:d.current.pageSize};m(i=>({...i,...n})),g(n),z(s)},J=t=>{B(parseInt(t.target.value,10));const s={startDate:d.current.startDate,endDate:d.current.endDate,pageNo:d.current.pageNo,pageSize:parseInt(t.target.value,10)};m(n=>({...n,...s})),g(s)},v=()=>e.jsx("img",{src:ne,alt:"Date picker opening icon",width:20,height:20}),K=t=>{if(!t)return;const s=t.$d,n=k(s).format("YYYY-MM-DD"),i={startDate:d.current.startDate,endDate:n,pageNo:d.current.pageNo,pageSize:d.current.pageSize};m(o=>({...o,...i}));const r=x(n);O(r)},Z=t=>{if(!t)return;const s=t.$d,n=k(s).format("YYYY-MM-DD"),i={startDate:n,endDate:d.current.endDate,pageNo:d.current.pageNo,pageSize:d.current.pageSize};m(o=>({...o,...i}));const r=x(n);W(r)},Q=()=>{g(d.current)},X=async()=>{var i;const t=`${se.nodeApiBaseUrl}`;h(!0);const s=localStorage.getItem("enterprise"),n=localStorage.getItem("facility");try{const r=await R({method:"get",url:t+"api/v1/mongoProvider/getPatientListForExport",params:{startDate:d.current.startDate,endDate:d.current.endDate,pageNo:1,limit:5e3,enterpriseId:s,facilityId:n,isDownload:!0},headers:{Authorization:sessionStorage.getItem("idToken")}});if(!((i=r.data)!=null&&i.url))throw new Error("No download URL received");const o=await R({method:"get",url:r.data.url,responseType:"blob"}),p=document.createElement("a");p.href=window.URL.createObjectURL(new Blob([o.data]));const te=`report_${d.current.startDate}_${d.current.endDate}.xlsx`;p.setAttribute("download",te),document.body.appendChild(p),p.click(),document.body.removeChild(p)}catch(r){console.error("Error downloading the file:",r),T.error("Error downloading Excel file")}finally{h(!1)}},ee=()=>{window.history.back()};return e.jsxs("div",{children:[U?e.jsx("div",{className:"loader",children:e.jsx(ce,{size:"large"})}):"",e.jsxs("div",{style:{display:"flex",width:"100%",height:"50px",marginBottom:"10px",borderBottom:"1px solid #D9D9D9",padding:"15px 0px 0px 2px;"},children:[e.jsx("div",{style:{width:"45%",paddingTop:"14px"},children:e.jsxs("span",{onClick:ee,style:{fontFamily:"Rubik",fontSize:"15px",fontWeight:"500",letterSpacing:"0.001em",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px",color:"#204289",lineHeight:"1"},children:[e.jsx(oe,{sx:{fontSize:"18px"}})," ","OPD Registration Reports"]})}),e.jsxs("div",{style:{width:"55%",display:"flex",justifyContent:"end",paddingRight:"15px"},children:[e.jsx(C,{dateAdapter:I,children:e.jsx(Y,{components:["DatePicker","DatePicker","DatePicker"],children:e.jsx(M,{hiddenLabel:!0,value:S,minDate:_,maxDate:w,format:"DD/MM/YYYY",label:"From",handleDateSelect:!0,onChange:t=>Z(t),sx:{width:"20%",marginTop:"4px !important",border:"red","& .MuiInputBase-root":{height:"30px"},"& .MuiInputBase-input":{height:"30px",padding:"0 14px"}},slots:{openPickerIcon:v}})})}),e.jsx("span",{style:{paddingTop:"14px",marginRight:"7px",marginLeft:"7px"}}),e.jsx(C,{dateAdapter:I,children:e.jsx(Y,{components:["DatePicker","DatePicker","DatePicker"],children:e.jsx(M,{hiddenLabel:!0,value:H,min:S,format:"DD/MM/YYYY",label:"To",handleDateSelect:!0,onChange:t=>K(t),sx:{width:"20%",marginTop:"4px !important",border:"red","& .MuiInputBase-root":{height:"30px"},"& .MuiInputBase-input":{height:"30px",padding:"0 14px"}},slots:{openPickerIcon:v}})})}),e.jsx("span",{style:{paddingTop:"14px",marginRight:"7px",marginLeft:"7px"}}),e.jsx("div",{style:{paddingTop:"12px"},children:e.jsx("button",{sx:{height:"40px"},className:"report-srch-btn",onClick:Q,children:"Search"})}),e.jsx("span",{style:{paddingTop:"14px",marginRight:"7px",marginLeft:"7px"}}),e.jsx("div",{style:{paddingTop:"12px"},children:e.jsxs("button",{sx:{height:"40px"},className:"export-btn",onClick:X,children:[e.jsx("img",{src:ie})," Export Excel"]})})]})]}),e.jsx(de,{component:me,style:{maxHeight:"calc(100vh - 170px)",maxWidth:"93vw",marginRight:"10px"},children:e.jsxs(le,{stickyHeader:!0,children:[e.jsx(pe,{children:e.jsxs(F,{sx:{height:"20px"},children:[e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"S.No."})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"UHID"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Patient Name"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"No.of Visit"})}),e.jsx(a,{sx:c,className:"address-column",children:e.jsx("span",{className:"report-head-text",children:"Age"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Gender"})}),e.jsx(a,{sx:c,className:"address-column",children:e.jsx("span",{className:"report-head-text",children:"Address"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Mobile No"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"State"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Nationality"})}),e.jsx(a,{sx:c,className:"address-column",children:e.jsx("span",{className:"report-head-text",children:"First Registration Date & Time"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text address-column",children:"Visitor Date"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Payment Status"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Registration Done By"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Registration Location"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Forward To"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Waive Off"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Consultant Name"})}),e.jsx(a,{sx:c,children:e.jsx("span",{className:"report-head-text",children:"Waiveoff Type"})})]})}),e.jsx(xe,{children:f.map((t,s)=>{var n,i,r;return e.jsxs(F,{children:[e.jsx(a,{children:e.jsx("span",{className:"row-text",children:s+1})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.uhid?t.uhid:"-"})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.name})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.totalVisits})}),e.jsx(a,{children:e.jsx("span",{className:"address-column row-text",children:t.age})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.gender})}),e.jsx(a,{className:"address-column ",children:e.jsx("div",{className:"address-column row-text",children:t.address})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.phoneNo})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.stateName})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t.nationality})}),e.jsx(a,{children:e.jsx("div",{className:"address-column row-text",children:t==null?void 0:t.createdAt})}),e.jsx(a,{children:e.jsx("div",{className:"address-column row-text",children:t==null?void 0:t.visitDate})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:(n=t==null?void 0:t.paymentDetails)!=null&&n.isPaid?"Yes":"No"})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t==null?void 0:t.createdBy})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:"Registration "+(t==null?void 0:t.deskNumber)})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:t==null?void 0:t.forwardTo})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:(i=t==null?void 0:t.paymentDetails)!=null&&i.isWaiveOff?"Yes":"No"})}),e.jsx(a,{children:e.jsx("div",{className:"address-column row-text",children:t==null?void 0:t.consultantName})}),e.jsx(a,{children:e.jsx("span",{className:"row-text",children:(r=t==null?void 0:t.paymentDetails)==null?void 0:r.waiveoffType})})]},s+1)})})]})}),e.jsx(he,{rowsPerPageOptions:[10,25,50],component:"div",count:$,rowsPerPage:E,page:L,onPageChange:q,onRowsPerPageChange:J})]})};export{St 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.