TakeCare is a Flask-based web application for monitoring patient vitals and generating alerts based on critical conditions. It includes Role-Based Access Control (RBAC) to ensure secure access for different medical staff.
- Dashboard: Overview of total patients, active alerts, today's vitals, critical patients, and recent alerts/admissions.
- Patient Management: Add, edit, view, and delete patient records.
- Vitals Tracking: Record patient vitals (Heart Rate, Blood Pressure, Temperature).
- Automated Alerts: Generates alerts automatically when vitals are outside normal ranges (e.g., Low/High Heart rate, High BP, Abnormal Temperature).
- Alerts Management: View active and resolved alerts, and mark alerts as resolved.
- Role-Based Access Control (RBAC):
- Staff: Can view and manage patients, record vitals, and view alerts.
- Admin: In addition to staff capabilities, admins can delete patients and manage user accounts (add/delete users).
- Backend: Python, Flask
- Database: SQLite, SQLAlchemy (ORM)
- Authentication: Flask-Login, Flask-Bcrypt
- Forms: Flask-WTF
- Frontend: HTML, CSS (Bootstrap 5 via CDN), FontAwesome
- Python 3.8+
-
Clone the repository or navigate to the project directory:
cd TakeCare -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Linux/macOS # venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the Database and create an Admin User: Run the seeding script to create the necessary tables and a default admin account..
python seeds.py
This will create an admin user with username
adminand passwordadmin. -
Run the application:
python app.py
-
Access the application: Open your web browser and go to
http://127.0.0.1:5000
- Log in using the default admin credentials (
admin/admin). - Navigate to the Dashboard for a quick overview.
- Go to the Patients menu to add a new patient.
- Once a patient is added, click on View and then Record Vitals to log their data.
- If vitals are abnormal, check the Alerts section for generated warnings.
- As an admin, you can manage other staff accounts in the Admin -> User Managementent section.
This application uses a development configuration and default secret keys. Do not use this in a production environment without changing the secret key and configuring a production WSGI server (like Gunicorn).