Skip to content

Latest commit

 

History

98 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Health Management System User Manual

Application Overview

This application is a web-based health management system with two primary user roles: User (patients) and Doctor. The system allows users to register, log in, track their health data, book appointments, and manage account settings. Doctors can manage patient health records, view and manage schedules, and update appointment statuses.

Accounts

  • User Account

      Username: kerwin
      Password: 123456
  • Doctor Account

      Username: doctor
      Password: 123456

Environment Setup

Prerequisites

  • Python: Ensure Python 3.x is installed. Check the installation with:

    python3 --version
  • Install required libraries: Run the following command to install necessary dependencies:

    pip install flask bcrypt cryptography matplotlib sqlite

Setup Virtual Environment

To keep dependencies isolated, create a virtual environment:

python3 -m venv venv

Activate the virtual environment:

Windows:

venv\Scripts\activate

Linux:

source venv/bin/activate

Running the Application

  • Start the Flask Server: Run the following command in your terminal:

    python app_nosql.py
  • Access the Application: Open a web browser and navigate to:

    http://127.0.0.1:5000
    

Application Configuration

Secret Key Setup

The secret key in app.py secures sessions and flash messages:

app.secret_key =your_secret_key

Replace 'your_secret_key' with a unique secure key, e.g., generated by Python:

import secrets
secrets.token_hex(16)

Update the generated key in app.py:

Copy code
app.secret_key = 'generated_secret_key'

Application Port and Debug Mode By default, the application runs on port 5000 with debug mode enabled:

app.run(debug=True)

Debug mode is useful during development but should be disabled in production for security:

app.run(debug=False)

Application Features and Usage

  1. User Registration:

    • On the main page, click Register to create an account.
    • Complete the registration form with:
      • Username
      • Password (encrypted and stored securely)
      • Email
      • Phone Number
      • Address
    • Click Submit to create the account. On successful registration, you’ll be redirected to the login page. If an error occurs (e.g., duplicate username), a message will be displayed.
  2. Login:

    • On the main page, enter your Username and Password.
    • Click Login to access the appropriate dashboard (User or Doctor).
    • Incorrect credentials will display a login failure message.
  3. User Dashboard:

    • As a regular user, the User Dashboard provides health data tracking and visualizations.
    • Features include:
      • Health Data Visualization: View blood pressure and blood sugar levels over time as bar charts (images saved in the static/images folder).
      • Health Data Submission: Users can submit new blood pressure and blood sugar data.
  4. Doctor Dashboard:

    • Doctors have access to the Doctor Dashboard, which allows them to manage patient health records and schedules.
    • Key Features:
      • Patient Data Access: View patient health history, such as blood pressure, blood sugar, and prescribed medications.
      • Appointment Schedule: Access upcoming appointments and manage clinic schedules.
  5. Appointment Management:

    • Users can view available appointment slots and book a convenient time.
    • Booking:
      • Go to the Appointments page.
      • Select an available date and time slot and confirm.
    • Cancelling and Editing:
      • Users can cancel or edit existing appointments from their dashboard.
  6. User Health Data Submission:

    • To log health metrics:
      • Go to the User Health section.
      • Enter Blood Pressure and Blood Sugar values.
      • Click Submit to save the data. The data is timestamped and stored in the user_health table.
  7. Account Management:

    • Update account details, including Email, Phone Number, and Address in Settings.
    • Change Password: Enter a new password and confirm it to update securely.
    • Delete Account: Users can delete their accounts, which will remove all associated data.
  8. Logout:

    • Click Logout to securely end your session.

Error Handling and Troubleshooting

  • Debugging Mode: Debug mode (app.run(debug=True)) provides detailed error messages and line-by-line issues in the console, helping identify specific errors during development.

  • Session Issues: If encountering session errors (e.g., login problems), check that the secret_key in app.py is set securely.

  • Matplotlib Visualization Issues: Ensure matplotlib is installed and correctly imported. If visualizations don’t display correctly, verify the path to saved images (e.g., static/images/bpchart.png and static/images/bschart.png) in user_dashboard.html.

By following these steps, you should be able to resolve most common issues encountered during setup and usage of the application.

About

INF 2003 Database System Project First Half

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages