https://github.com/shravya1125/dynamic-hospital-resource-allocation
A Dynamic Resource Allocation Framework for Hospital Management Using Risk-Aware Scheduling
https://github.com/shravya1125/dynamic-hospital-resource-allocation
allocator chartjs css dynamic flask flask-application hospital-management-system jinja2 machine-learning postman python real-time resource-management risk-prediction scikit-learn triage
Last synced: 3 months ago
JSON representation
A Dynamic Resource Allocation Framework for Hospital Management Using Risk-Aware Scheduling
- Host: GitHub
- URL: https://github.com/shravya1125/dynamic-hospital-resource-allocation
- Owner: shravya1125
- License: apache-2.0
- Created: 2025-05-19T16:13:15.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-06-26T14:04:00.000Z (4 months ago)
- Last Synced: 2025-06-26T15:19:27.531Z (4 months ago)
- Topics: allocator, chartjs, css, dynamic, flask, flask-application, hospital-management-system, jinja2, machine-learning, postman, python, real-time, resource-management, risk-prediction, scikit-learn, triage
- Language: HTML
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dynamic Resource Allocation Framework for Hospital Management Using Risk-Aware Scheduling
## Project Overview
This project simulates a real-time hospital triage system using core Operating System concepts like dynamic scheduling, interrupt handling, and safe resource allocationβcombined with machine learning for patient risk prediction.
In emergency situations like pandemics, where resources such as ICU beds, ventilators, and doctors are limited, manual allocation can be slow and unsafe. Our system predicts the risk level of each patient using a trained ML model and dynamically allocates resources using an interrupt-aware rule-based allocator.
## πΈ Preview

## Key Features
- **Machine Learning Risk Prediction** (Decision Tree Classifier)
- **Interrupt-driven Resource Allocation**
- **Safe state resource management**
- **Flask RESTful APIs** (`/predict`, `/allocate`, `/dashboard`)
- **Interactive Dashboard** with Chart.js bar/pie visualizations
- **Modular Flask structure** with clear separation of model, allocator, routes, and frontend## π Project Structure
OS/
βββ app.py # Flask entry point
βββ core/
β βββ model.py # ML model logic
β βββ resource_manager.py # Resource allocation logic
β βββ routes.py # Flask API routes
βββ dataset/
β βββ labeled_patient_data.csv # Synthetic training data
βββ templates/
β βββ index.html # Patient input form
β βββ dash.html # Dashboard with charts
β βββ result.html # Prediction result page
βββ static/
β βββ dash.css # Styling for dashboard
βββ README.md
## How It Works
1. A user submits patient data through the frontend (age, BP, heart rate, comorbidity score).
2. The backend predicts the **risk level (0 or 1)** using a trained ML model.
3. The allocator checks available ICU resources and safely allocates them based on **priority (risk)**.
4. In case of an emergency, **interrupt handling** preempts lower-priority patients.
5. The dashboard updates charts in real-time to reflect system state.## Tech Stack
- **Python 3.11**
- **Flask** (API development)
- **scikit-learn** (ML model)
- **HTML5 + CSS3 + Chart.js** (Frontend)
- **Postman** (API Testing)
- **Jinja2** (Flask Templating)## π‘ Future Scope
- **Advanced Scheduling Algorithms**: Incorporate algorithms like Round Robin or Priority Scheduling for multi-patient queue simulation.
- **Enhanced ML Model**: Upgrade to ensemble models (e.g., Random Forest, XGBoost) or deep learning to improve prediction accuracy.
- **Historical Analytics**: Add time-series data storage and visual trends to observe ICU usage over time.
- **Real Hospital Integration**: Connect to real-time hospital data using APIs from IoT devices or hospital databases.
- **Load Simulation Testing**: Simulate thousands of requests using tools like JMeter to analyze system performance under load.
- **Security Layer**: Add login systems and role-based access (admin vs. staff) for data privacy and control.
- **More Charts and Analytics**: Introduce line graphs, risk progression plots, and patient recovery tracking.
- **Doctor Feedback System**: Add optional manual override inputs for doctors in edge cases.## Installation & Setup
1. **Clone the repository**
git clone https://github.com/your-username/OS-Hospital-Resource-Allocation.git
cd OS-Hospital-Resource-Allocation
2. **Install dependencies**pip install -r requirements.txt
3. **Run the Flask App**
python app.py
4. **View the Dashboard**
Open your browser and go to:
π [http://127.0.0.1:5000/dashboard](http://127.0.0.1:5000/dashboard)## π€ Contributing
1. Fork the repo
2. Create a new branch (`git checkout -b feature-name`)
3. Commit your changes
4. Push to the branch (`git push origin feature-name`)
5. Create a pull request