import React, { useState, useMemo } from 'react'; import { DOCTORS_DATA } from './constants'; import type { DoctorData } from './types'; import InputGroup from './components/InputGroup'; import Icon from './components/Icon'; // Base64 encoded logo image const logoBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAADACAYAAADyTDbzAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAACAAElEQVR42uzdd5xV1fX/8c/v2Xtm9syyy75kL5EsgbZgQ1sUxYpYVGNr1Bpr1Bj/afNPY401BiMaC4oSiw1FRGxBkEAIEiAhWfYuu8vsN/N8/3Bmnlns7D6ze++1nvf5PPDA7szZe+211t/3e6/1ve+pEBERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER...A"; const App: React.FC = () => { const [selectedDoctorId, setSelectedDoctorId] = useState(String(DOCTORS_DATA[0].id)); const [startTime, setStartTime] = useState('09:00'); const [numRoutine, setNumRoutine] = useState(10); const [numWalkIn, setNumWalkIn] = useState(5); const [numEmergency, setNumEmergency] = useState(2); const [numReports, setNumReports] = useState(4); const [numRelatives, setNumRelatives] = useState(1); const [numIpdRounds, setNumIpdRounds] = useState(1); const [numVideoConsult, setNumVideoConsult] = useState(0); const [estimatedEndTime, setEstimatedEndTime] = useState(null); const [isCopied, setIsCopied] = useState(false); const handleCalculate = (e: React.FormEvent) => { e.preventDefault(); const doctor = DOCTORS_DATA.find((d) => d.id === parseInt(selectedDoctorId, 10)); if (!doctor || !startTime) return; const totalMinutes = (numRelatives * doctor.relatives) + (numRoutine * doctor.routine) + (numEmergency * doctor.emergency) + (numWalkIn * doctor.walkIn) + (numReports * doctor.reports) + (numIpdRounds * doctor.ipdRounds) + (numVideoConsult * doctor.videoConsult); const [hours, minutes] = startTime.split(':').map(Number); const startDate = new Date(); startDate.setHours(hours, minutes, 0, 0); const endDate = new Date(startDate.getTime() + totalMinutes * 60000); const formattedEndTime = endDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: true, }); setEstimatedEndTime(formattedEndTime); }; const selectedDoctor = useMemo( () => DOCTORS_DATA.find((d) => d.id === parseInt(selectedDoctorId, 10)), [selectedDoctorId] ); const generateExportMessage = (): string => { if (!estimatedEndTime || !selectedDoctor) return ''; const summary = ` OPD Schedule Estimation for ${selectedDoctor.name} -------------------------------------- OPD Start Time: ${new Date(`1970-01-01T${startTime}`).toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: true })} Estimated End Time: ${estimatedEndTime} -------------------------------------- Patient Load: - Scheduled Patients: ${numRoutine} - Walk-in Patients: ${numWalkIn} - Emergency Patients: ${numEmergency} - Report Patients: ${numReports} - Relatives at Start: ${numRelatives} - IPD Rounds: ${numIpdRounds} - Video Consults: ${numVideoConsult} -------------------------------------- This is an automated estimation. `; return summary.trim(); }; const handleEmailExport = () => { const message = generateExportMessage(); if (!message) return; const subject = `OPD Estimation for ${selectedDoctor?.name}`; const mailtoUrl = `mailto:?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(message)}`; window.open(mailtoUrl, '_blank'); }; const handleCopy = () => { if (isCopied) return; const message = generateExportMessage(); if (!message) return; navigator.clipboard.writeText(message).then(() => { setIsCopied(true); setTimeout(() => { setIsCopied(false); }, 2000); }); }; return (
Shalom Life Care Hospitals Logo

Ashok and Ashok One OPD ExTOC

Calculate the estimated Out-Patient Department completion time.

{/* Left Column: Inputs */}
setStartTime(e.target.value)} />

Patient & Visitor Count

setNumRoutine(Math.max(0, parseInt(e.target.value) || 0))} /> setNumWalkIn(Math.max(0, parseInt(e.target.value) || 0))} /> setNumEmergency(Math.max(0, parseInt(e.target.value) || 0))} /> setNumReports(Math.max(0, parseInt(e.target.value) || 0))} /> setNumRelatives(Math.max(0, parseInt(e.target.value) || 0))} /> setNumIpdRounds(Math.max(0, parseInt(e.target.value) || 0))} /> setNumVideoConsult(Math.max(0, parseInt(e.target.value) || 0))} />
{/* Right Column: Results */}

Estimated Completion Time

{estimatedEndTime ? (

{estimatedEndTime}

) : (

--:-- --

)}
{estimatedEndTime && (

Export Estimation

)}
); }; export default App;
top of page

COVID Home Care

Our Medical Team provides 24x7 care to your near and dear ones

NRI PACKAGE 3.jpg

Total Person care

We have a Medical and a Support Team to complete the spectrum of care

Testimonials from patients who enrolled for our Home Monitoring packages

It was timely nice help when we were extremely in confused state of mind regarding treatment options. In my family we four were covid positive. Hospitals and covid centers were flooded with covid patients. Sufficient beds were not available.in sch situation you provided the reliable platform My all family members would always be grateful to you . Thanks very much.

It's a v.good package.especially since my children stay abroad, and I stay all alone,I used to feel great relief when I meet the doctors and get their suggestions..they helped me to remain cheerful and always confident that I was getting better day by day.whatever medication they prescribed for me worked v.well and i feel they are the best doctors..

Helped a lot... mainly because u know that there is a doctor who is with you all the time for any specific trouble or physical complaints

We had treatment guidance assistance just a call away. Felt secured

It was quite helpful in this unforeseen situation

It was very helpful as my mom is a diabetic patient and tested positive with covid, so daily monitoring helped us a lot also we were ensured that she was stable and recovering properly

Helped in getting proper treatment to fight corona and moral support to me and my family to fight Corona.

Get a Quote

Thanks for submitting! We will send you more information.

© 2025 by Ashok One Hospital.

Sadguru Heights 1, Ashokvan, Dahisar East

, Mumbai, India 400068

+91 22 4939 7070

  • Instagram
  • Facebook
bottom of page