Admissions allow the location of patients to be recorded - that is, at which site (and where specifically within that site) are they located.
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).
Field |
Type |
Comment |
---|---|---|
patient |
JSON object |
The patients' record (as described here). This object holds the basic patient details, such as the name, date-of-birth, etc, |
site |
JSON object |
The details of the site that the patient is located in (as described here). This object holds the basic site details, such as the name, location, number of beds, etc |
start |
Mandatory Date/Time |
The date/time the patient was first recorded as being located in the Site |
end |
Optional Date/Time string |
The date/time the patient was last recorded as being located in the Site. If they are still in that location, this field is null. |
unit |
Optional String |
The unit the patient is located in |
room |
Optional String |
The room the patient is located in |
bed |
Optional String |
The bed the patient is located in |
ward |
Optional String |
The ward the patient is located in |
Patients are assumed to be at an "Other" location by default - that is, if there is no current admission record for the patient, they are at an "Other" location. That might be at home or at an ad-hoc location (as opposed to being located at one of the known, registered sites).
A current admission record is one where the end date is null. There should only ever be 1 current record for a patient.
To move a patient from an "Other" location to a Site, create an admission record.
If a patient moves from a Site back to an "Other" location, simply end the current admission record (i.e. set the "end" field to the current date/time),
If a patient is being moved to another Site, you simply create a new admission record for the new site - there is no need to end the current admission record as PainCHek does that automatically.
To see the list of all admission records, issue the following command:
curl https://ua.ap.painchek.com/api/admissions/
Sample return data:
{ "count": 1, "{ "count": 1, "next": null, "previous": null, "results": [{ "uuid": "0026a149-0987-48fe-b3d5-01bca691ecd4", "patient": "0a9fcde4-39c1-410e-85bd-d43d6efae577", "user": "c5fff8fd-e022-4ba4-a35d-ddee6b9fa276", "institution": "ac80058b-45b4-48f8-af2f-164a29de5090", "site": "ac80058b-45b4-48f8-af2f-164a29de5090", "start": "2017-11-14T03:26:14.927000Z", "end": null, "unit": "", "room": "101", "bed": "4", "ward": "West", "created_at": "2017-11-02T00:15:29.773856Z", "modified_at": "2017-11-14T03:41:50.701655Z", "deleted_at": null, "update_stamp": 240 }] }
Warning
You'll see both a "site" and an "institution" item in the returned data (that both indicate the uuid of the site). "institution" is deprecated and will be removed in the future - do not rely on it.
When you fetch patient data (e.g. by issuing a GET to the /api/patients end-point), the current admission record and the details of the site of the admission (if any), are also returned:
{ "uuid": "544c99d1-8439-4912-a3c5-042ddbf34b21", "first_name": "John", "last_name": "Doe", "...": "...", "site": { "uuid": "17c90c04-f4ea-45bc-8f8a-e864fb11bcbe", "license": "a89e0cc1-fd90-4721-b09b-7f527f5ff626", "license_name": "A89E0CC1-FD90/PainChek Ltd/2019-12-31", "type": 2, "name": "I1", "phone": "1234", "email": "test@painchek.com", "address": "TBA", "postcode": "2000", "city": "Sydney", "state": "NSW", "country": "AU", "num_beds": null, "created_at": "2018-06-13T11:39:03.068808Z", "modified_at": "2018-09-06T06:34:07.638003Z", "deleted_at": null, "update_stamp": 374, "external_id": null }, "admission": { "uuid": "1d8ee147-0be8-4560-bdad-28c67783f0ad", "patient": "544c99d1-8439-4912-a3c5-042ddbf34b21", "user": "c5fff8fd-e022-4ba4-a35d-ddee6b9fa276", "institution": "17c90c04-f4ea-45bc-8f8a-e864fb11bcbe", "site": "17c90c04-f4ea-45bc-8f8a-e864fb11bcbe", "start": "2018-11-01T06:12:57.254000Z", "end": null, "unit": "", "room": "101", "bed": "4", "ward": "West", "created_at": "2018-11-01T06:12:59.372160Z", "modified_at": "2018-11-01T06:12:59.380418Z", "deleted_at": null, "update_stamp": 4093 }, "...": "..." }
To create an admission record for a patient, issue the following command (which shows the minimum fields that need to be supplied):
curl \ -H "Content-Type: application/json" \ -X POST https://ua.ap.painchek.com/api/admissions/ -d @- << EOF { "patient":"e1b2b350-23f1-4b8b-a98f-fff9b04ee604", "site":"c186cf8e-708c-479e-acbd-d534f54b7e89", "start": "2017-11-24T08:21:00+10", "room": "123", "bed": "A", "ward": "East" } EOF
Note
Note that the record was created with a "start" time of "08:21:00+10" (i.e. at 8:21 am in Brisbane time). If the "+10" timezone designator was omitted, 8:21 UTC would have been assumed.
See Common Fields for more details on the DateTime data type.
Sample return data:
{ "uuid": "2b752af7-59ca-4e69-bbf0-2b1d7877bd49", "patient": "e1b2b350-23f1-4b8b-a98f-fff9b04ee604", "user": "c5fff8fd-e022-4ba4-a35d-ddee6b9fa276", "site": "c186cf8e-708c-479e-acbd-d534f54b7e89", "institution": "c186cf8e-708c-479e-acbd-d534f54b7e89", "start": "2017-11-24T08:21:00+10:00", "end": null, "unit": null, "room": "123", "bed": "A", "ward": "East", "created_at": "2017-11-23T22:45:44.521774Z", "modified_at": "2017-11-23T22:45:44.522816Z", "deleted_at": null, "update_stamp": 283 }
Warning
You'll see both a "site" and an "institution" item in the returned data (that both indicate the uuid of the site). "institution" is deprecated and will be removed in the future - do not rely on it.
The only valid update to an admission record is to set the "end" date to indicate that an active patient is no longer admitted to any site (which is an uncommon use case case).
Note
-
If the patient is being moved to another bed, room, ward or site, then simply create a new admission record for the site (PainChek will automatically end the old record)
-
If the patient is not longer active as far as PainChek is concerned - e.g. they are now deceased or discharge - do not update the admission record. Instead, just archive the patient record.
A patch command can be used to set the end date:
curl \ -H 'Content-Type: application/json' \ -X PATCH "https://ua.ap.painchek.com/api/admissions/01830309-924e-48e7-a512-4bc2d075aee4/" -d @- << EOF { "end": "2017-11-24T08:21:00" } EOF
Note
Note the uuid of the admission record being updated is included in the URL - "01830309-924e-48e7-a512-4bc2d075aee4" in this case.