This is a platform that we designed for doctors to collect patients' information easily. The big idea is "information sharing" in the format of questionnaires.
Doctors will be able to create a questionnaire for his patients, and all doctors of the same patient can get access to this patient's questionnaire record.
Patients will get notification from the doctor when he needs to answer a questionnaire, and he can also answer a questionnaire anytime he wants.
The flow of each questionnaire is different based on the answer of this patient as well as the type of each question.
Front End part in this project is built in React Native. The main idea of this app is its generic feature and its simplified user interaface. This app is generic to both Android and IOS. Clients simply scan a QR code to register and no need to log on afterwords. There are three screens descripted as follows.
Three Screens:
Click log in button to QR code scanner if first time register.
After scanning, it directs the client to welcomePage.
Click start to answer questions button to start answer questions. It directs the client to questionList page.
Displays all questions for client to select and a submit button at bottom.
*NOTE: needs to be refactored to display one question on each page
list what you wanna say
Data model in this project is built on MongoDB. NoSQLå data model provide more scalable feature.
Method
URL
Description
POST
/v2/accounts/initiators
Create a Initiator
POST
/v2/accounts/initiators/login
Initiator login
GET
/v2/accounts/patients/:id/register/temp-token
Initiator create a temp token(used for generate QR code) for patient registeration
PATCH
/v2/accounts/patients/register
Register Patient's phone to database(connected phone with profile in database via QRCode).
Method
URL
Description
GET
/v2/initiators/profile
Get a Initiator's profile
PATCH
/v2/initiators/profile
Update a Initiator Profile
PATCH
/v2/initiators/patients/add
Append/Add a list of patients to Initiator
POST
/v2/initiators/patients/new
Create a new patient in database
PATCH
/v2/initiators/patients/:id/profile
update profile of a patient
DELETE
/v2/initiators/patients/:id
delete target patient of initiator's patients list
PATCH
/v2/initiators/patients/question-set
Initiator append new questions set to a list of patients
DELETE
/v2/initiators/patients/:id/question-set
delete target patient's(under initiator's patients list) question set.
GET
/v2/initiators/patients/:id/profile
Get a patient's(under initiator's patients list) profile
POST
/v2/initiators/patients/:id/results
Initiator answer a patient's(under his patients list) question set
POST
/v2/initiators/patients/query
Initiator query a patient via first name and last name
Method
URL
Description
POST
/v2/patients/results
Upload patient's pain check result
GET
/v2/patients/results
GET all results of a patient
GET
/v2/patients/profile
GET a patient's profile via jwt
Method
URL
Description
POST
/v2/questions/create
Create a Question
GET
/v2/questions/
Query a question
POST
/v2/question-set/create
Create a Question Set
GET
/v2/question-set/:id
GET a Question Set by ID
Method
URL
Description
GET
/v2/admin/patients
get all patients
GET
/v2/admin/initiators
get all initiators
GET
/v2/admin/questions
get all questions
GET
/v2/admin/question-set/:id
get all question-set
Method
URL
Description
GET
/v2/csv/patients/results
export patients results to csv for downloading
POST/v2/accounts/initiators
Create a doctor account. If success, client will receive 200 with created username and json web token.
Response formats
JSON
Requires authentication?
NO
Rate limited?
/
curl --post --include 'https://localhost/v2/accounts/initiator'
-H 'Accept: application/json' -d {data.json}
{
"username" : "doctor" ,
"first_name" : "mike" ,
"last_name" : "L" ,
"email" : "mike.L@mail.com" ,
"password" : "qqq111!"
"phone" : "6121236523"
}
Field
Description
Required
username
consists of letters and number, length: 5-10m
true
password
\validation update in future\
true
first_name
consists of letters(uppercase and lower case)
true
last_name
consists of letters(uppercase and lower case)
true
email
valid email format
true
phone
10 digits
true
Status Code
Meaning
400
Invalid request data format. Recheck validation again
{
"username" : "test" ,
"token" : "****this is json web token***"
}
GET /v2/accounts/patients/:id/register/temp-token
Initiator create a temp token for patient registration
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --get --include 'https://localhost/v2/accounts/patient/register/temp-token'
-H 'Accept: application/json'
Status Code
Meaning
401
Unauthorized User
500
Internal Database Error
{
"token" : "****this is json web token***"
}
PATCH /v2/accounts/patients/register
Create a Patient account. Need temporary JWT for authentication.
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/accounts/patients/register'
-H 'Accept: application/json' -d {data.json}
{
"uuid" : "*****uuid****"
}
Field
Description
Required
uuid
in the form of uuidv4/uuidv5
true
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
No token/Invalid token
500
Internal Database Error
{
"token" : "****this is json web token***"
}
POST /v2/accounts/initiators/login
Doctor login with token. If success, it will return a valid json web token and doctor's id
Response formats
JSON
Requires authentication?
NO
Rate limited?
/
curl --post --include 'https://localhost/v2/accounts/initiator/login'
-H 'Accept: application/json' -d {data.json}
{
"username" : "doctor" ,
"password" : "qqq111!"
}
Field
Description
Required
username
consists of letters and number, length: 5-10m
true
password
\
true
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
Username doesn't exist or invalid password
500
Internal Database Error
POST /v2/questions/create
Patient Relogin via QRCode. Need temporary JWT for authentication.
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/questions/create'
-H 'Accept: application/json' -d {data.json}
{
"app" : "pain_check" ,
"type" :"option" ,
"description" :"This is test Qustion" ,
"options" :[
{ "key" :"A" , "value" :"Yes" } ,
{ "key" :"B" , "value" :"No" } ,
]
}
Field
Description
Required
app
application which this question below to/must be a string
true
description
the main part of question. required for all question
true
type
question type; used for client render question
true
option
only required when "type" is "option";indicate options
false
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
No token/Invalid token
500
Internal Database Error
{
"question" :{
"_id" :1
"author" :1 ,
"app" :"pain_check" ,
"description" :"How are you feeling today" ,
"type" :"option" ,
"option" :[
{ "key" :"A" , "value" :"Yes" } ,
{ "key" :"B" , "value" :"No" } ,
] ,
"created_date" :"2017-06-18"
}
}
Query a question
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/questions/?id=1'
-H 'Accept: application/json'
id
id number of question
--
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
No token/Invalid token
500
Internal Database Error
{
"question" :{
"_id" :1
"author" :1 ,
"app" :"pain_check" ,
"description" :"How are you feeling today" ,
"type" :"option" ,
"option" :[
{ "key" :"A" , "value" :"Yes" } ,
{ "key" :"B" , "value" :"No" } ,
] ,
"created_date" :"2017-06-18"
}
}
POST /v2/question-set/create
Create a Question Set
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/question-set/create'
-H 'Accept: application/json' -d {data.json}
{ "app" :"pain-check" ,
"title" :"Pain Check" ,
"content" :[
{
"question" :1 ,
"end_question" :false ,
"next_question" :[
{
"question_id" :"2" ,
"prerequisite" :{
"option" :"A"
}
} ,
{
"question_id" :"3" ,
"prerequisite" :{
"option" :"B"
}
}
]
} ,
{
"question" :2 ,
"end_question" :true
} ,
{
"question" :3 ,
"end_question" :true
}
]
}
specifically, for "prerequisite" field, we can choose one of them:
"prerequisite" :{
"option" :"A"
} ,
"prerequisite" :{
"value" :52
} ,
"prerequisite" :{
"interval" :{
"interval" :[ 0 , 50 ] ,
"left_close" :true ,
"right_close" :true
}
} ,
"prerequisite" :{
"greater_than" :{
"value" :52 ,
"include_value" :true
}
}
"prerequisite" :{
"less_than" :{
"value" :52 ,
"include_value" :true
}
}
Field
Description
Required
|option|only required when "type" is "option";indicate options|false|
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
No token/Invalid token
500
Internal Database Error
GET a Question Set by ID
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --get --include 'https://localhost/v2/question-set/1'
-H 'Accept: application/json'
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
No token/Invalid token
500
Internal Database Error
GET /v2/initiators/profile
Get a Initiator's profile by ID
Response formats
JSON
Requires authentication?
YES(Initiator himself)
Rate limited?
/
curl --get --include 'https://localhost/v2/initiator/:id/profile'
-H 'Accept: application/json'
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
No token/Invalid token
500
Internal Database Error
{
"username" : "doctor" ,
"first_name" : "mike" ,
"last_name" : "L" ,
"email" : "mike.L@mail.com" ,
"phone" : "6121236523"
"patients" : [ { _id :1 , first_name :"p" , last_name :"c" } ,
{ _id :2 , first_name :"bell" , last_name :"" g } ]
}
POST /v2/initiators/patients/new
Create a new patient;
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/:id/profile'
-H 'Accept: application/json' -d {data.json}
{
"first_name" : "mike" ,
"last_name" : "L" ,
"mrn" : "123124124" ,
"date_of_birth" : "1990-01-01"
}
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
POST /v2/initiators/patients/query
Query a patient via first name and last name
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/:id/profile'
-H 'Accept: application/json' -d {data.json}
{
"first_name" : "mike" ,
"last_name" : "L" ,
}
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
PATCH /v2/initiators/patients/:id/profile
Update profile of a patient
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/:id/profile'
-H 'Accept: application/json' -d {data.json}
{
"first_name" : "mike" ,
"last_name" : "L" ,
"mrn" : "123124124" ,
"date_of_birth" : "1990-01-01"
}
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
PATCH /v2/initiators/profile
Update a Initiator Profile by ID
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/:id/profile'
-H 'Accept: application/json' -d {data.json}
{
"first_name" : "mike" ,
"last_name" : "L" ,
"email" : "mike.L@mail.com" ,
"phone" : "6121236523"
}
Field
Description
Required
first_name
consists of letters(uppercase and lower case)
true
last_name
consists of letters(uppercase and lower case)
true
email
valid email format
true
phone
10 digits
true
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
{
"first_name" : "mike" ,
"last_name" : "L" ,
"email" : "mike.L@mail.com" ,
"phone" : "6121236523"
}
PATCH /v2/initiators/patients/add
Append/Add a list of patients to Initiator
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/:id/patients/add'
-H 'Accept: application/json' -d {data.json}
Field
Description
Required
patients_id
a list of patients id
true
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
"profile" : { initiator 's profile}
PATCH /v2/initiators/patients/question-set
Initiator assign new questions set to a list of patients
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/patients/question-set'
-H 'Accept: application/json' -d {data.json}
Field
Description
Required
patient_list
array of patient's id
true
q_list
array of id of question set
true
{
"patient_list" :[ 1 , 2 , 3 ] ,
"q_list" :[ 1 , 2 , 3 ]
}
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
DELETE /v2/initiators/patients/:id
Initiator delete target patient from his patients' list
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/patients/question-set'
-H 'Accept: application/json'
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
DELETE /v2/initiators/patients/:id/question-set
Initiator delete target patient's question set. target patient must under this initiator's patients list.
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --post --include 'https://localhost/v2/initiator/patients/question-set'
-H 'Accept: application/json'
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
GET /v2/initiators/patients/:id/profile
Initiator get target patient's detailed profile(including results). target patient must under this initiator's patients list.
Response formats
JSON
Requires authentication?
YES(Initiator)
Rate limited?
/
curl --get --include 'https://localhost/v2/initiator/patients/question-set'
-H 'Accept: application/json'
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
POST /v2/initiators/patients/:id/results
Initiator answer a patient's(under his patients list) question set
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/patients/:uuid/results'
-H 'Accept: application/json' -d {data.json}
{
"app" :"pain_check" ,
"results" :[
{ "q_id" :1 , "value" :5 }
]
}
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
POST /v2/patients/results
Upload patient's result
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/patients/:uuid/results'
-H 'Accept: application/json' -d {data.json}
{
"app" :"pain_check" ,
"results" :[
{ "q_id" :1 , "value" :5 }
]
}
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
Get Patient's profile
Response formats
JSON
Requires authentication?
YES
Rate limited?
/
curl --post --include 'https://localhost/v2/patients/:uuid/results'
-H 'Accept: application/json' -d {data.json}
Field
Description
Required
Status Code
Meaning
400
Invalid request data format. Recheck validation again
401
User is not authenticated
403
User can't access target user's profile
xxxxx
xxxxx