An open API service indexing awesome lists of open source software.

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

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
![Dashboard](https://github.com/user-attachments/assets/f50ac36d-1115-445d-93f5-66e9c55e5bcd)
![image](https://github.com/user-attachments/assets/70241c1a-0b5e-49d1-8c73-d9c4f3ac5075)

## 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