Skip to content

bdvinod788/easecare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ EaseCare β€” AI-Powered In-Hospital Patient Safety Platform

A hackathon MVP built for Build4SC β€” connecting patients, nurses, and families through real-time AI-driven clinical intelligence.


🎯 What is EaseCare?

EaseCare is a modular, role-based hospital safety platform that uses large language models to bridge the gap between patients and care teams. It enables:

  • Patients to report symptoms, request help, and receive personalized AI responses
  • Nurses to monitor all patients on a live dashboard with AI-generated pre-visit briefings
  • Families to stay informed and communicate with the care team

🧱 Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    React Frontend                    β”‚
β”‚         (Vite + React + Axios β€” port 5173)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚  /api/* (proxied)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              FastAPI Backend (port 8000)             β”‚
β”‚         SQLite DB  Β·  SQLModel ORM                  β”‚
β”‚   /api/patients  /api/alerts  /api/family            β”‚
β”‚   /api/discharge                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  AI Service Layer                    β”‚
β”‚  Primary:  Gemini 2.5 Flash (Google)                β”‚
β”‚  Fallback: Gemini 2.0 Flash β†’ Gemini Flash Lite     β”‚
β”‚  Final:    OpenAI gpt-4o-mini                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

Build4SC/
β”œβ”€β”€ frontend/                   # React app (Vite)
β”‚   └── src/
β”‚       β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ Patient.jsx     # Patient bedside dashboard
β”‚       β”‚   β”œβ”€β”€ Nurse.jsx       # Nurse monitoring dashboard
β”‚       β”‚   β”œβ”€β”€ Family.jsx      # Family portal
β”‚       β”‚   β”œβ”€β”€ Discharge.jsx   # Discharge planning
β”‚       β”‚   └── Landing.jsx     # Role selection landing
β”‚       └── lib/
β”‚           └── api.js          # Axios API client
β”‚
β”œβ”€β”€ overall_backend/            # Main FastAPI backend
β”‚   β”œβ”€β”€ main.py                 # App entry point + CORS
β”‚   β”œβ”€β”€ models.py               # SQLModel DB models
β”‚   β”œβ”€β”€ database.py             # SQLite engine
β”‚   β”œβ”€β”€ seed_db.py              # DB seeder (6 patients)
β”‚   └── routers/
β”‚       β”œβ”€β”€ patients.py         # Patient CRUD + LLM triage
β”‚       β”œβ”€β”€ alerts.py           # Alert management
β”‚       β”œβ”€β”€ family.py           # Family message triage
β”‚       └── discharge.py        # Discharge profiles
β”‚
β”œβ”€β”€ llm_backend/                # LLM service layer
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── ai_service.py       # Gemini β†’ OpenAI cascade
β”‚   └── .env                    # API keys (git-ignored)
β”‚
β”œβ”€β”€ reset_margaret.py           # Reset patient 4B to seed state
└── sentinel.db                 # SQLite database (auto-created)

πŸš€ Getting Started

Prerequisites

  • Conda with a sentinel environment
  • Node.js 18+
  • API keys for Google Gemini and OpenAI

1. Clone & Install

git clone https://github.com/bdvinod788/easecare.git
cd easecare

Backend (Python):

conda activate sentinel
pip install -r llm_backend/requirements.txt

Frontend (Node):

cd frontend
npm install

2. Configure API Keys

Create llm_backend/.env:

GEMINI_API_KEY="your-google-gemini-api-key"
OPENAI_API_KEY="your-openai-api-key"

3. Seed the Database

conda activate sentinel
python -m overall_backend.seed_db

This creates 6 mock patients with realistic clinical histories and AI summaries.

4. Run the Stack

Terminal 1 β€” Backend:

conda activate sentinel
uvicorn overall_backend.main:app --reload --port 8000

Terminal 2 β€” Frontend:

cd frontend
npm run dev

🎭 Dashboards & Features

πŸ›οΈ Patient Dashboard (/patient)

  • Report symptoms with severity slider (1–10)
  • Request help: Food/Water, Medication, Personal Care, Room
  • Receive personalized AI responses by name (not robotic system messages)
  • Voice note support (Web Speech API)
  • Call Nurse / Emergency alert buttons

πŸ‘©β€βš•οΈ Nurse Dashboard (/nurse)

  • Live patient list with priority badges (πŸ”΄ Critical / πŸ”” Attention / βœ… Stable)
  • AI pre-visit brief auto-generated after every patient interaction
  • Inline condition editor β€” update diagnosis text and severity from the dashboard
  • Focus Mode β€” filter to top-priority patients only
  • Patient search, filter by priority/source, trend indicators
  • Notes & team chat per patient

πŸ‘¨β€πŸ‘©β€πŸ‘§ Family Portal (/family)

  • Submit concerns about a patient
  • AI triage of family messages (urgency classification)
  • Plain-language AI explanations of medical terms

πŸ€– AI Pipeline

Every patient interaction triggers an AI call:

Patient submits symptom/request
         ↓
Backend builds personalized system prompt
         ↓
ai_service.call_llm_json()
         ↓
  Try: Gemini 2.5 Flash
  Fallback: Gemini 2.0 Flash
  Fallback: Gemini 2.0 Flash Lite (3s wait between retries)
  Fallback: OpenAI gpt-4o-mini
  Fallback: Safe static response (never crashes)
         ↓
Returns: { ai_signal (nurse), patient_message (patient), urgency, escalation }
         ↓
Nurse AI summary regenerated + stored in DB

All responses include:

  • patient_message β€” warm, first-name personalized reply shown to the patient
  • ai_signal β€” clinical note shown to the nurse
  • urgency β€” low | medium | high | critical
  • escalation β€” triggers alert + severity upgrade if true

πŸ› οΈ Utility Scripts

Script Purpose
python -m overall_backend.seed_db Wipe and reseed entire DB
python reset_margaret.py Reset only patient 4B (Margaret Chen) to seed state
python test_llm_direct.py Quick LLM smoke test
python test_e2e.py End-to-end API test against live backend

πŸ”‘ Environment Variables

Variable Required Description
GEMINI_API_KEY βœ… Google AI Studio key (primary LLM)
OPENAI_API_KEY βœ… OpenAI key (fallback LLM)

πŸ§ͺ API Endpoints

Method Endpoint Description
GET /api/health Health check
GET /api/patients/ All patients (nurse dashboard)
GET /api/patients/{id} Single patient detail
POST /api/patients/{id}/report Submit symptom report
POST /api/patients/{id}/message Submit help request
PATCH /api/patients/{id}/condition Update condition/severity
GET /api/alerts/ All active alerts
POST /api/family/{id}/triage Submit family concern
POST /api/family/{id}/explain Get plain-language explanation
GET /api/discharge/{id} Discharge profile

πŸ—οΈ Tech Stack

Layer Technology
Frontend ReactJS, Vite, Axios, CSS
Backend FastAPI, SQLModel, SQLite, Uvicorn
AI Google Gemini 2.5 Flash, OpenAI gpt-4o-mini
Language Python 3.11, JavaScript (ES2022)
Env Conda (sentinel)

πŸ‘₯ Team

Built for Build4SC Hackathon by the EaseCare team.

Team members: Ahhana Gupta, Preeti Ramesh, Sarvesh V., Vinod Devaraju


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors