The Hawaii Health Risk Assessment System is a Flask-based web application designed to evaluate health risks based on user input. Using a generative AI model (Google Gemini), it provides health insights and allows users to book medical appointments. It also features an admin panel for visualizing user data and appointment statistics.
- Health Risk Assessment: Evaluates health risk based on personal information, lifestyle, medical history, symptoms, and health metrics.
- Generative AI Insights: Utilizes Google Gemini to analyze and generate personalized health insights.
- Appointment Booking: Users can schedule appointments with doctors.
- Admin Panel: View user data, appointments, and visualized charts of risk status and doctor appointments.
Ensure you have the following installed:
- Python 3.8+
- pip (Python package manager)
$ git clone https://github.com/mmfarabi/Hawaii-Health-Risk-Assessment-System.git
$ cd hawaii-health-risk-system
- Install required dependencies:
$ pip install -r requirements.txt
- Create a
.env
file in the project root and add your Google API key:GOOGLE_API_KEY=your_google_api_key_here
Run the following command to create the SQLite database:
$ python -c "from app import create_db; create_db()"
Start the Flask development server:
$ python app.py
By default, the application will run at http://127.0.0.1:5000/
.
- Home Page (
/
): Fill in the health questionnaire and receive personalized health insights. - Results Page (
/result
): View your health risk status and insights. - Appointment Booking (
/appointment
): Schedule a medical appointment. - Admin Panel (
/admin
): Access admin-only dashboards and data visualizations (requires developer access).
|-- app.py # Main Flask application
|-- templates/ # HTML templates
| |-- index.html # User input form
| |-- result.html # Display health insights
| |-- appointment.html # Appointment booking form
| |-- admin.html # Admin dashboard
|-- static/ # Static assets (CSS, JS, images)
|-- requirements.txt # Python dependencies
|-- README.md # Project documentation
|-- .env # Environment variables (not committed)
|-- health_risk_data.db # SQLite database (auto-created)
This application integrates the Google Gemini API for generating health insights. Ensure the API key is configured correctly in your .env
file.
- User Data: View detailed user-submitted health data.
- Appointment Data: Track booked appointments.
- Charts:
- Risk Status Distribution: Pie chart of users categorized by risk status.
- Doctor Appointment Distribution: Pie chart of appointments by doctor.
- Database Errors: Ensure the database file (
health_risk_data.db
) is writable and exists in the root directory. - Google API Errors: Verify your API key and ensure it has the required permissions.
- Missing Dependencies: Run
pip install -r requirements.txt
to install all required packages.
This project is licensed under the MIT License.
Feel free to fork this repository and submit pull requests for improvements or new features.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add YourFeature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
For any questions or feedback, open an issue on this repository or reach out to the project maintainers.