amhkhowaja / patients-portal-for-students

0 stars 65 forks source link

Patients Portal

Introduction

Patient Portal is a basic Patient management system, where the user (ie. receptionist) should do the folowing tasks:

Prerequisites

Installation Steps

Follow these steps to install the repository requirements:

  1. Fork this Repository Click on button: image

Then, Rename the repo name to patients-portal and click Create Fork.

  1. Clone the Repository from your list of repositories:
git clone https://github.com/<your-username>/patients-portal.git
  1. Navigate to the Repository:

    cd patient-portal
  2. Create a virtual environment

    python -m venv venv
  3. Activate the virtual environment

In linux (gitbash)

source venv/bin/activate

In windows

.\\venv\Scripts\activate.bat
  1. Install python packages to run the application
    python -m pip install -r requirements.txt

Development

You can check the whole repository to check how the workflow works.

Here is the breakdown:

Testing the APIs

You can use the git bash to execute these shell commands if you don't have the linux or wsl.

In Terminal :

First Run the flask server by running the API_CONTROLLER (src/api_controller.py) directly or using linux command:

python src/api_controller.py

Once the Flask server is running, open a new terminal and keep the server running in the first one.

Then,

cd tests

Then,

bash create_patient.sh

If it returns the patient_id in the response then meaning that Patient has been created successfully and added to the database.

Then for listing the created patients,

bash list_patients.sh

Then for listing the created patients with *name* as parameter,

bash list_patient_by_name.sh

Then for getting a patient details with certain id,

bash get_certain_patient.sh

Then, to update the patient,

bash update_patient.sh

Finally, to delete the created patient,

bash delete_patient.sh

Testing the Final Application

This is E2E test case, which is going to test the functionality of the patient portal:

It creates the patient object from the Patient class and commits the patient to the database using the client request.

Test 1 (basic): Simple test case for the creating the patient object and commiting it.

Test 2 (validation of room and ward): it is invoked after Test 1 for the same patient. Therefore you need to think of the business logic for the commit method in patient.py that when the first patient is created, it can not be created again therefore it has to be updated using (PUT) request.

python src/test_application.py

You can Refer:

Flask Documentation: https://flask.palletsprojects.com/en/3.0.x/quickstart/#routing

Flask Cheatsheet: https://s3.us-east-2.amazonaws.com/prettyprinted/flask_cheatsheet.pdf

Swagger Editor (Playground): https://editor.swagger.io/

Python OOP : https://docs.python.org/3/tutorial/classes.html

Feedback

If you need more clarification, please ping me. I will update the readme file.