DocumentReference
Create new or update existing document pointer
Create new pointers.
To create a document pointer you must ensure:
- the body must be a valid FHIR R4 DocumentReference
- subject MUST be a Patient reference using a valid NHS number. e.g.
"subject": { "identifier": { "system": "https://fhir.nhs.uk/Id/nhs-number", "value": "3495456481" } }, - custodian MUST contain an Organization reference using a valid ODS code, agreed during onboarding. e.g.
"custodian": { "identifier": { "system": "https://fhir.nhs.uk/Id/ods-organization-code", "value": "Y05868" } } - type MUST match one of the Document Types defined for BaRS, this is either a Appointment (booking) or a Patient referral.
"type": { "coding": [ { "system": "http://snomed.info/sct", "code": "749001000000101", "display": "Appointment (record artifact)" } ] } - category MUST indicate the broader class of the Document Type as agreed during onboarding, e.g.
"category": [ { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/document-reference-category", "code": "clinical", "display": "Clinical" } ] } ] - content MUST have at least one entry.
- content[].format[] SHOULD indicate the document is structured or not, e.g.
"format": [ { "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", "code": "urn:nhs-ic:structured", "display": "Structured Document" } ] - content[].attachment.url MUST contain the direct URL, e.g.
"attachment": { "url": "https://server.fire.ly/r4/Appointment/GL0-DZOqD39" } - author SHOULD contain an Organization reference using a valid ODS code, agreed during onboarding. e.g.
"author": [ { "identifier": { "system": "https://fhir.nhs.uk/Id/ods-organization-code", "value": "Y05868" } } ] - context.period SHOULD indicate Appointment date and time, e.g.
"context": { "period": { "start": "2025-02-01T06:45:00+00:00", "end": "2025-02-01T07:00:00+00:00" }, - identifier.[] MUST contain the correct identifiers for BaRS including service-id AND product-id, e.g.
{ "system": "https://fhir.nhs.uk/Id/BaRS-Identifier", "value": "GL0-DZOqD39" }, { "system": "https://fhir.nhs.uk/Id/dos-service-id", "value": "2000072491" }, { "system": "https://fhir.nhs.uk/id/product-id", "value": "P.GH7-4TY" }
post/DocumentReference
Request
- Base URLhttps://sandbox.api.service.nhs.uk/booking-and-referral/FHIR/R4
- URLhttps://sandbox.api.service.nhs.uk/booking-and-referral/FHIR/R4/DocumentReference
- AuthHTTP bearer
Headers
X-Request-Idstring uuid required
Example:c1ab3fba-6bae-4ba4-b257-5a87c44d4a91
The X-Request-Id for the request header, when supplied, mirrored back by the receiver.
X-Correlation-Idstring uuid required
Example:9562466f-c982-4bd5-bb0e-255e9f5e6689
The X-Correlation-Id for the request header, when supplied, mirrored back by the receiver.
Acceptstring required
Example:application/fhir+json; version=1.4.0
The Accept header must also contain version of BaRS Core the Sender is expecting to interoperate on.
use-contextstring required
Example:a4t2|validation|servicerequest-response|new
This header is for usage statistics for the BaRS Proxy for NHS England.
Request body
Example request
{
"resourceType": "Bundle",
"type": "searchset",
"total": 3,
"link": [
{
"relation": "self",
"url": "https://int.api.service.nhs.uk/record-locator/consumer/FHIR/R4/DocumentReference?subject:identifier=https://fhir.nhs.uk/Id/nhs-number|9693893123&type=http://snomed.info/sct|749001000000101&category=http://snomed.info/sct|419891008"
}
],
"entry": [
{
"resource": {
"resourceType": "DocumentReference",
"id": "V4T0L-3aeb90b0-7ffa-408a-babf-f20b80ce2c27",
"meta": {
"lastUpdated": "2025-02-18T17:04:53.948Z"
},
"status": "current",
"type": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "749001000000101",
"display": "Appointment (record artifact)"
}
]
},
"category": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "419891008",
"display": "Clinical notes"
}
]
}
],
"subject": {
"identifier": {
"system": "https://fhir.nhs.uk/Id/nhs-number",
"value": "9693893123"
}
},
"date": "2025-02-18T17:04:53.948Z",
"custodian": {
"identifier": {
"system": "https://fhir.nhs.uk/Id/ods-organization-code",
"value": "RGT"
}
},
"context": {
"period": {
"start": "2025-02-01T06:45:00+00:00",
"end": "2025-02-01T07:00:00+00:00"
}
}
}
}
]
}Response
Create / Supersede successful response
Example response
{
"resourceType": "OperationOutcome",
"id": "531e073a-3295-4e67-ae90-e00bd96a9cdd",
"meta": {
"profile": [
"https://fhir.hl7.org.uk/StructureDefinition/UKCore-OperationOutcome"
]
},
"issue": [
{
"severity": "information",
"code": "informational",
"diagnostics": "Resource updated"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.