This is the course project for CSCI-410. We built a platform that allows easy and secure storage and retrieval of medical records for both the patientsπ€ and the doctorsπ¨π»ββοΈ.
With personal information and medical records digitized, we can provide a smooth workflow among departments and people that the needed information will be delivered to the right person and new information will be collected automatically to form a new record entry.
At the bottom level, all the account information and record data are encrypted. We will also implement an access control mechanism to ensure certain information is only visible to specific user groups.
Before getting started you should have the following installed and running:
- Yarn - instructions
- Vue CLI 3 - instructions
- Python 3 - instructions
- Anaconda - instructions
Step 1 : Clone the repo to local machine
$ git clone https://github.com/Boyan-Org/full-stack-integration
$ cd full-stack-integration
Step 2 : Install JavaScript dependencies
$ yarn install
Step 3 : Initialize python virtual environment (why?)
$ conda create -n venv
$ conda activate venv
Step 4 : Install Python dependencies
$ pip install -r requirement.txt
Step 5 : Initialize sqlite database
$ python manage.py migrate
- To inspect sqlite database from GUI, install Sqlite Browser
Step 1 : Run Django server
$ python manage.py runserver
- The Django API and static files will be served from
localhost:8000
.
Step 2 : Run Vue.js server (in another tab)
$ yarn serve
- The Vue application will be served from
localhost:8080
We have a series of unit test to help our develop procedure. The way to call test is:
$ python manage.py test
- π django-vue-template
- π README.md
- π app.json
- π backend
- π api
- π __init__.py
- π admin.py
- π apps.py
- π models.py
- π serializers.py
- π tests.py
- π views.py
- π settings
- π __init__.py
- π dev.py
- π prod.py
- π urls.py
- π wsgi.py
- π api
- π database_models.png
- π db.sqlite3
- π manage.py
- π package.json
- π requirements.txt
- π src
- π App.vue
- π assets
- π components
- π AccountInput.vue
- π DashInfo.vue
- π Dashboard.vue
- π InfoBoard.vue
- π Interview.vue
- π ListAppointment.vue
- π LoginForm.vue
- π MakeAppointment.vue
- π Med.vue
- π Page404.vue
- π Person.vue
- π RecordCreate.vue
- π RecordEdit.vue
- π RecordFilter.vue
- π RecordUpload.vue
- π RecordView.vue
- π RegForm.vue
- π Schedule.vue
- π main.js
- π router.js
- π vue.config.js
PATH:
`localhost:8000/api/login/`
METHOD: POST
Request Format:
{ username: "frank",
password: "frank" }
Response Status:
200: Success
401: `password` doesn't match the `username`
404: `username` not found
Response Format:
{ id: 1,
username: "userfrank",
password: "frank",
role : "patient",
name : "Frank Zhou"
}
PATH:
`localhost:8000/api/register/`
METHOD: GET
Request Format:
{ username : "userboyan",
password: "boyan",
role : "patient",
name : "Boyan Xu"
}
}
Response Status:
201: Success
409: `Username` already taken by someone else
-
List all
personal_information
recordsPATH: `localhost:8000/api/personal_information/` METHOD: GET Response Format: { name : "userboyan", addr : "Weifan Road 401", gender : "Male", email : "one@nyu.edu", dateOfBirth: "1998-03-20", marital : "Single", phone : "17878728172", } Response Status: 200 : OK Other: Buggy
-
Create a
personal_information
recordPATH: `localhost:8000/api/personal_information/` METHOD: POST Request Format: { id : "1", address : "Weifang Road 401", dateOfBirth : "1998-03-20" email : "one@nyu.edu", gender : "Male", maritalStatus: "Single", name : "Boyan Xu", phoneNumber : "17878728172", } Response Status: 201: Created 400: Creation Failed
-
Retrieve
personal_information
record with id=xPATH: localhost:8000/api/personal_info/<int> METHOD: GET Response Format: { id : "1", address : "Weifang Road 401", dateOfBirth : "1998-03-20" email : "one@nyu.edu", gender : "Male", maritalStatus: "Single", name : "Boyan Xu", phoneNumber : "17878728172" } Response Status: 200: OK 404: Record Not Found
-
Delete
personal_information
record with id=xPATH: localhost:8000/api/personal_info/<int> METHOD: DELETE Response Status: 204: Deleted 404: Not Found
-
Update
personal_information
record with id=xPATH: localhost:8000/api/personal_info/<int> METHOD: PATCH Request Format: (Each Attribute is optionally given) { id : "1", address : "Weifang Road 401", dateOfBirth : "1998-03-20" email : "one@nyu.edu", gender : "Male", maritalStatus: "Single", name : "Boyan Xu", phoneNumber : "17878728172", } Response Format: Same as request payload Response Status: 200: OK 404: Not Found 400: Update Failed
-
List all
medical_info
recordsPATH: localhost:8000/api/medical_information/ METHOD: GET Response Format: { bloodType : "A", height : 180, weight : 50, allergies : "None", familyHistory : "None", surgicalHistory: "None", habits : "None", } Response Status: 200 : OK Other: Buggy
-
Create
medical_info
recordPATH: localhost:8000/api/medical_information/<int> METHOD: POST Request Format: { bloodType : "A", height : 180, weight : 50, allergies : "None", familyHistory : "None", surgicalHistory: "None", habits : "None", } Response Status: 201: Created 400: Creation Failed
-
Retrieve
medical_info
record with id=xPATH: localhost:8000/api/medical_information/<int> METHOD: GET Response Format: { bloodType : "A", height : 180, weight : 50, allergies : "None", familyHistory : "None", surgicalHistory: "None", habits : "None", } Response Status: 200: OK 404: Record Not Found
-
Delete
medical_info
record with id=xPATH: localhost:8000/api/medical_information/<int> METHOD: DELETE Response Status: 204: Deleted 404: Not Found
-
Update
medical_info
record with id=xPATH: localhost:8000/api/medical_information/<int> METHOD: PATCH Request Format: (Attributes are optionally given) { bloodType : "A", height : 180, weight : 50, allergies : "None", familyHistory : "None", surgicalHistory: "None", habits : "None", } Response Format: Same as request payload Response Status: 200: OK 404: Not Found 400: Update Failed
-
List all
medical_record
recordsPATH: localhost:8000/api/medical_record/ METHOD: GET Response Format: { bloodType : "A", height : 180, weight : 50, allergies : "None", familyHistory : "None", surgicalHistory: "None", habits : "None", } Response Status: 200 : OK Other: Buggy
-
Create a
medical_record
recordPATH: localhost:8000/api/medical_record/<int> METHOD: POST Request Format: { bloodType : "A", height : 180, weight : 50, allergies : "None", familyHistory : "None", surgicalHistory: "None", habits : "None", } Response Status: 201: Created 400: Creation Failed
-
Retrieve
medical_record
record with id=xPATH: localhost:8000/api/medical_record/<int> METHOD: GET Response Format: { recordID : 1, patient_id : 1, patient_name : "Frank", doctor_id : 1 doctor_name : "Boyan", symptoms : "Headache", treatments : "Sleep more", diagnosis : "η₯η»θ‘°εΌ±", department : "η₯η»ε η§", patient_birthday: "1998-02-12", patient_gender : "Male", dateTime : "2020-12-21", attachmentNb : "2", flag : false, } Response Status: 200: OK 404: Record Not Found
-
Delete
medical_record
record with id=xPATH: localhost:8000/api/medical_record/<int> METHOD: DELETE Response Status: 204: Deleted 404: Not Found
-
Update
medical_record
record with id=xPATH: localhost:8000/api/medical_record/<int> METHOD: PATCH Request Format: (Attributes are optionally given) { recordID : 1, patient_id : 1, patient_name : "Frank", doctor_id : 1 doctor_name : "Boyan", symptoms : "Headache", treatments : "Sleep more", diagnosis : "η₯η»θ‘°εΌ±", department : "η₯η»ε η§", patient_birthday: "1998-02-12", patient_gender : "Male", dateTime : "2020-12-21", attachmentNb : "2", flag : false, } Response Format: Same as request payload Response Status: 200: OK 404: Not Found 400: Update Failed
-
Filter
medical_record
record with given conditionPATH: localhost/api/medical_record/filter_record/ Method: POST Request JSON: { filter_entry: value } Response JSON: { record_data: [ { dateTime : "2020-11-29T00:17:34", department : "dept1", doctor_name : "Boyan Xu", patient_name: "Frank Zhou", recordID : 1 },], record_num: 1 }
-
List all
department_information
recordsPATH: localhost:8000/api/department_information/ METHOD: GET Request Format: { department : "η₯η»ε η§", supervisor : 1, workingHour : [[0,1],[0,0],[1,0],[1,1],[1,1],[0,0],[0,1]] } Response Status: 200 : OK Other: Buggy
-
Create a
department_information
recordPATH: localhost:8000/api/department_information/<int> METHOD: POST Request Format: { department : "η₯η»ε η§", supervisor : 1, workingHour : [[0,1],[0,0],[1,0],[1,1],[1,1],[0,0],[0,1]] } Response Status: 201: Created 400: Creation Failed
-
Retrieve
department_information
record with id=xPATH: localhost:8000/api/department_information/<int> METHOD: GET Response Format: { department : "η₯η»ε η§", supervisor : 1, workingHour : [[0,1],[0,0],[1,0],[1,1],[1,1],[0,0],[0,1]] } Response Status: 200: OK 404: Record Not Found
-
Delete
department_information
record with id=xPATH: localhost:8000/api/department_information/<int> METHOD: DELETE Response Status: 204: Deleted 404: Not Found
-
Update
department_information
record with id=xPATH: localhost:8000/api/department_information/<int> METHOD: PATCH Request Format: (Attributes are optionally given) { department : "η₯η»ε η§", supervisor : 1, workingHour : [[0,1],[0,0],[1,0],[1,1],[1,1],[0,0],[0,1]] } Response Format: Same as request payload Response Status: 200: OK 404: Not Found 400: Update Failed
-
List all
appointment
recordsPATH: localhost:8000/api/appointment/ METHOD: GET Request Format: { date : "2020-11-29", time : "morning", submitTime: "2020-11-28T22:00:00", doctor : 2, patient : 1 } Response Status: 200 : OK Other: Buggy
-
Create a
appointment
recordPATH: localhost:8000/api/appointment/<int> METHOD: POST Request Format: { date : "2020-11-29", time : "morning", submitTime: "2020-11-28T22:00:00", doctor : 2, patient : 1 } Response Status: 406: Data not acceptable 409: condition not satisfied (check response.data["error"]) 201: Created
-
Retrieve
appointment
record with id=xPATH: localhost:8000/api/appointment/<int> METHOD: GET Response Format: { date : "2020-11-29", time : "morning", submitTime: "2020-11-28T22:00:00", doctor : 2, patient : 1 } Response Status: 200: OK 404: Record Not Found
-
Delete
appointment
record with id=xPATH: localhost:8000/api/appointment/<int> METHOD: DELETE Response Status: 204: Deleted 404: Not Found
-
Update
appointment
record with id=xPATH: localhost:8000/api/appointment/<int> METHOD: PATCH Request Format: (Attributes are optionally given) { date : "2020-11-29", time : "morning", submitTime: "2020-11-28T22:00:00", doctor : 2, patient : 1 } Response Format: Same as request payload Response Status: 200: OK 404: Not Found 400: Update Failed
-
Filter
appointment
record with given conditionPATH: localhost/api/appointment/filter_record/ Method: POST Request JSON: { filter_entry1: value, filter_entry2: value, ... } Response JSON: { record_data: [ { dateTime : "2020-11-29T00:17:34", department : "dept1", doctor_name : "Boyan Xu", patient_name: "Frank Zhou", recordID : 1 },], record_num: 1 }
-
Get available slot
The slot is available if and only if:
- The doctor works at that slot
- There are less than 10 people book the slot with the doctor
- The patient has not booked the slot with the doctor
PATH: localhost/api/appointment/get_available_slots/ Method: POST Request JSON: { patient_id: 1, } Response JSON: { dates: [ "2020-12-14", "2020-12-11", "2020-12-07", "2020-12-17", "2020-12-04", "2020-12-13", "2020-12-10", "2020-12-09", "2020-12-06", "2020-12-16" ], dept_names: [ "dept2", "dept1" ], doctor_names: [ "Hellen Wang", "Boyan Xu" ], slots: [ { date: "2020-12-04", department: "dept1", doctor_id: 2, doctor_name: "Boyan Xu", time: "morning" }, { date: "2020-12-17", department: "dept1", doctor_id: 2, doctor_name: "Boyan Xu", time: "afternoon" }, ..., ], times: [ "morning", "afternoon" ] }