Status:
This endpoint has been deprecated, meaning you should not use it for new integrations.
Instead, please use our newer e-RS FHIR API solution which is documented here: https://digital.nhs.uk/developer/api-catalogue/e-referral-service-fhir
Description
This endpoint allows an authenticated Service Provider Clinician, or a Service Provider Clinician Admin, who has sufficient relationship to a Referral, to record a review outcome on a request.
A review outcome is a clinical assessment of the Patient’s needs by a Service, allowing a Service to Reject the Referral back to a Referrer, or Accept the Referral into its Service (to book it later).
Request Operation: URL
Method | URL | Authentication |
---|---|---|
POST | {Base URL}/STU3/v1/ReferralRequest/{ubrn}/$ers.recordReviewOutcome | Session Token (Details) |
- {Base URL} (e.g. for Dev1) = https://api.dev1.ers.ncrs.nhs.uk/ers-api
- The {ubrn} represents the unique booking reference number of the Referral request
Operation Definition
eRS-RecordReviewOutcome-Operation-1
Prerequisite Conditions
In order for a Referral to be visible via this endpoint, the Referral must currently possess a “review reason” (https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReviewReason-1) indicating that a Service needs to review the Referral.
A “review reason” may exist because:
- A Referral has been created and sent for “triage” (via https://developer.nhs.uk/apis/e-Referrals/explore_endpoint_a021.html)
- A Referral has been “deferred” to a Service (via https://developer.nhs.uk/apis/e-Referrals/explore_endpoint_a016.html)
Such a Referral would currently be on a Worklist for a Service:
- A “deferred” Referral would be on the APPOINTMENT_SLOT_ISSUES worklist: (via https://developer.nhs.uk/apis/e-Referrals/explore_endpoint_a008.html)
- A Referral sent for “triage” would be on the REFERRALS_FOR_REVIEW worklist: (via https://developer.nhs.uk/apis/e-Referrals/explore_endpoint_a008.html)
As such, the caller performing this action MUST be currently authenticated as a Service Provider Clinician or Service Provider Clinician Admin.
Only a Professional at the “reviewing” service can submit a Review Outcome. An easy to way to identify this is to ask “can you view this referral on this user’s worklist currently?”.
Note: if you wish to associate an attachment, the attachment must have been uploaded previously via https://developer.nhs.uk/apis/e-Referrals/explore_endpoint_a020.html.
Compliance Requirements
MUST
Deceased Checks
- This endpoint does not stop a user recording a Review Outcome if the Patient is deceased. A deceased check cannot be provided by e-RS FHIR API.
- Instead, Partners must check for a Date of Death via the Personal Demographics Service (PDS) API before making the call to the e-RS FHIR API.
INPUT
Request Operation: Header
Cardinality | Value | Description |
---|---|---|
1..1 | If-Match | Changes can only made to the current version of a Referral |
Request Operation: Parameters
Name | Cardinality | Type | Description |
---|---|---|---|
reviewOutcome | 1..1 | coding (eRS-reviewOutcome-1) | The clinical decision being recorded |
reviewComments | 1..1 | valueString | Max 2000 characters |
reviewAttachmentFile | 0..* | Resource (DocumentReference) | |
reviewPriority | 0..1 | coding (eRS-ReferralPriority-1) | Conditionally mandatory when reviewOutcome is set to ACCEPT_REFER_BOOK_LATER) |
Example Request Header
XAPI_ASID:999000000045 (The “Accredited System ID” issued to the third party)
HTTP_X_SESSION_KEY:pro-api-session:e96357b1-298d-4159-ac58-a8953c3262c6" (The session key generated by A001 - Create Session endpoint)
Content-Type: "application/fhir+json"
"If-Match" : "W/\"3\""
Example Request Body
Input in this example does NOT reference an attachment - this parameter is optional.
OUTPUT
Example Response Body
Output (Response) - 200 OK:
Response: Failure
If an error occurs, the relating HTTP status code will be returned in the header. Where status code 422 (Unprocessable Entity) is returned then an eRS-OperationOutcome-1 will be included in the body.
Note that the errors below do not detail “generic” failures such as the FHIR structure being incorrect. The errors below are limited to the functional behavior that this endpoint provides:
Outcome | Note |
---|---|
NO_SUCH_REQUEST | The Referral does not exist |
REFERRAL_LOCKED | The Referral is not available to update |
VERSION_CONFLICT | The Referral version submitted does not match the current version of the Referral |
PRIORITY_NOT_CURRENT | When RETURN_TO_REFERRER_WITH_ADVICE is the reviewOutcome, the reviewPriority submitted MUST be the Referrals current Priority (i.e. no change) |
NO_RELATIONSHIP | The caller does not currently have the rights to perform this action on this Referral |
PATIENT_ERROR | An error occurred while retrieving the requested patient |
INVALID_REQUEST_STATE | The request may not be suitable to review, perhaps flagged as needing additional information prior to review |
DUPLICATE_FILENAME | The filename of one of the files to be associated with the Referral exactly matches (including extension) an existing attachment |
INAPPROPRIATE_VALUE | Attachment “type” is not ‘PROVIDER’ or Attachment “status” is not ‘current’ |
REFERENCE_NOT_FOUND | No such attachment OR the reference on the previously uploaded attachment does not match the current Referral |
INVALID_STATE | The referenced attachment is already linked to a Referral |
INVALID_VALUE | The number of characters in the (to be associated) File Description exceeds 200 |
Note: other “generic” errors concerning FHIR/JSON errors can also be returned.