UMass CS520 Fall 2023 Project
pip3 install -r requirements.txt
cd src
pip3 app.py
You will see a message similar to "Running on http://127.0.0.1:5000". Open the link on your browser and you can start experimenting with the app.
For doctors, the profiles already exist in the database. You can log in with the following username/password pairs to experiment. hconboy/doctor11 dmanus/doctor22
For patients, you can either create new profiles, or use the following username/password pairs that already exist in the database. jsmith/1234 smith/1234
The flask app takes care of the routing and rendering of html pages. It also makes sure the logic works between patient login, doctor login, and scheduling.
- Returns the welcome page using the render template function
- Returns the patient login page using the render template function
- returns an error message if the username or password is wrong
- Once the patient presses submit in the login page, the user name and password is verified
- If it is valid, the patient portal is open, creates a session for the patient
- Receives the user details using the patient_login from the mongo.py
- Else the patient login error app route is triggered
- returns the patient register page using the render template function
- returns an error message if the username already exists when the patient registers
- receives all the information from the "patient_register" page
- Checks if username already exists or not using the patient_exists
- If not Stores all the information to the database using the add_patient function
- Else returns the "Patient_register_userexist"
- removes the sessions id
- redirect to the home page
- returns the doctor login page using the render template function
- returns an error message if the username or password is wrong
- Once the doctor presses submit in the login page, the user name and password is verified
- If it is valid, the Doctor portal is open, Creates a session for the doctor
- Else the doctor login error app route is triggered
- removes the sessions id
- redirect to the home page
- receives the user details from the patient_login_submit and returns the patient portal page along with the user_details
- receives the doctor_id from the Doctor_list page
- Calls the get_doctor_schedule using the doctor_id
- Renders the patient-doctor-dashboard.html and sends the schedule to the html file
- triggered when patient clicks request an appointment
- renders the Doctor list page using the render_template function
- gets the schedule of the doctor using the get_doctor_schedule
- renders the doctor-dashboard page along sending the schedule of the doctor
- Receives the day and time of the appointment using the appt variable
- Receives the patient details using the patient id from the sessions and calls the book appointment function
- redirect backs to the PatientPortal
- receives the day and time using the appt variable
- receives the schedule using the doctor id
- receives the patient who booked the appointment using the get_patient
- extracts the user_details and renders the doctor appointment view page using the user_details
- receives all the patient vitals from the doctor appointment view page
- stores it in the database using the update appointment function
- redicrects to the doctor_portal page
- receives the patient id, day and time using the appt_pat_id variable
- gets all the appointments using the get_all_appointments using the patient id
- renders the medical history record which takes in the day, time and appointments list
- patient_exists to check if the user with the given username exists
- add_patient to register user
- patient_login to authenticate user
- applied fernet class from cryptography module for authentication security
- tests for CRUD operations located under the function in commented try-except
- doctor_exists to check if the doctor with the given username exists
- NO REGISTER: Since it is assumed that the doctor is already in the hospital network
- doctor_login to authenticate doctor
- applied fernet class from cryptography module for authentication security
- tests for CRUD operations located under the function in commented try-except
- Create schedule
- get_doctor_schedule by DoctorID
- update_schedule
- tests for CRUD operations located under the function in commented try-except
- book_appointment with doctor_id, patient_id, day, hour, reason
- Add appointment to doctor schedule
- create_appointment
- add appointment to the appointments table, partial information
- get_appointment with doctor_id, day, hour
- update_appointment
- During the visit, doctor can update the appointments table with:
- Blood pressure
- Beats per minute
- Oxygen Saturation
- Doctor Notes
- During the visit, doctor can update the appointments table with:
- get_all_appointments with patient_id
- Patient's history of appointments with all information in the form of a list of objects for all the visits regardless of the doctor, iterable and unwrappable with a for loop
- tests for CRUD operations located under the function in the commented try-except
-
MainDB:
- doctors collection
- Document
- DoctorID
- username
- name
- password
- key
- Specialty
- Document
- patients collection
- Document
- PatientID
- username
- name
- password
- key
- history
- allergies
- Document
- schedule collection
- Document
- DoctorID
- Monday
- "8-9": "PatientID"
- "9-10": "PatientID"
- ...
- Tuesday
- ...
- Wednesday
- ...
- Thursday
- ...
- Friday
- ...
- Document
- appointments collection
- Document
- DoctorID
- PatientID
- Day
- Time
- Reason
- BP
- BPM
- OxySat
- DocNotes
- Document
- doctors collection
-
Purely a testing update