Patients
GET <qbench-url>/qbench/api/v1/patient/{patient_id}
Will retrieve a Patient by its ID. A request for a single Patient will also include its Patient Contact (Client)
Example request:
GET /qbench/api/v1/patient/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"patient_contact": {
"first_name": "Peron",
"last_name": "A",
"phone": null,
"address": null,
"customer_id": 2,
"email_address": null,
"id": 59
},
"first_name": "Pupper",
"last_name": null,
"gender": "Female",
"breed": "Tabby",
"species": "Feline",
"date_of_birth": "07/18/2012",
"id": 93
}
GET <qbench-url>/qbench/api/v1/patient?page_num={pageNum}&page_size={pageSize}
Will retrieve a paginated list of Patients. A list of Patients will include each patient’s Patient Contact
Optional query string params:
customer_id - Will retrieve patients only for a specific customer ID
first_name - Will try to match the parameter with a Patient’s first name
last_name - Will try to match the parameter with a Patient’s last name
Example request:
GET /qbench/api/v1/patient?first_name=Kit HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"total_pages": 1,
"total_count": 2,
"data": [
{
"patient_contact": {
"first_name": "Patient",
"last_name": "Contact",
"phone": null,
"address": null,
"customer_id": 1,
"email_address": "patient_contact@qbench.net",
"id": 51
},
"first_name": "Kitty",
"last_name": "Meow",
"gender": "Female Spayed",
"breed": "Taby",
"species": "Feline",
"date_of_birth": "01/01/2019",
"id": 74
},
{
"patient_contact": {
"first_name": "Patient",
"last_name": "Contact",
"phone": null,
"address": null,
"customer_id": 1,
"email_address": "patient_contact@qbench.net",
"id": 51
},
"first_name": "Kitty",
"last_name": "Cat",
"gender": null,
"breed": null,
"species": "Feline",
"date_of_birth": "01/01/2019",
"id": 85
}]
}
POST <qbench-url>/qbench/api/v1/patient
Will create a new patient. All fields are required. Species can only be “Canine” or “Feline”. Gender can only be “Male”, “Male Neutered”, “Female”, “Female Spayed”.
Example request:
POST /qbench/api/v1/patient HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
'first_name': 'Martin',
'last_name': 'Pupper',
‘date_of_birth: ‘07/10/2016’,
‘species’: ‘Canine’,
‘breed’: ‘German Shepherd’,
‘gender’: ‘Male’
‘patient_contact_id’: 1
}
Example response:
{“id”: 1}
POST <qbench-url>/qbench/api/v1/patient/{patient_id}
Will update an existing patient. Patient contact ID and Customer ID cannot be null.
Example request:
POST /qbench/api/v1/patient/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
'first_name': 'Martin',
'last_name': 'Pupper',
'patient_contact_id': 1
}
Example response:
{“message”: “OK”}
DELETE <qbench-url>/qbench/api/v1/patient/{patient_id}
Will delete a patient.
Example request:
DELETE /qbench/api/v1/patient/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{"message":"OK"}
Comments
0 comments
Please sign in to leave a comment.