Skip to main content
POST/transactional-api/create-outbound-referral

Create Outbound Referral

Creates an outbound referral against a patient record. Supply a SNOMED CT coded reason via code (required). If a ubrn is provided the referral is created as an NHS e-RS referral; otherwise a manual referral is created. Optional file attachments are base64-encoded.

Authorization: Bearer token (JWT). See Authentication.

Request

curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/create-outbound-referral' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": {
"conceptId": "string",
"description": "string"
},
"referralDate": "2024-07-29",
"priority": "string",
"ubrn": "string",
"referredToOrganisation": {
"name": "string"
},
"referredToPractitioner": {
"name": "string"
},
"additionalInformation": "string",
"consultationTopicHeadingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"hiddenFromPatientFacingServices": false,
"confidentialFromThirdParties": false,
"attachments": [
{
"fileName": "string",
"contentType": "string",
"data": "string"
}
]
}'

Body parameters

FieldTypeRequiredDescription
patientIdstring<uuid>YesMedicus patient identifier.
codeobjectYesSNOMED CT coded referral reason. Required; resolved against the NHS term browser.
referralDatestring<date>NoReferral date (YYYY-MM-DD). Defaults to today.
prioritystringNoOutbound referral priority.
ubrnstringNoUnique Booking Reference Number. When present, the referral is created as an NHS e-RS referral.
referredToOrganisationobjectNoObject with: name.
referredToPractitionerobjectNoObject with: name.
additionalInformationstringNo
consultationTopicHeadingIdstring<uuid> (nullable)No
hiddenFromPatientFacingServicesbooleanNoIf true, hidden from Patient Facing Services (IM1) such as the NHS App.
confidentialFromThirdPartiesbooleanNo
attachmentsarray<object>NoFile attachments to file against the referral.

Responses

200 Referral created.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
400 Validation error.
9 possible code values
CodeDescriptionWhen
missing-patient-idThe patientId is requiredpatientId missing
invalid-patient-idThe patientId is not validpatientId not a valid UUID
patient-not-foundPatient not found for this patientIdpatientId doesn't exist
invalid-codeCould not resolve conceptId into a SNOMED CT code. Check the NHS term browser.code conceptId doesn't resolve to a SNOMED CT code
no-codeYou must specify a code for the referral.code missing
invalid-referral-dateThe referralDate is not a valid date in Y-m-d format.referralDate not a valid date in Y-m-d format
invalid-priorityThe priority is not a valid outbound referral priority.priority not a valid outbound referral priority
invalid-consultation-topic-heading-idThe consultationTopicHeadingId is not a UUIDconsultationTopicHeadingId not a UUID
consultation-topic-heading-not-foundConsultation topic heading not found for this consultationTopicHeadingIdconsultationTopicHeadingId doesn't exist
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}