Base URL (Dev3): ‘https://api.dev3.ers.ncrs.nhs.uk/ers-api’
|POST||/STU3/v1/ReferralRequest/[UBRN]/$ers.generatePatientLetter||Session Token (Details)|
As a Referring Clinician (/Administrator) having created a referral I want to retrieve the patient’s letter So that the patient has all the necessary details to choose the clinic they want to attend and book an appointment
This endpoint is to be used as part of the Create Referral workflow.
A referral must exist and the user must legitimately have access to it. A letter can be re-printed multiple times, but the current API only supports the scenario of referrals that don’t have an appointment booked.
|XAPI_ASID||The “Accredited System ID” issued to the third party|
|HTTP_X_SESSION_KEY||The session key generated by the Create Session endpoint (A001)|
This operation does not require a payload. The operation definition for this endpoint is available on the FHIR server: eRS-GeneratePatientLetter-Operation-1
Example Request Header
EXAMPLE COMING SOON
Example Request Body
HTTP Status code
200 (OK) is returned.
The response body contains the binary stream of the just generated patient letter.
Example Response Body
EXAMPLE BINARY STREAM
If an error occurs, the relating HTTP status code will be returned. Where status code 422 (Unprocessable Entity) is returned then an eRS-OperationOutcome-1 will be included in the body, as detailed below.
|INVALID_REQUEST_TYPE||The UBRN provided exists in e-RS but does not correspond to a referral|
|INVALID_REQUEST_STATE||The referral state is either incomplete or cancelled or the referral has a booked appointment or the referral has been superseded by an onward referral; or: the referral has a booking deferral or a triage deferral|
|NO_ACCESS_CODE||The patient doesn’t have an access code/password to log onto the patient portal|
|NO_RELATIONSHIP||The user does not have a suitable legitimate relationship with the referral|