About NextStep-Care


💡 Inspiration

India discharges over 40 million patients annually — and then largely forgets them.

The moment a patient walks out of a hospital, their access to continuous medical supervision drops to near zero. No automated vitals tracking. No real-time doctor visibility. No early warning when something goes wrong. The result is a silent, preventable crisis: 1 in 5 patients is readmitted within 30 days, and a significant fraction of those readmissions were entirely avoidable with timely intervention.

I wanted to solve the specific, underserved problem that sits between hospitalisation and full recovery — a gap that no existing platform addresses comprehensively, especially for rural and low-literacy populations in countries like India where the doctor-to-patient ratio stands at approximately 1:1,456.

NextStep-Care was born from one question:

What if the hospital didn't end at the door?


🔧 What It Does

NextStep-Care is a full-stack AI-powered post-discharge recovery ecosystem with two dedicated interfaces — one for doctors, one for patients — connected by a real-time cloud backend and a custom predictive triage algorithm.

👨‍⚕️ For Doctors — Physician Command Center

  • Monitor all discharged patients from a single unified dashboard
  • Run AI Predictive Triage — a custom O(n) weighted scoring algorithm using Ordinary Least Squares regression detects not just current vital danger but worsening trajectories, flagging patients before a crisis occurs
  • Launch instant Jitsi video consultations — no downloads, no friction
  • Schedule appointments with automated in-app and simulated SMS/WhatsApp notifications

📱 For Patients — Recovery Hub

  • Log daily vitals (BP, heart rate, blood sugar, hemoglobin) through a simplified, colour-coded interface designed for zero tech-literacy
  • View recovery trends through interactive Chart.js visualisations
  • Chat 24/7 with MediBuddy — a Gemini-powered AI assistant — in English or Hindi
  • Upload symptom images for AI-powered visual description and guidance
  • Trigger emergency SOS alerts when needed

⚙️ The Algorithm

The triage engine runs a custom weighted multi-parameter risk scorer in O(n) time with O(1) space. It normalises 4 vital parameters against clinical reference ranges, then applies OLS linear regression to detect worsening trends.

score ≥ 0.65  →  🔴 HIGH    — Immediate physician review required
score ≥ 0.35  →  🟡 MEDIUM  — Monitor closely, schedule follow-up
score  < 0.35  →  🟢 LOW     — Stable, continue routine monitoring

A patient with borderline readings but a rising BP trajectory gets flagged — catching deterioration 24–48 hours earlier than threshold-only systems.

Parameter Weight Clinical Rationale
Systolic BP 30% #1 predictor of cardiac events post-discharge
Heart Rate 25% Reflects acute distress and arrhythmia risk
Blood Sugar 20% Critical for diabetic and post-surgical patients
Hemoglobin 15% Flags anaemia, internal bleeding, malnutrition
Trend Penalty 10% Worsening trajectory increases risk even on borderline readings

🛠️ How We Built It

Architecture: Full-stack monorepo — Node.js + Express.js backend, MongoDB Atlas cloud database, vanilla JS + HTML/CSS frontend with Glassmorphism UI, deployed on Render via CI/CD.

The Custom Algorithm

Written entirely from scratch in pure JavaScript with no external libraries. Uses piecewise linear normalisation and OLS regression in a single O(n) pass:

slope = (n·ΣXY − ΣX·ΣY) / (n·ΣX² − (ΣX)²)

Clinically weighted based on post-discharge risk literature. Fully unit-tested with Node's built-in test runner — 20 test cases, zero extra dependencies.

AI Layer

Google Gemini 2.5 Flash handles both text (medical guidance, triage narration) and vision (symptom image analysis). The architecture deliberately separates concerns:

The algorithm owns the risk decision. Gemini only explains it.

This makes the system auditable and safe — an LLM never overrides a deterministic clinical judgement.

Security

  • Custom RBAC — patients cannot access doctor interfaces or other patient records
  • JWT authentication + bcrypt password hashing (cost factor 10)
  • Email OTP verification via Nodemailer — 6-digit code, 10-minute expiry
  • Enforced at both API route and frontend level

Testing

20 unit and integration tests covering OTP generation, bcrypt, JWT, and all three algorithm functions — including edge cases like null vitals, single-entry trend detection, and rising vs. flat trajectory comparison.

npm test   # Node 18+ built-in runner — zero extra dependencies

😤 Challenges We Ran Into

1. Designing for Zero Tech-Literacy at Scale

Building a dashboard for a doctor is straightforward. Building one for a 65-year-old post-surgery patient in rural India — who may have never used a smartphone — required rethinking every UI decision. Font sizes, colour semantics (green = safe, red = danger, no text required), single-tap interactions, and bilingual support all had to work together without adding cognitive load. This was harder than any technical problem.

2. Algorithm Calibration Against Real Clinical Ranges

Choosing the right thresholds for the triage algorithm wasn't arbitrary — incorrect boundaries produce false positives that erode doctor trust, or false negatives that miss real crises. I cross-referenced WHO post-discharge guidelines and standard clinical reference ranges to calibrate each parameter. The trend penalty weight (10%) was particularly difficult — too high and stable patients get flagged; too low and early deterioration goes undetected.

3. Keeping AI Medically Safe

LLMs can confidently produce incorrect medical advice. I engineered the MediBuddy prompt architecture to keep Gemini in a strict advisory role — it never diagnoses, never overrides the algorithm, and for image analysis it is constrained to objective visual description only, always appending a clinical disclaimer. Navigating these guardrails without making the assistant useless took significant prompt engineering iteration.


🏆 Accomplishments We're Proud Of

A genuinely novel algorithm. The OLS trend-detection layer on top of a weighted vital scorer is not a standard approach in student projects — it produces a risk system that thinks in trajectories, not just snapshots. Running in O(n) time and O(1) space makes it scalable to any patient volume without architectural changes.

A working, deployed, live product. Not a prototype. Not a mockup. A real full-stack application live on the internet, with a cloud database, AI integration, video calling, email OTP, and role-based authentication — all built and deployed solo.

Genuine social impact architecture. The ASHA worker integration model and bilingual support aren't afterthoughts — they are core to the platform's design philosophy. Healthcare technology that only works for urban smartphone users is incomplete technology.


🌍 Social Impact & SDG Alignment

✅ SDG 3 — Good Health & Well-being

India records 40+ million hospital discharges annually. Nearly 1 in 4 patients are readmitted within 30 days — most preventably. NextStep-Care transforms post-discharge care from "wait until complications occur" to "detect deterioration early and intervene immediately."

✅ SDG 10 — Reduced Inequalities

Nearly 67% of India's population lives in rural areas where continuous medical follow-up is nearly impossible. NextStep-Care addresses this through:

  • ASHA Worker Integration — community health workers log vitals on behalf of patients without smartphones
  • Bilingual Support — full English and Hindi interface
  • Low-bandwidth optimisation — functional on 3G networks

✅ SDG 9 — Industry, Innovation & Infrastructure

By decentralising hospital-quality monitoring into a cloud-native platform, NextStep-Care reduces physical strain on hospital infrastructure — freeing beds for critical patients while keeping recovering patients safely monitored at home.


📚 What We Learned

Algorithms need clinical grounding, not just computational elegance. Choosing a weight of 30% for systolic BP versus 25% for heart rate isn't a mathematical decision — it's a clinical one. This project forced me to engage seriously with medical literature to make engineering decisions, which changed how I think about domain-specific algorithm design.

Separation of concerns between AI and deterministic logic is critical in healthcare. Letting an LLM own a risk classification decision is dangerous. Letting a deterministic algorithm own it — and using the LLM only to communicate the result — is safe and auditable. This architectural principle applies far beyond healthcare.

Empathy is a technical skill. The hardest engineering problem on this project wasn't the algorithm or the deployment — it was making a complex medical system feel simple enough for a patient who is sick, anxious, and possibly non-English-speaking. That required as much iteration as any backend feature.


🔭 What's Next for NextStep-Care

Roadmap Item Description
📡 IoT & Wearable Integration Auto-sync heart rate and SpO2 from smartwatches — eliminating manual data entry
🗣️ Multilingual Voice AI Speech-to-text in Hindi and regional Indian dialects for rural patients
🏥 ABHA Integration Connect with India's Ayushman Bharat Health Account for verified medical history
📶 Offline-First PWA Full functionality in zero-connectivity environments with background sync
📊 Predictive Readmission Scoring Extend the algorithm with a 30-day readmission probability model

The long-term vision:

A scalable digital recovery infrastructure capable of delivering hospital-quality follow-up care to every discharged patient — regardless of geography, language, or economic status.


NextStep-Care · Aligned with SDG 3 · SDG 9 · SDG 10

Built With

Share this project:

Updates