Creating an Admission
The admission endpoint (api/integration/admissions/) is typically called with the details of the admission - the site and the room, bed & ward details - e.g. this type of payload:
That payload would cause PainChek to check the current admission and
if the details are accurate, do nothing
if there was no existing admission, or if the details were different:
- end the current admission (if any)
- create a new admission
Ending an Admission
It is also permissible to pass just the "patient_external_id" to delete the current admission (if any). e.g:
That said, there is generally no reason to end an admission. If the resident is being admitted elsewhere, then simply call the endpoint with the new details (the old admission will be automatically ended).
If the resident is no longer considered active (e.g. the leave the facility or are deceased), you should archive the resident (and leave the admission record as-is).