There are various challenges that come with soring patients' data using the traditional file system method, some of which include the tedious process of retrieving patient records, and also risk of massive data loss in case of natural calamities like fire. To help solve this, we created a web application, ABClinic, that helps store patient records in a database, and retrieve the records in just a few clicks. This ensures safety of patient information (including previous and future visits, and their health records).
The project was created using React JS, a JavaScript library for creating front-end applications, and Flask, a minimalist Python framework for creating back-end applications.
To contribute or have a local copy of this project in your development environment, follow the steps below:
-
Fork this project to create your own copy in your own GitHub Account
-
Clone the forked project using
git clone [email protected]:your-username/ABClinc.git
-
Navigate to the project's directory using your terminal or file explorer.
-
Run
pipenv install && pipenv shell
at the root of the project directory to install the necessary libraries. -
Navigate into the
server
directory usingcd server/
-
Run
flask db upgrade
run the migrations and create the models and runpython seed.py
to insert some dummy data into the database. -
Create environment variables using the following commands:
export FLASK_APP=app.py
export FLASK_RUN_PORT=5555
This will have your Flask app running on port 5555
- In a separate terminal, navigate into the
client
directory using the commandcd client
. - Install the NPM packages using
npm install
- Start the React server using the command
npm start
and this will start the application onlocalhost:3000
This is the endpoint for retrieving and adding patient details
GET /patients
{
"first_name": string,
"last_name": string,
"gender": string,
"age": integer,
"phone_number": integer,
"national_id": integer
}
Status Code | Description |
---|---|
200 | SUCCESSFUL |
POST /patients
Parameter | Type | Description |
---|---|---|
first_name |
string |
Required. A patient's first name |
last_name |
string |
Required, A patient's last name |
gender |
string |
Required. A patient's gender |
age |
integer |
Required. A patient's age |
phone_number |
integer |
Required, A patient's phone number |
national_id |
integer |
Required, A patient's national ID number |
{
"first_name": string,
"last_name": string,
"gender": string,
"age": integer,
"phone_number": integer,
"national_id": integer
}
Status Code | Description |
---|---|
201 | CREATED |
This is the endpoint for retrieving, updating and deleting a particular patient's details.
GET /patients/PATIENT_ID
{
"first_name": string,
"last_name": string,
"gender": string,
"age": integer,
"phone_number": integer,
"national_id": integer
}
Status Code | Description |
---|---|
200 | SUCCESSFUL |
PATCH /patients/PATIENT_ID
Parameter | Type | Description |
---|---|---|
attribute |
attribute type |
Required. An attribute whose values are being updated |
{
"first_name": string,
"last_name": string,
"gender": string,
"age": integer,
"phone_number": integer,
"national_id": integer
}
Status Code | Description |
---|---|
200 | SUCCESSFUL |
DELETE /patients/PATIENT_ID
- None
{
"message": "patient deleted successfully"
}
Status Code | Description |
---|---|
200 | SUCCESSFUL |
This is an endpoint for retrieving, updating and deleting appointments.
GET /appointments
- None
{
"first_name": string,
"last_name": string,
"gender": string,
"age": integer,
"phone_number": integer,
"national_id": integer
}
This is the endpoint for retrieving, updating, and deleting a specific appointment.
GET /appointments/APPOINTMENT_ID
{
"date": string,
"time": string,
"status": string,
"patient_id": integer,
"patient_visit_id": integer
}
Status Code | Description |
---|---|
200 | SUCCESSFUL |
PATCH /patients/PATIENT_ID
Parameter | Type | Description |
---|---|---|
attribute |
attribute type |
Required. An attribute whose values are being updated |
{
"date": string,
"time": string,
"status": string,
"patient_id": integer,
"patient_visit_id": integer
}
Status Code | Description |
---|---|
200 | SUCCESSFUL |
DELETE /appointments/APPOINTMENT_ID
- None
{
"message": "appointment deleted successfully"
}
- Open Postman or ThunderClient (VS Code extension) to try out the endpoints which include:
- /patients
- /patients/<int:id>
- /appointments
- /appointmments/<int:id>