DevHub@iLab's SummerBuild 2025 Project
HospitalIQ is a comprehensive hospital management system that combines intelligent patient flow prediction, room allocation optimization, and AI-powered medical assistance. Built with modern web technologies and machine learning capabilities.
- LangGraph-based Conversational AI with conditional database querying
- Smart Query Routing - automatically determines whether to access database or provide general responses
- Vector Search Integration for medical skills and specialties
- DateTime Awareness - provides current time/date information
- Database Integration with medical staff and skills data
- LSTM Machine Learning Model for predicting patient admission patterns
- Multi-feature Time Series Analysis with cyclical encoding (hourly, daily patterns)
- 24-hour Forecast Horizon for capacity planning
- Flask API for real-time predictions
- Real-time Room Availability with interactive floor plans
- Patient Entry Management with severity classification
- Room Assignment System with visual grid interface
- Patient Database with full CRUD operations
- IoT Integration for alerts and monitoring
- Patient Allocation - Assign patients to available rooms
- Capacity Planning - Predict and manage hospital capacity
- Staff Management - Track medical staff specialties and skills
- Real-time Monitoring - Dashboard with KPIs and alerts
HospitalIQ/
โโโ backend/ # Django REST API
โ โโโ chatbot/ # AI Chatbot with LangGraph
โ โโโ users/ # Patient & Staff Management
โ โโโ hospitaliq/ # Main Django App
โโโ frontend/ # Next.js React Application
โ โโโ hospitaliq/ # Modern UI with Material-UI
โโโ notebooks/ # ML Development & Analysis
โ โโโ model.py # LSTM Model Architecture
โ โโโ app.py # Flask Prediction API
โ โโโ *.ipynb # Jupyter Notebooks
โโโ output/ # Generated Data (FHIR, Metadata)
- Django 5.2.3 - REST API framework
- Django REST Framework - API development
- Knox Authentication - Token-based auth
- SQLite - Database (doctors.db for chatbot)
- CORS Headers - Cross-origin support
- LangChain & LangGraph - AI orchestration framework
- OpenAI GPT-4o-mini - Language model
- ChromaDB - Vector database for embeddings
- PyTorch - Deep learning framework
- Scikit-learn - ML utilities
- LSTM Networks - Time series prediction
- Next.js 15.3.3 - React framework with App Router
- Material-UI (MUI) - Component library
- TanStack Query - Data fetching and caching
- Axios - HTTP client
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS
- Jupyter Notebooks - Analysis and development
- Pandas & NumPy - Data manipulation
- Flask - ML model serving
- Pickle - Model serialization
- Python 3.11+
- Node.js 18+
- OpenAI API Key
-
Clone and navigate to backend
cd backend
-
Create virtual environment
python -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # macOS/Linux
-
Install dependencies
pip install -r requirement.txt
-
Environment setup
# Create .env file with your OpenAI API key echo "OPENAI_API_KEY=your_openai_api_key" > .env
-
Database setup
python manage.py migrate python manage.py createsuperuser
-
Run Django server
python manage.py runserver
-
Navigate to frontend
cd frontend/hospitaliq
-
Install dependencies
npm install
-
Environment setup
# Create .env.local echo "NEXT_PUBLIC_BACKEND_URL=http://localhost:8000" > .env.local
-
Run development server
npm run dev
-
Navigate to notebooks
cd notebooks
-
Run Flask prediction API
python app.py
- Frontend Dashboard: http://localhost:3000
- Backend API: http://localhost:8000
- ML Prediction API: http://localhost:5000
- Django Admin: http://localhost:8000/admin
- Medical Staff - Full dashboard access with patient management
- General Users - Chatbot access only
- Add new patients via dashboard
- Create patient entries with severity levels
- Assign rooms using interactive floor plan
- Monitor patient status and room availability
- Access chatbot interface
- Ask questions about:
- Medical staff information
- Hospital specialties
- Current date/time
- General medical knowledge
- Get intelligent responses with database integration
- Send POST request to
/api/predict
with current patient count - Receive 24-hour admission forecast
- Use predictions for capacity planning
cd backend/chatbot
python test_datetime_tools.py
python test_datetime_chatbot.py
python enhanced_test.py
cd backend/chatbot
python langgraph_chatbot.py
POST /api/auth/login/
- User loginPOST /api/auth/logout/
- User logout
GET/POST /patient/
- List/Create patientsGET/PUT/DELETE /patient/{id}/
- Patient CRUDGET/POST /patient_entry/
- Patient entriesPOST /patient_entry/{id}/assign_room/
- Room assignment
GET /room/availability/
- Floor availabilityGET /room/floor/{floor}/
- Rooms by floor
POST /chatbot/chatbot/
- Chat with AI assistant
POST /api/predict
- Get patient admission forecast
- Patient - Patient information (name, DOB, etc.)
- PatientEntry - Hospital admissions with severity
- Room - Hospital rooms with capacity and occupancy
- User - Staff and user accounts
- Doctor - Medical staff with specialties (chatbot DB)
- Skills - Medical skills database (chatbot DB)
# Backend (.env)
OPENAI_API_KEY=your_openai_api_key
SECRET_KEY=your_django_secret_key
# Frontend (.env.local)
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
- LSTM Model: 64 hidden units, 24-hour horizon
- Vector Store: ChromaDB with text-embedding-3-small
- Chat Model: GPT-4o-mini for cost efficiency
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open Pull Request
- Real-time IoT Integration for medical devices
- Advanced Analytics Dashboard with predictive insights
- Mobile Application for on-the-go access
- Integration with Hospital Information Systems
- Multi-language Chatbot Support
- Advanced ML Models for outcome prediction
- Containerization with Docker
- Cloud Deployment (Azure/AWS)
- Performance Optimization for large datasets
- Enhanced Security with OAuth2
- Real-time Notifications with WebSockets
This project is licensed under the MIT License - see the LICENSE file for details.
SummerBuild 2025 - DevHub@iLab
- Duration: Summer 2025 Development Program
- Focus: Healthcare Technology Innovation
- Team: Student developers and researchers
- Goal: Create practical solutions for hospital management
For questions and support:
- Project Issues: Use GitHub Issues
- Documentation: Check inline code comments
- Development: Follow setup instructions above
Built with โค๏ธ by summerCubs
Revolutionizing hospital management through AI and modern web technologies