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 body. The operation definition for this endpoint is available on the FHIR server: eRS-GeneratePatientLetter-Operation-1
XAPI_ASID:200000000220 HTTP_X_SESSION_KEY:pro-api-session:9f0ee57a-41a6-4a6b-b50c-d50e61859c81 Accept:*/* Content-Type:application/fhir+json
HTTP Status code
200 (OK) is returned.
The response body contains the binary stream of the just generated patient letter.
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 is in a state that is not suitable to print the appointment request summary or the triage summary letters, for example it 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|
|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|