๐Ÿฅ MediScanAI

AI-Powered Hospital Management System โ€” Complete Edition

Live Queue ยท Prescriptions ยท AI Triage ยท Email Notifications ยท Doctor Fees ยท Emergency Reordering


๐Ÿ†• New Features

Feature Details
๐Ÿ”ด Live Queue Real-time queue page for all roles โ€” updates via WebSocket
๐Ÿ’Š Prescriptions Doctor issues prescriptions with AI drug suggestions + allergy warnings
๐Ÿ’ฐ Doctor Fees Consultation/follow-up/emergency fees shown during booking
๐Ÿ“Š Status Lifecycle 9 appointment statuses with counters in admin dashboard
๐Ÿšจ Emergency Reordering AI shifts all patients when emergency arrives, emails everyone
โฐ 5 Cron Jobs Reminders(1h), No-show(30m), Queue(5m), Fatigue(9pm), Reset(midnight)
๐Ÿ“ง 12 Email Templates Including prescription email, no-show notice
๐Ÿค– AI Drug Suggestions Rule-based AI suggests medicines, warns about patient allergies
๐Ÿ“‹ Status History Audit Every status change logged with role + reason

๐Ÿš€ Quick Start

unzip mediscanai-v7-final.zip && cd mediscanai-v7

# Backend
cd backend
cp .env.example .env
# Edit .env: add MONGODB_URI and JWT_SECRET
npm install
node seed.js       # Creates demo accounts
node server.js

# Frontend (new terminal)
cd frontend
npm install
npm run dev

Open: https://mediqueue-ai.vercel.app/login


๐Ÿ”‘ Demo Accounts

Role Email Password Fee
Admin [email protected] Admin@12345 โ€”
Dr. Sarah (Cardiology) [email protected] Doctor@123 $150 consult
Dr. Raj (General) [email protected] Doctor@123 $100 consult
Dr. Priya (Pediatrics) [email protected] Doctor@123 $120 consult
Patient (John) [email protected] Patient@123 โ€”
Patient (Mary) [email protected] Patient@123 โ€”

๐Ÿ“ What's New in V7

backend/
โ”œโ”€โ”€ routes/
โ”‚   โ”œโ”€โ”€ prescriptions.js   โ† NEW: issue/get prescriptions, AI drug suggestions
โ”‚   โ””โ”€โ”€ queue.js           โ† NEW: live queue endpoints (hospital/doctor/patient)
โ”œโ”€โ”€ services/
โ”‚   โ””โ”€โ”€ queueManager.js    โ† UPDATED: emergency reorder + hospital broadcast
โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ Appointment.js     โ† UPDATED: prescription schema, consultationFee, statusHistory
โ”‚   โ””โ”€โ”€ User.js            โ† UPDATED: consultationFee, followUpFee, emergencyFee, bio
โ”œโ”€โ”€ templates/emails/
โ”‚   โ”œโ”€โ”€ prescription.js    โ† NEW: prescription email with medicine table
โ”‚   โ””โ”€โ”€ noShow.js          โ† NEW: no-show notice email
โ””โ”€โ”€ server.js              โ† UPDATED: 5 cron jobs, new socket rooms, new routes

frontend/
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ LiveQueue.jsx       โ† NEW: real-time queue for all roles
โ”‚   โ”œโ”€โ”€ DoctorPrescriptions.jsx โ† NEW: doctor issues prescriptions w/ AI
โ”‚   โ”œโ”€โ”€ Prescriptions.jsx   โ† NEW: patient views/prints their prescriptions
โ”‚   โ”œโ”€โ”€ BookAppointment.jsx โ† UPDATED: shows doctor fee during booking
โ”‚   โ”œโ”€โ”€ AdminDashboard.jsx  โ† UPDATED: status lifecycle counters + fee column
โ”‚   โ”œโ”€โ”€ EditProfile.jsx     โ† UPDATED: fee fields for doctors
โ”‚   โ””โ”€โ”€ DoctorAppointments.jsx โ† UPDATED: prescription link after completion
โ”œโ”€โ”€ components/
โ”‚   โ””โ”€โ”€ Sidebar.jsx         โ† UPDATED: Live Queue ๐Ÿ”ด and Prescriptions links
โ””โ”€โ”€ App.jsx                 โ† UPDATED: all new routes registered

๐Ÿค– AI Triage: 14/14 Test Cases Pass

Input Result
"cant able to breath from 2 hour" ๐Ÿšจ EMERGENCY
"chest pain sweating" ๐Ÿšจ EMERGENCY
"seizure convulsions" ๐Ÿšจ EMERGENCY
"fever 103 degrees" โš ๏ธ HIGH
"mild headache tiredness" โœ… LOW

๐Ÿ“ง Email Notifications Sent For

Booking ยท Acceptance ยท Rejection ยท Cancellation (patient/doctor) ยท Rescheduling (doctor/AI) ยท Reminder (1hr before) ยท No-show ยท Prescription ยท Doctor Approved/Rejected


๐ŸŒ Key API Endpoints

GET  /api/queue/hospital          โ€” Full hospital live queue
GET  /api/queue/doctor/:id        โ€” Single doctor queue
GET  /api/queue/patient/my        โ€” Patient's queue position
GET  /api/queue/stats             โ€” Status lifecycle counters

POST /api/prescriptions/:apptId   โ€” Issue prescription (doctor)
GET  /api/prescriptions/:apptId   โ€” Get prescription
GET  /api/prescriptions/patient/all โ€” Patient's all prescriptions

GET  /api/doctors                  โ€” List doctors WITH fee info
GET  /api/doctors/fees/:id         โ€” Get single doctor fees

Built With

Share this project:

Updates