A site is a location that a patient can be located in (i.e. where they live or the hospital in which that they are being treated) - typically this is a building such as a hospital or a residential aged care facility.
Note
Note that Sites were formally known as Institutions. Sites can (depending on the settings of your PainChek license), be labelled in the PainChek application as Sites, Institutions, Locations or Facilities (but they are always Sites in the API).
Key Institution Fields
Field |
Type |
Comment |
---|---|---|
type |
Mandatory Integer |
Identifies the type of site: 1 - Hospital 2 - Care Home 3 - Hospice 4 - Private |
name |
Mandatory String |
The name of the site |
phone |
Optional String |
A contact number for the site |
|
Optional String |
email address for the site |
address |
Optional String |
Line one of the address - e.g. "1 Smith Street" |
city |
Optional String |
City or suburb |
postcode |
Optional String |
|
country |
Mandatory String |
2 character country codes - e.g. "AU" |
state |
Optional String |
State/province of the site |
num_beds |
Optional integer |
The number of beds in the site |
To list all Sites in your PainChek instance (in the User Acceptance Environment), issue the following command:
curl https://ap.ua.painchek.com/api/sites/
Sample return data:
{ "count": 1, "next": null, "previous": null, "results": [{ "uuid": "ac80058b-45b4-48f8-af2f-164a29de5090", "license": "a89e0cc1-fd90-4721-b09b-7f527f5ff626", "license_name": "A89E0CC1-FD90/ePAT Technologies Ltd/2018-08-25", "type": 3, "name": "The Hospice", "phone": "0414769470", "email": "a@b.com", "address": "15 Smith Street", "postcode": "4000", "city": "Somewhere", "state": "NSW", "country": "AU", "num_beds": 20, "created_at": "2017-08-30T01:14:20.566000Z", "modified_at": "2017-08-30T02:41:22.085000Z", "deleted_at": null, "update_stamp": 62, "external_id": null }] }
To create a site, issue the following command (which shows the minimum fields that need to be supplied - you can add other fields, such as the state):
curl \ -H "Content-Type: application/json" \ -X POST https://ap.ua.painchek.com/api/sites/ -d @- << EOF { "type": 1, "name": "St George Hospital", "phone":"(02) 9999 8000", "email": "info@stgeorge-hospital.com.au", "address": "10 Jones Road", "city": "Kogarah", "postcode" : "2999", "country": "AU" }
The return is the full site record:
{ "uuid": "c186cf8e-708c-479e-acbd-d534f54b7e89", "license": "a89e0cc1-fd90-4721-b09b-7f527f5ff626", "license_name": "A89E0CC1-FD90/ePAT Technologies Ltd/2018-08-25", "type": 1, "name": "St George Hospital", "phone": "(02) 9999 8000", "email": "info@stgeorge-hospital.com.au", "address": "10 Jones Road", "postcode": "2999", "city": "Kogarah", "state": null, "country": "AU", "num_beds": null, "created_at": "2017-11-17T04:47:43.034893Z", "modified_at": "2017-11-17T04:47:43.035970Z", "deleted_at": null, "update_stamp": 68, "external_id": null }
To update a Site, issue a PATCH to the "api/sites/{site_uuid}/" endpoint, passing the same JSON details as you would when creating the record using a POST to "api/sites/".
You will get the full details of the site returned (i.e. the same details as you get returned when creating the record using a POST to "api/sites/").
See this section for details.