PageSourceSearch

https://smenarnabitcoin.cz/assets/DailyPatientReport-CHoZ2rZn.js

js smenarnabitcoin.cz collected 2026-10-06 19:42:59 UTC 11,993 bytes, 1 lines download raw bytes

1import{f as P,r as d,N as j,d_ as T,j as s,P as Y,n as H,L as F,G as z,H as U,bM as O}from"./index-BiR4tHPa.js";import{s as t}from"./Report.module-CKWodCxD.js";import{D as G}from"./DateRange-Bsl2oLUR.js";import{E as k}from"./ExportDropdown-CYMwokZY.js";import"./toInteger-DK05pKpO.js";import"./index-Baj-kYYB.js";import"./index-DNiLc72J.js";import"./Dropdown-sAzZC80_.js";import"./SSRProvider-DlbPITwR.js";import"./NavContext-C_dJCat9.js";import"./SelectableContext-DRNVOMH1.js";import"./Anchor-DxYk-7O_.js";import"./InputGroupContext-CWnggAZ1.js";import"./jspdf.es.min-Byqb0vlz.js";import"./jspdf.plugin.autotable-CtA5BUKo.js";const ds=()=>{const{t:x}=P("report"),N=d.useMemo(()=>{const e=j("2000-01-01"),l=j().endOf("day");return{start:e.format("DD, MMMM YYYY"),end:l.format("DD, MMMM YYYY")}},[]),$=d.useMemo(()=>{const e=j().startOf("day");return[e.toDate(),e.toDate()]},[]),[i,A]=d.useState($),[p,g]=d.useState(""),[w,y]=d.useState(""),[u,m]=d.useState([]),[v,V]=d.useState(0),[r,S]=d.useState(null),[D,M]=d.useState([]),[C,R]=d.useState(!1),[q,L]=d.useState(window.innerWidth<=576);d.useEffect(()=>{const e=()=>L(window.innerWidth<=576);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const o=d.useMemo(()=>{if(r)return{hospitalWiseNewVisits:Number(r==null?void 0:r.hospital_wise_new_visits)||0,hospitalWiseOldVisits:Number(r==null?void 0:r.hospital_wise_old_visits)||0,doctorWiseNewVisits:Number(r==null?void 0:r.doctor_wise_new_visits)||0,doctorWiseOldVisits:Number(r==null?void 0:r.doctor_wise_old_visits)||0,totalVisits:Number(r==null?void 0:r.total_visits)||0,uniquePatientsOverall:Number(r==null?void 0:r.unique_patients_overall)||0,totalDoctors:Number(r==null?void 0:r.total_doctors)||0};const e=l=>u.reduce((n,c)=>n+(Number(c==null?void 0:c[l])||0),0);return{hospitalWiseNewVisits:e("hospital_wise_new_visits"),hospitalWiseOldVisits:e("hospital_wise_old_visits"),doctorWiseNewVisits:e("doctor_wise_new_visits"),doctorWiseOldVisits:e("doctor_wise_old_visits"),totalVisits:e("total_visits"),uniquePatientsOverall:Math.max(...u.map(l=>Number(l==null?void 0:l.unique_patients)||0),0),totalDoctors:u.length}},[u,r]),W=e=>j(e).format("DD, MMMM YYYY");d.useEffect(()=>{if(!Array.isArray(i)||i.length===0){g(N.start),y(N.end);return}const e=i!=null&&i[0]?W(i[0]):"",l=i!=null&&i[1]?W(i[1]):e;g(e),y(l||e)},[N.end,N.start,i]);const f=d.useCallback(async()=>{if(p){R(!0);try{const e=await T(p,w||p),l=e==null?void 0:e.data,n=Array.isArray(l)?l:Array.isArray(l==null?void 0:l.document)?l.document:[];console.log("daily_patient_report rows:",n.length,n[0]);const c=l!=null&&l.summary&&typeof l.summary=="object"?l.summary:null;S(c),m(n);const _=c?Number(c==null?void 0:c.total_visits)||0:n.reduce((a,h)=>a+(Number(h==null?void 0:h.total_visits)||0),0);V(_);const b=n.map(a=>{var h;return{"s.no":0,"doctor name":((h=(a==null?void 0:a.doctor_name)??(a==null?void 0:a["Doctor Name"])??(a==null?void 0:a.doctorName)??"")==null?void 0:h.toLowerCase())||"","hospital wise new":Number(a==null?void 0:a.hospital_wise_new_visits)||0,"hospital wise old":Number(a==null?void 0:a.hospital_wise_old_visits)||0,"doctor wise new":Number(a==null?void 0:a.doctor_wise_new_visits)||0,"doctor wise old":Number(a==null?void 0:a.doctor_wise_old_visits)||0,"total appointments":Number(a==null?void 0:a.total_visits)||0,"unique appointments":Number(a==null?void 0:a.unique_patients)||0}});b.forEach((a,h)=>{a["s.no"]=h+1}),M(b)}catch(e){console.log(e),m([]),V(0),S(null),M([])}finally{R(!1)}}},[w,p]);return d.useEffect(()=>{f()},[f]),s.jsxs("div",{children:[s.jsxs("div",{className:"d-flex align-items-center justify-content-between mb-2",children:[s.jsx(Y,{activeMenu:x("dailyPatientReport"),motherMenu:x("report")}),s.jsx("div",{className:"d-flex gap-2 d-sm-none",children:s.jsx(k,{data:D,iconOnly:!0,className:`${t["btn-row"]}`,pdfMeta:{dateRange:Array.isArray(i)&&i.length>0?{start:p,end:w||p}:void 0,summary:{count:v,hospitalWiseNewVisits:o.hospitalWiseNewVisits,hospitalWiseOldVisits:o.hospitalWiseOldVisits,doctorWiseNewVisits:o.doctorWiseNewVisits,doctorWiseOldVisits:o.doctorWiseOldVisits,totalVisits:o.totalVisits,uniquePatientsOverall:o.uniquePatientsOverall,totalDoctors:o.totalDoctors}}})})]}),s.jsxs("div",{className:`${t["filters-container"]}`,children:[s.jsxs("div",{className:`${t.filter}`,children:[s.jsx("p",{className:`${t["filter-label"]}`,style:{fontWeight:"bold"},children:x("selectDateRange")}),s.jsx("div",{className:`${t["filter-div"]}`,style:{backgroundColor:"#F6F5F5"},children:s.jsx(G,{setValue:A,value:i})})]}),s.jsxs("div",{className:"d-none d-sm-flex gap-2 align-items-end",children:[s.jsx(k,{data:D,className:`${t["btn-row"]}`,pdfMeta:{dateRange:Array.isArray(i)&&i.length>0?{start:p,end:w||p}:void 0,summary:{count:v,hospitalWiseNewVisits:o.hospitalWiseNewVisits,hospitalWiseOldVisits:o.hospitalWiseOldVisits,doctorWiseNewVisits:o.doctorWiseNewVisits,doctorWiseOldVisits:o.doctorWiseOldVisits,totalVisits:o.totalVisits,uniquePatientsOverall:o.uniquePatientsOverall,totalDoctors:o.totalDoctors}}}),s.jsx(H,{onClick:f,className:`${t["btn-row"]}`,children:x("refresh")})]})]}),C?s.jsx(F,{}):s.jsx("div",{className:"report-container",id:"report-content",children:(u==null?void 0:u.length)===0?s.jsx("div",{className:"text-center py-4",children:s.jsx("h4",{children:x("noDataAvailable")})}):s.jsxs(s.Fragment,{children:[s.jsx(z,{children:s.jsx(U,{children:q?s.jsx("div",{className:t.dailyReportMobileList,children:u.map((e,l)=>{const n=(e==null?void 0:e.doctor_name)??(e==null?void 0:e["Doctor Name"])??(e==null?void 0:e.doctorName)??"",c=Number(e==null?void 0:e.hospital_wise_new_visits)||0,_=Number(e==null?void 0:e.hospital_wise_old_visits)||0,b=Number(e==null?void 0:e.doctor_wise_new_visits)||0,a=Number(e==null?void 0:e.doctor_wise_old_visits)||0,h=Number(e==null?void 0:e.total_visits)||0,E=Number(e==null?void 0:e.unique_patients)||0;return s.jsxs("div",{className:t.dailyReportCard,children:[s.jsx("div",{className:t.dailyReportCardHeader,children:n}),s.jsxs("div",{className:t.dailyReportMetricsGrid,children:[s.jsxs("div",{className:t.dailyReportMetric,children:[s.jsx("div",{className:t.dailyReportMetricLabel,children:"Hospital wise (New)"}),s.jsx("div",{className:t.dailyReportMetricValue,children:c})]}),s.jsxs("div",{className:t.dailyReportMetric,children:[s.jsx("div",{className:t.dailyReportMetricLabel,children:"Hospital wise (Old)"}),s.jsx("div",{className:t.dailyReportMetricValue,children:_})]}),s.jsxs("div",{className:t.dailyReportMetric,children:[s.jsx("div",{className:t.dailyReportMetricLabel,children:"Total Appointments"}),s.jsx("div",{className:`${t.dailyReportMetricValue} ${t.dailyTotalValue}`,children:h})]})]}),s.jsxs("div",{className:t.dailyReportSubMetrics,children:[s.jsxs("div",{children:[s.jsx("span",{className:t.dailyReportSubLabel,children:"Doctor wise (New)"}),s.jsx("span",{className:t.dailyReportSubValue,children:b})]}),s.jsxs("div",{children:[s.jsx("span",{className:t.dailyReportSubLabel,children:"Doctor wise (Old)"}),s.jsx("span",{className:t.dailyReportSubValue,children:a})]}),s.jsxs("div",{children:[s.jsx("span",{className:t.dailyReportSubLabel,children:"Unique Appointments"}),s.jsx("span",{className:t.dailyReportSubValue,children:E})]})]})]},e._id??l)})}):s.jsx("div",{className:"table-scroll",style:{width:"100%",overflowX:"auto",overflowY:"visible",padding:"8px 0"},children:s.jsxs("table",{className:`${O.table} table-sm`,style:{width:"100%",minWidth:900,marginLeft:0,marginRight:0,background:"#fff",borderRadius:10,overflow:"hidden",boxShadow:"0 2px 10px rgba(0,0,0,0.06)",borderCollapse:"separate",borderSpacing:0},children:[s.jsxs("thead",{children:[s.jsxs("tr",{children:[s.jsx("th",{className:"text-center",rowSpan:2,style:{background:"#f7f9fc",verticalAlign:"middle",width:64,whiteSpace:"nowrap"},children:s.jsx("strong",{children:"S.No"})}),s.jsx("th",{className:"width80",rowSpan:2,style:{background:"#f7f9fc",verticalAlign:"middle",minWidth:180,whiteSpace:"nowrap"},children:s.jsx("strong",{children:x("doctorName")}
1)}),s.jsx("th",{className:"text-center",colSpan:2,style:{background:"#f7f9fc"},children:s.jsx("strong",{children:"Hospital wise"})}),s.jsx("th",{className:"text-center",colSpan:2,style:{background:"#f7f9fc"},children:s.jsx("strong",{children:"Doctor wise"})}),s.jsx("th",{className:`text-end ${t.dailyTotalCol}`,rowSpan:2,style:{background:"#f7f9fc",verticalAlign:"middle",minWidth:170,whiteSpace:"nowrap"},children:s.jsx("strong",{children:"Total Appointments"})}),s.jsx("th",{className:"text-end",rowSpan:2,style:{background:"#f7f9fc",verticalAlign:"middle",width:140,whiteSpace:"nowrap"},children:s.jsx("strong",{children:"Unique Appointments"})})]}),s.jsxs("tr",{children:[s.jsx("th",{className:"text-end",style:{background:"#f7f9fc"},children:s.jsx("strong",{children:"New"})}),s.jsx("th",{className:"text-end",style:{background:"#f7f9fc"},children:s.jsx("strong",{children:"Old"})}),s.jsx("th",{className:"text-end",style:{background:"#f7f9fc"},children:s.jsx("strong",{children:"New"})}),s.jsx("th",{className:"text-end",style:{background:"#f7f9fc"},children:s.jsx("strong",{children:"Old"})})]})]}),s.jsx("tbody",{children:u.map((e,l)=>s.jsxs("tr",{className:`${O["table-row"]} ${t["table-row"]}`,style:{cursor:"default"},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f9fbff"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor=""},children:[s.jsx("td",{className:"text-center",children:l+1}),s.jsx("td",{children:(e==null?void 0:e.doctor_name)??(e==null?void 0:e["Doctor Name"])??(e==null?void 0:e.doctorName)??""}),s.jsx("td",{className:"text-end",children:Number(e==null?void 0:e.hospital_wise_new_visits)||0}),s.jsx("td",{className:"text-end",children:Number(e==null?void 0:e.hospital_wise_old_visits)||0}),s.jsx("td",{className:"text-end",children:Number(e==null?void 0:e.doctor_wise_new_visits)||0}),s.jsx("td",{className:"text-end",children:Number(e==null?void 0:e.doctor_wise_old_visits)||0}),s.jsx("td",{className:`text-end ${t.dailyTotalCol} ${t.dailyTotalValue}`,style:{fontWeight:700},children:Number(e==null?void 0:e.total_visits)||0}),s.jsx("td",{className:"text-end",children:Number(e==null?void 0:e.unique_patients)||0})]},e._id??l))})]})})})}),s.jsxs("div",{className:"mt-2 d-flex flex-column flex-md-row align-items-stretch align-items-md-center gap-2",children:[s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Total Visits"}),s.jsx("strong",{children:v})]}),s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Total Doctors"}),s.jsx("strong",{children:o.totalDoctors})]}),s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Doctor wise (New)"}),s.jsx("strong",{children:o.doctorWiseNewVisits})]}),s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Doctor wise (Old)"}),s.jsx("strong",{children:o.doctorWiseOldVisits})]}),s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Hospital wise (New)"}),s.jsx("strong",{children:o.hospitalWiseNewVisits})]}),s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Hospital wise (Old)"}),s.jsx("strong",{children:o.hospitalWiseOldVisits})]}),s.jsxs("div",{className:`p-2 bg-light rounded border w-100 w-md-auto ${t.dailySummaryCard}`,children:[s.jsx("small",{className:"text-muted d-block",children:"Unique Patients"}),s.jsx("strong",{className:t.dailyTotalValue,children:o.uniquePatientsOverall})]})]})]})})]})};export{ds 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.