Standard Pattern - Composite Messages
Most implementations of the BaRS that are applying the standard to support a particular use case or operational workflow will follow the same basic set of foundational operations with little deviation.
In order to establish a guarantee of compatibility between different solutions compliant with the standard, all implementations must support all the underlying foundational operations and patterns.
Standard Pattern For Composites
The majority of BaRS operations utilise a single standard approach. Since most BaRS operations involve composites of FHIR resources supporting a particular workflow they all utilise a single type of endpoint designed for processing and consuming of composite resources. This is the $process-message endpoint from the FHIR operations framework. The resource being transmitted in the body of the http request is a FHIR "Bundle" resource. This request payload needs to support two purposes, both the transmission of information as well as an indicator to direct the recieving system to how this particular bundle of resources is to be processed and what workflow should be triggered as a result of its consumption.
These core functions are:
- making a referral
- cancelling/amending a referral
- making a booking
- cancelling/amending a booking
- providing a response/feedback communication
At the highest level this pattern follows the following key steps:
- Sender GET the message definition for the payload/workflow being attempted
- Sender composes the bundle (as defined by the message definition) ready for POST-ing.
- Sender does a POST request to the receivers' /$process-message endpoint.
- Receiver inspects the request header and the bundle MessageHeader resource for the core workflow variables indicating how to process and consume the bundle.
- Receiver send http response message back to the sender.
Below is a pseudo code example, showing the above process in detail, illustrating how a message could be interpreted using core workflow variables for a message sent to POST /$process-message.
Each Application will have a tailored example of the below pseudo code.
> Click here to show example
Receive_Request
{
initialise_variable "messageType"
initialise_variable "MessageReason"
initialise_variable "RequestType"
//HTTP_Headers
{
if (HttpHeaders is null || HttpHeaders not Guid )
OperationOutcome.issue.code = "invalid"
throw exception with "REC_BAD_REQUEST"
then return with HTTP.ResponseCode 400
else if (HttpHeaders.RequestId == RequestId.AlreadyReceived)
OperationOutcome.issue.code = "duplicate"
throw exception with "REC_CONFLICT"
then return with HTTP.ResponseCode 409
}
//Bundle
{
if(Bundle.meta.versionID is null)
OperationOutcome.issue.code = "invariant"
throw exception with "REC_BAD_REQUEST"
then return with HTTP.ResponseCode 400
else if!(Bundle.meta.versionID in versionID.supported)
OperationOutcome.issue.code = "not-supported"
throw exception with "REC_UNPROCESSABLE_ENTITY"
then return with HTTP.ResponseCode 422
}
//Contents;
{
switch(MessageHeader.eventCoding)
{
case "servicerequest-request":
if (MessageHeader.reason.code == "new" && ServiceRequest.status == "active")
{
switch(ServiceRequest.Category)
{
case "Validation":
if (CarePlan.status != "active")
{
RequestType = "unknown";
OperationOutcome.issue.code = "invariant";//A content validation rule failed
throw exception with "REC_BAD_REQUEST";
then return HTTP.ResponseCode 400;
}
else if(Encounter.Status.In("triaged","in-progress")
{RequestType = "Im Receiving a new Validation Request";}
else
{
RequestType = "unknown";
OperationOutcome.issue.code = "invariant";//A content validation rule failed
throw exception with "REC_BAD_REQUEST";
then return HTTP.ResponseCode 400;
}
break;
case "Referral":
if (Careplan.status != "completed")
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400
}
else if(Encounter.Status.In("triaged","finished"))
RequestType = "Im Receiving a new Referral"
else
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400
break;
default:
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
}
else if (MessageHeader.reason.code == "update")
{
switch(ServiceRequest.category)
{
case "Validation":
if(ServiceRequest.status.In("entered-in-error","revoked"))
{RequestType = "im receiving a cancelled validation request";}
else if(ServiceRequest.status.In("active","on-hold"))
{RequestType = "im receiving an update to a validation request";}
else
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400
}
break;
case "Referral":
if(ServiceRequest.status.In("entered-in-error","revoked"))
{RequestType = "im receiving a cancelled referral"}
else
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400
}
break;
default:
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
}
else
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400}
break;
case "servicerequest-response":
if (MessageHeader.Response is null )
{
RequestType = "Invalid servicerequest-response"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
else if ( !Message.Response.identifier.existsLocally())
{
RequestType = "none or invalid response ID"
OperationOutcome.issue.code = "not-found"//A content validation rule failed
throw exception with "REC_NOT_FOUND"
then return HTTP.ResponseCode 404;
}
switch (ServiceRequest.Category)
{
case "Referral":
if (ServiceRequest.status == "revoked" && MessageHeader.reason.code == "new")
{ RequestType = "im receiving a Safeguarding DNA response (noshow)" }
else
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
break;
case "Validation":
if(!AnyEncounter.Originates.Local && Encount.Count()<=3)
{
if (MessageHeader.Reason.code == "new" && ServiceRequest.status == "active" && MessageHeader.FocusEncounter.status=="in-progress")
{Request Type = "im receiving a Validation Response interim update" }
else if (MessageHeader.Reason.code.In ("new","update") && ServiceRequest.status == "completed" && MessageHeader.FocusEncounter.status.In("triaged","complete")
{Request Type = "im receiving a final Validation Response" }
else
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
}
else if(MessageHeader.FocusEncounter.status = "triaged" && ServiceRequest.status == "revoked" && MessageHeader.Reason.code.In("new","update"))
{ RequestType = "im receiving a Rejected validation response" } // a new encounter here is an edge case.
else
{
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
default:
RequestType = "unknown"
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return HTTP.ResponseCode 400;
}
case "booking-request":
if (MessageHeader.Reason.code== "new" && Appointment.Status == "booked")
if(slot.IsFree())
{RequestType = "Im Receiving a new booking.";}
else
{
OperationOutcome.issue.code = "conflict"
throw exception with "REC_CONFLICT"
then return with HTTP.ResponseCode 409
}
else if (MessageHeader.Reason.code == "update")
MessageHeaderIsUpdate = true;
switch (Appointment.Status)
{
case "cancelled":
RequestType = "Im Receiving a booking cancellation."
break
case "entered-in-error":
RequestType = "Im Receiving a booking cancellation."
break
case "booked":
RequestType = "Im Receiving an update to a booking."
break
default:
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return with HTTP.ResponseCode 400;
break;
}
else
{
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with "REC_BAD_REQUEST"
then return with HTTP.ResponseCode 400;
}
break;
case "booking-response":
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with 'REC_BAD_REQUEST'
then return with HTTP.ResponseCode 400
break;
default:
OperationOutcome.issue.code = "invariant"//A content validation rule failed
throw exception with 'REC_BAD_REQUEST'
then return with HTTP.ResponseCode 400
break;
}
}
//Submit
{
if (Message == "update")
{
if (currentLocalData.LastUpdated > originaRequest.ReceivedDate)
{
OperationOutcome.issue.code = "conflict"
throw exception with 'REC_CONFLICT'
then return with HTTP.ResponseCode 409
break;
}
foreach (Entry in Bundle)
{
if (currentLocalData.Item.exists)
{
if (currentLocalData.LastUpdated > originaRequest.Received)
{
OperationOutcome.issue.code = "conflict"
throw exception with 'REC_CONFLICT'
then return with HTTP.ResponseCode 409
break;
}
if(Entry.LastUpdated > currentLocalData.Item.meta.LastUpdated && Entry.fullUrl = currentLocalData.Item.fullUrl)
currentLocalData.Item = Entry.Item
Entry.SubmitWith(currentLocalData.Item.meta.LastUpdated == Entry.LastUpdated )
else
ignore
}
else
Entry.SubmitWith(currentLocalData.Item.meta.LastUpdated == Entry.LastUpdated )
}
Submit(currentLocalData.Bundle.meta.LastUpdated = Bundle.Meta.LastUpdated)
return HTTP.ResponseCode 200 'OK'
}
else
{
foreach(Entry in Bundle)
{
Entry.SubmitWith(currentLocalData.Item.meta.LastUpdated == Entry.LastUpdated )
Submit(currentLocalData.Bundle.meta.LastUpdated = Bundle.Meta.LastUpdated)
return HTTP.ResponseCode 200 'OK'
}
}
}
}
Message Headers
MessageHeader Resource
BaRS payloads (FHIR message bundles) require a MessageHeader FHIR resource which provides key information to drive workflow and start interpreting the data contained within. This resource is central to making a request or asynchronous response and must be present in all payloads.
The MessageHeader resource contains the following element which must be used as outlined:
- MessageHeader.source - stipulates where the payload originated. The Sender must, under MessageHeader.source.endpoint, include a valid URI which could be used as a NHSD-Target-Identifier (their reference on the Endpoint Catalogue) for the Receiver to send an asynchronous response.
- MessageHeader.destination - designates who the payload is intended for, including reference to an Organisation resource and a valid URI (MessageHeader.destination.endpoint) which is the NHSD-Target-Identifier (their reference on the Endpoint Catalogue) the payload is being sent to.
- MessageHeader.eventCoding - determines the 'type' of payload, whether booking, referral, request or asynchronousus response. The value must be populated from this CodeSystem. In referrals, this value, combined with the ServiceRequest.category element, allows supports for different styles of referral to support various use-cases. The value must be populated from CodeSystems for specific type and use-case.
- MessageHeader.reason.code - indicates whether the message is 'new' or an 'update' to something the Receiver is already aware of. The value must be populated from this CodeSystem.
- MessageHeader.focus - specifies the root resource through which to start interpreting the payload.
- MessageHeader.definition - cites the MessageDefinition the payload must adhere to and must be rejected by the Receiver if it fails to do so. Note: payload conformance to MessageDefinitions is not checked as part of FHIR validation.
When a Receiver begins to process the payload, they must initially ensure it is for them and they know who it is from:
- check the MessageHeader.destination and verify the MessageHeader.destination.receiver.reference refers to their Organisation.
- check the MessageHeader.destination.endpoint is the Service ID they are expected to be processing the request on behalf of.
- Store MessageHeader.source.endpoint as NHSD-Target-Identifier to enable an asynchronous response back to the Sender. Not all workflows will require this type of response but this data must be stored for audit purposes.
Certain elements in MessageHeader explicitly drive workflow, check MessageHeader.eventCoding to determine whether a booking or referral payload is being sent, and whether this is an initial or update request or an asynchronous response to a pre-existing request. There are various styles of referral too, a request could be made for a simple 'transfer of care' or, currently, something termed a 'validation', where one service requests another to validate the assessment outcome they have reached. The intention of supporting gradation of referral is to provide BaRS the malleability to support further subtlety of referrals for future use cases. Combining the MessageHeader.eventCoding with the ServiceRequest.cateory provides this functionality and, with the addition of use-case categories (again populated under ServiceRequest.category) specific services are pinpointed through every BaRS workflow.
Once the above checks have been made, the detail of the payload can start to be unpacked and processed. The structure of the payload must be checked first to ensure it adheres to the MessageHeader.definition it claims to. The MessageDefinitions will principally be defined by BaRS, at a national level (although bespoke definitions can be used through BaRS), and the Receiver is checking to ensure all mandatory FHIR resources are present and meet their assigned cardinality. This is a manual, business logic, check and not something which is supported through standard FHIR validation of the payload (bundle). Next, MessageHeader.focus is the root resource through which the payload is intended to be understood. In an initial referral request, this will typically be the ServiceRequest FHIR resource. This root will link to other resources to build a narrative for the payload, for example, the ServiceRequest will link to the Encounter which led to the referral being made and the Careplan detailing next actions. The Entity Relationship Diagrams (included in each Application) are used as a visual representation of the FHIR resource links in the payloads.
Asynchronous Response Workflows
For certain Applications, an initial request by a Sender expects an asynchronous response (as opposed to an HTTP synchronous response (200) message). These responses are defined by the workflow of the Application and may be consistently returned or conditional. When an asynchronous response is initiated, the original Sender and Receiver roles are switched, the Sender becoming the Receiver and vice versa. This allows BaRS to support complex workflows through support for multiple requests (initial and update) and, potentially, multiple asynchronous responses, for example, an initial status update followed by a more detailed final outcome (as defined in Application 4). The asynchronous response should be thought of as merely another payload, adhering to all the same rules as an initial request or update. Similarly, Sender and Receiver roles are intended to be interchangeable in BaRS and, in most BaRS Applications a supplier is expected to build both Sender and Receiver functionality, something which is reflected in the assurance process, especially BaRS Core.
Where the workflow dictates an asynchronous response is to be sent, the Sender (originally the Receiver) must populate:
- MessageHeader.response.identifier with the Bundle.Id of the original request payload and set the MessageHeader.response.code value to 'ok'.
- Additionally, they must follow the above guidance on populating the MessageHeader.
Cancellation
The ability to reverse a digital request, by performing a cancellation, whether booking or referral, is a core workflow within BaRS. It completes the digital workflow, supports genuine interoperability and removes the need for manual intervention by service providers.
Cancellation, for any referral type or booking, is a stripped back request, containing only the specific resources a Receiver requires to the fulfil the request. There are separate MessageDefinitions involved when engaged in referral and booking cancellation workflows.
A prerequisite when performing a cancellation of any request is to perform a read (GET) of either the booking or referral to be cancelled. The Sender must only make a cancellation request if the entity has a status which means it is still current; 'active' in the case of a referral (ServiceRequest) and 'booked' for a booking (Appointment). This ensures the Sender has the latest version of the entity they are about to change or, if it is no longer current (because its been actioned by the Receiver), allows the Sender to advise the end user so an alternative (often manual) workflow can be started. The Receiver must not process a cancellation request for a booking or referral which is not current, instead they must return an appropriate error response.
Cancellation Referral Request Payload
MessageHeader Resource
Standard Patterns for BaRS Operations explains in detail how the MessageHeader resource must be used.
When cancelling a referral, in conjunction with the guidance provided under the Standard Patterns, the four important elements which drive workflow must be used as follows:
- eventCoding - this must be the same code as used in the request.
- reasonCode - a cancellation follows an initial request, therefore, this must always be 'update' for cancellation.
- definition - cancellation has a unique MessageDefinition the request must adhere to.
- focus - must point to the ServiceRequest resource.
ServiceRequest Resource
The 'focus' resource in a cancellation referral request is the ServiceRequest resource. When the payload is created by the Sender and processed by the Receiver, this is the starting point from which it (the bundle) is understood and provides either the detail or references to all key FHIR resources, for example, the Patient. The guidance for this resource below provides more granular, element level, detail.
When a Receiver processes the cancellation referral request, the two key elements used are the ServiceRequest.id and ServiceRequest.status. The .id must already exist as an 'active' (status) ServiceRequest on the Receiver system (this must have been confirmed by a prior read (GET) by the Sender) and the .status, in the request, must either be 'revoked' or 'entered-in-error'. There is a distinct difference between these two ServiceRequest.status(es). 'Revoked' should be used to denote the original request was intentional but, due to a change in circumstances, is no longer valid, whereas, 'entered-in-error' should be used when original request was in error. The purpose of this differentiation is to allow service providers to accurately report the reason for cancellations.
Patient Resource
Key patient demographics should be cross-referenced between the current 'active' referral and incoming cancellation referral request to ensure validity.
Payload for Referral Cancellation Request
This payload is used to transmit all the necessary information that is required to transmit the cancellation of a Referral.
> Bundle
The Bundle resource is the container for the event message.
| BARSBundleMessage (Bundle) | https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle | ||
| type | Fixed Value | ||
| timestamp | 1.. |
| Data Item | Implementation Guidance | Necessity | Profile Cardinality | Example Value(s) |
|---|---|---|---|---|
| Bundle | The Bundle resource is the container for the event message https://simplifier.net/nhsbookingandreferrals/barsbundlemessage | 1..1 | ||
| Bundle.id | This id is generated by the originating sender of the message, retained in subsequent messages.. | MUST | 1..1 | 79120f41-a431-4f08-bcc5-1e67006fcae0 |
| Bundle.meta | https://www.hl7.org/fhir/resource.html#Meta | MUST | 0..1 | |
| Bundle.meta.profile | This MUST be populated with the structure definition for BaRSBundleMessage : 'https://fhir.nhs.uk/StructureDefinition/BARSBundleMessage' - FIXED VALUE | MUST | 0..1 | https://fhir.nhs.uk/StructureDefinition/BARSBundleMessage |
| Bundle.meta.lastUpdated | All resources MUST include 'lastUpdated' value, under meta section which must be the same timestamp for each resource when created from new, but must be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent. | MUST | 1..1 | 2023-03-08T12:01:08.4677672+00:00 |
| Bundle.type | This must be populated with 'message' - FIXED VALUE | MUST | 1..1 | message |
| Bundle.timestamp | the date that the content of the message was assembled. This date is not changed by middleware engines unless they add additional data that changes the meaning of the time of the message | MUST | 0..1 | 2023-03-08T12:01:08.4677672+00:00 |
| Bundle.entry(s) | Follow BaRS profile guidance for populating this element | MUST | 1..* | |
| Bundle.entry.fullUrl | unique identifier for the resource entry. Transient id relative to the bundle | MUST | 0..1 | urn:uuid:1cbdfb97-5859-48a4-8301-d54eab818d68 |
| Bundle.entry.resourceType | Resources detailed in the message definition. | MUST | 0..1 | MessageHeader,Patient, Encounter |
A resource that describes the BaRS message being exchanged between two systems.
> Message Header
BARSMessageHeaderServiceRequestRequest (MessageHeader) https://fhir.hl7.org.uk/StructureDefinition/UKCore-MessageHeader event[x] system 1.. code 1.. destination 1.. receiver reference 1.. sender reference 1.. identifier assigner reference 1.. source extension 0.. myExtension 0.. Extension(Complex) endpoint reason 1.. coding system Fixed Value focus reference 1..
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
MessageHeader
A resource that describes the BaRS message being exchanged between two systems https://simplifier.net/nhsbookingandreferrals/barsmessageheaderservicerequestrequest
1..1
MessageHeader.meta
https://www.hl7.org/fhir/resource.html#Meta
MUST
0..1
MessageHeader.meta.profile
This MUST be populated with the structure definition for BaRSMessageHeader-servicerequest-request.
MUST
0..1
https://fhir.nhs.uk/StructureDefinition/BARSMEssageHeader-servicerequest-request
MessageHeader.meta.lastUpdated
All resources MUST include 'lastUpdated' value, under the meta section which MUST be the same timestamp for each resource when created from new, but MUST be a later timestamp on updates to resources, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
0..1
2023-03-08T12:01:08.4677672+00:00
MessageHeader.extension
This MUST be populated with details of the Clinical Decision Support System used
MUST
0..*
MessageHeader.extension.url
This MUST be populated with 'https://fhir.nhs.uk/StructureDefinition/CDSSExtension' - FIXED VALUE
MUST
1..1
https://fhir.nhs.uk/StructureDefinition/CDSSExtension
MessageHeader.extension.extension
MUST
0..*
MessageHeader.extension.extension.url
This MUST be populated with the pre-defined Clinical Decision Support System software URL - FIXED VALUE
MUST
1..1
requesterCDSSSoftware
MessageHeader.extension.extension.valueString
This MUST be populated with the Clinical Decision Support System software name e.g. Pathways
MUST
0..1
Pathways
MessageHeader.extension.extension
MUST
0..*
MessageHeader.extension.extension.url
This MUST be populated with the pre-defined Clinical Decision Support System software Version URL - FIXED VALUE
MUST
1..1
requesterCDSSVersion
MessageHeader.extension.extension.valueString
This MUST be populated with the Clinical Decision Support System software Version name e.g. 30.2.0
MUST
0..1
30.2.0
MessageHeader.eventcoding
MUST
1..1
MessageHeader.eventcoding.system
This MUST be populated with CodeSystem 'https://fhir.nhs.uk/CodeSystem/message-events-bars' - FIXED VALUE
MUST
0..1
https://fhir.nhs.uk/CodeSystem/message-events-bars
MessageHeader.eventcoding.code
The status MUST be populated with 'servicerequest-request'. See CodeSystem: 'https://fhir.nhs.uk/CodeSystem/message-events-bars' - FIXED VALUE
MUST
0..1
servicerequest-request
MessageHeader.destination
MUST
0..1
MessageHeader.destination.receiver
MUST
0..1
MessageHeader.destination.receiver.reference
This MUST be populated with the full URL to the Receiving Organisation resource.
MUST
0..1
urn:uuid:10397afd-479c-42ea-9d5d-e4024481e0f8
MessageHeader.destination.endpoint
This MUST be populated with the system and Service ID separated by a pipe. for example https://fhir.nhs.uk/id/dos-service-id\|11111111, this is to ensure the receiver knows the intended destination.
MUST
1..1
https://fhir.nhs.uk/id/dos-service-id\|1122334455
MessageHeader.sender
MUST
0..1
MessageHeader.sender.reference
This MUST be populated. Follow BaRS profile guidance for populating this element
MUST
0..1
urn:uuid:07939a0c-2854-46ff-9282-ad906bc93679
MessageHeader.source
MUST
1..1
MessageHeader.source.name
This MUST be populated with the sending system supplier name
MUST
0..1
NHS Trust
MessageHeader.source.software
This SHOULD be populated with the sending software application name
SHOULD
0..1
Supplier Software
MessageHeader.source.version
This SHOULD be populated with the sending software version
SHOULD
0..1
V1.0.0
MessageHeader.source.contact
SHOULD
0..1
MessageHeader.source.contact.system
This SHOULD be populated with the Contact Type - phone | fax | email | pager | url | sms | other
SHOULD
0..1
phone
MessageHeader.source.contact.value
This SHOULD be populated with the Contact Type value
SHOULD
0..1
+44 (0123) 123 4567
MessageHeader.source.endpoint
This MUST be populated with the system and Service ID separated by a pipe. for example https://fhir.nhs.uk/id/dos-service-id\|11111111, this is to ensure the receiver knows where any response messages SHOULD be addressed.
MUST
1..1
https://fhir.nhs.uk/id/dos-service-id\|5566778899
MessageHeader.reason
MUST
0..1
MessageHeader.reason.coding
MUST
0..1
MessageHeader.reason.coding.system
This MUST be populated with 'https://fhir.nhs.uk/CodeSystem/message-reason-bars' - FIXED VALUE
MUST
0..1
https://fhir.nhs.uk/CodeSystem/message-reason-bars
MessageHeader.reason.coding.code
This MUST be populated with "delete" for an cancellation. See CodeSystem: 'https://fhir.nhs.uk/CodeSystem/message-events-bars'
MUST
0..1
delete
MessageHeader.reason.coding.display
This MUST be populated with 'Delete' when cancelling a Service Request.
SHOULD
0..1
Delete
MessageHeader.focus
MUST
0..*
MessageHeader.focus.reference
This MUST be populated with a reference to the ServiceRequest
MUST
0..1
urn:uuid:236bb75d-90ef-461f-b71e-fde7f899802c
MessageHeader.definition
This MUST be populated with the MessageDefinition the bundle is based on. This will be used for validation. Value - https://fhir.nhs.uk/MessageDefinition/bars-message-servicerequest-request-cancelled
MUST
0..1
https://fhir.nhs.uk/MessageDefinition/bars-message-servicerequest-request-cancelled
A resource to carry a request for a service to be performed, in this case a Validation. This Resource is the focus of the Validation Request interaction.
> Service Request
BARSServiceRequestRequestReferral (ServiceRequest) https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest intent Fixed Value category 1..1 subject Reference(https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient) occurrence[x] occurrencePeriod Period authoredOn 1.. performer
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
ServiceRequest
A resource to carry a request for a service to be performed, in this case a Validation. This Resource is the focus of the Validation Request interaction https://simplifier.net/nhsbookingandreferrals/barsservicerequest-request-validation
1..1
ServiceRequest.id
MUST only be generated by the Receiver as the id for the resource in the synchronous HTTP response.
MUST
0..1
236bb75d-90ef-461f-b71e-fde7f899802c
ServiceRequest.meta
https://www.hl7.org/fhir/resource.html#Meta
MUST
0..1
ServiceRequest.meta.profile
https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation
MUST
0..1
https://fhir.nhs.uk/StructureDefinition/BARSServiceRequest-request-validation
ServiceRequest.meta.lastUpdated
All resources MUST include 'lastUpdated' value, under meta section which must be the same timestamp for each resource when created from new, but must be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
0..1
2023-03-08T12:01:08.4677672+00:00
ServiceRequest.basedOn
MUST
0..*
ServiceRequest.basedOnreference
This MUST be populated with a reference to the CarePlan resource
MUST
0..1
urn:uuid:236bb75d-90ef-461f-b71e-fde7f899802c
ServiceRequest.status
Only use the following 2 values, as appropriate: revoked is used when a SR is legitimately cancelled, entered-in-error is used when sent to the by mistake and needs to be removed.
MUST
1..1
entered-in-error
ServiceRequest.intent
This MUST be populated with 'plan' - Fixed Value
MUST
1..1
plan
ServiceRequest.category
MUST
0..1
ServiceRequest.category.coding
MUST
0..*
ServiceRequest.category.coding.system
This MUST be populated with CodeSystem 'https://fhir.nhs.uk/CodeSystem/message-category-servicerequest' - FIXED VALUE
MUST
0..1
https://fhir.nhs.uk/CodeSystem/message-category-servicerequest
ServiceRequest.category.coding.code
This MUST be populated with code value appropriate for the Application employed.
MUST
0..1
validation
ServiceRequest.category.coding.display
This MUST be populated with display value appropriate for the Application employed.
MUST
0..1
For Validation
ServiceRequest.subject
Follow BaRS profile guidance for populating this element
MUST
1..1
ServiceRequest.subjectreference
This MUST be populated with a Reference to the Patient resource
MUST
0..1
urn:uuid:9589fb37-87a2-48d8-968f-b371429208a8
ServiceRequest.encounter
MUST
0..1
ServiceRequest.encounter.reference
This MUST be populated with a Reference to the Encounter
MUST
0..1
urn:uuid:8c63d621-4d86-4f57-8699-e8e22d49935d
ServiceRequest.occurrencePeriod
Validation Breach time
MUST
0..1
ServiceRequest.occurrencePeriod.start
The start of the period must be ‘now’.
MUST
0..1
2023-03-08T12:01:08.4677672+00:00
ServiceRequest.occurrencePeriod.end
The time by which the validation must be complete (validation breach time)
MUST
0..1
2023-03-08T12:01:08.4677672+00:00
ServiceRequest.reasonCode
This will ONLY be populated in a cancellation message with the reason for cancellation
SHOULD
0..*
ServiceRequest.reasonCode.text
This SHOULD be populated. This will ONLY be populated in a cancellation message with the reason for cancellation and SHOULD only be used in conjunction with a corresponding status - revoked or entered-in-error
SHOULD
0..1
Revoked as patient has been dealt with.
This resource is used to communicate details about the patient who is the subject of the referral.
> Patient
It also includes contact information for third parties when required.
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
Patient
This resource is used to communicate details about the patient who is the subject of the referral.
It also includes contact information for third parties when required.
https://simplifier.net/hl7fhirukcorer4/ukcore-patient
1..1
Patient.id
If this value was included in the synchronous response to the original request, it MUST be populated in subsequent requests.
MUST
0..1
9589fb37-87a2-48d8-968f-b371429208a8
Patient.meta
https://simplifier.net/hl7fhirukcorer4/ukcore-patient
MUST
1..1
Patient.meta.profile
This MUST be populated. Follow UK Core guidance for populating this element
MUST
1..1
https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient
Patient.meta.LastUpdated
All resources MUST include 'lastUpdated' value, under meta section which must be the same timestamp for each resource when created from new, but must be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
1..1
2023-03-08T12:01:08.4677672+00:00
Patient.identifier
This is a human readable patient identifier. This MUST be populated with the NHS number when available. Additionally a Local Patient Identifier Should be populated where available. If no NHS number is available this Should be populated with the Local patient identifier.
SHOULD
0..*
Patient.identifier.system
https://simplifier.net/hl7-fhir--uk-core-r4-stu1-sequence/ukcore-nhsnumberverificationstatus
SHOULD
1..1
https://fhir.nhs.uk/Id/nhs-number
Patient.identifier.value
This SHOULD be populated with a human readable patient identifier. When used this MUST be populated with the NHS number when available.If no NHS number is available this SHOULD be populated with the Local patient identifier.
SHOULD
1..1
3478526985
Patient.identifier.extension
This extension is used to record the NHS number Verification status
SHOULD
0..*
Patient.identifier.extension.url
This SHOULD be populated. Where used this MUST be populated with Structure Definition 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus' - FIXED VALUE
SHOULD
1..1
https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus
Patient.identifier.extension.valueCodeableConcept
SHOULD
0..1
Patient.identifier.extension.valueCodeableConcept.coding
SHOULD
0..1
Patient.identifier.extension.valueCodeableConcept.coding.system
https://simplifier.net/hl7fhirukcorer4/extensionukcorenhsnumberverificationstatus
SHOULD
0..1
https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatus
Patient.identifier.extension.valueCodeableConcept.coding.code
Follow UK Core guidance for populating this element
SHOULD
0..1
number-present-and-verified
Patient.identifier.extension.valueCodeableConcept.coding.display
Follow UK Core guidance for populating this element
SHOULD
0..1
Number present and verified
Patient.name
SHOULD
0..*
Patient.name.use
Follow UK Core guidance for populating this element
SHOULD
0..1
official
Patient.name.text
Follow UK Core guidance for populating this element
SHOULD
0..1
Mrs Julie Jones
Patient.name.family
Follow UK Core guidance for populating this element
SHOULD
0..1
Jones
Patient.name.given
Follow UK Core guidance for populating this element
SHOULD
0..1
Julie
Patient.name.prefix
Follow UK Core guidance for populating this element
SHOULD
0..1
Mrs
Patient.gender
Follow UK Core guidance for populating this element
SHOULD
0..1
female
Patient.birthDate
Follow UK Core guidance for populating this element
SHOULD
0..1
1959-05-04
Patient.address
Follow UK Core guidance for populating this element
SHOULD
0..*
Patient.address.use
Follow UK Core guidance for populating this element
SHOULD
0..1
home
Patient.address.type
Follow UK Core guidance for populating this element
SHOULD
0..1
both
Patient.address.text
Follow UK Core guidance for populating this element
SHOULD
0..1
22 Brightside Crescent, Overtown, West Yorkshire, LS10 4YU
Patient.address.line
Follow UK Core guidance for populating this element
SHOULD
0..*
22 Brightside Crescent
Patient.address.city
Follow UK Core guidance for populating this element
SHOULD
0..1
Overtown
Patient.address.district
Follow UK Core guidance for populating this element
SHOULD
0..1
West Yorkshire
Patient.address.postalCode
Follow UK Core guidance for populating this element
SHOULD
0..1
LS10 4YU
Patient.contact
This should be used to record telecom information for the patient and/or the patient's representative for the encounter
MUST
0..*
Patient.contact.extension
MUST
0..*
Patient.contact.extension.url
This MUST be populated with Structure Definition 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank' - FIXED VALUE
MUST
0..1
https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference
Patient.contact.extension.urlvaluePositiveInt
This MUST be populated with the rank of the whole contact and MUST be populated with the value '1' for the primary person to contact for referral. There MUST be at least one contact for the referral.
MUST
0..1
1
Patient.contact.relationship
MUST
0..*
Patient.contact.relationship.coding
MUST
0..*
Patient.contact.relationship.coding.system
This MUST be populated with the CodeSystem from the ValueSet 'https://simplifier.net/hl7fhirukcorer4/valueset-ukcore-personrelationshiptype'.
Where the contact details relate to the patient this relationship MUST be populated with the value 'self'.
Where the contact details relate to a patient's representative this SHOULD be populated with their relationship to the patient.
If the relationship is not known this SHOULD be populated with the value 'Unknown'MUST
0..1
http://terminology.hl7.org/CodeSystem/v2-0131
Patient.contact.relationship.coding.code
This MUST be populated with Code of CodeSystem value. See ValueSet 'https://simplifier.net/hl7fhirukcorer4/valueset-ukcore-personrelationshiptype'.
MUST
0..1
EP
Patient.contact.relationship.coding.display
This MUST be populated with Display of CodeSystem value. See ValueSet 'https://simplifier.net/hl7fhirukcorer4/valueset-ukcore-personrelationshiptype'.
MUST
0..1
EP
Patient.contact.name
SHOULD
0..1
Patient.contact.name.family
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Grayson
Patient.contact.name.given
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Jack
Patient.contact.telecom
MUST
0..*
Patient.contact.telecom.system
This MUST be populated for the rank 1 contact. There MUST be at least one contact phone number for the referral
MUST
0..1
phone
Patient.contact.telecom.value
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
0789 1234567
Patient.contact.gender
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
male
Patient.Communication
SHOULD
0..*
Patient.Communication.Language
MUST
1..1
Patient.Communication.Language.coding
MUST
1..1
Patient.Communication.Language.coding.code
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
en
Patient.Communication.Language.coding.system
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
https://fhir.hl7.org.uk/CodeSystem/UKCore-HumanLanguage
Patient.Communication.Language.coding.display
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
English
Patient.Communication.Language.preferred
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
TRUE
Patient.extension
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..*
Patient.extension.url
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory
Patient.extension.url.valueCodeableConcept
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Patient.extension.url.valueCodeableConcept.coding
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Patient.extension.url.valueCodeableConcept.coding.system
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategory
Patient.extension.url.valueCodeableConcept.coding.code
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
A
Patient.extension.url.valueCodeableConcept.coding.display
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
British, Mixed British
Patient.generalPractitioner
This SHOULD be populated with a reference to the GP Surgery ONLY rather than a specific practitioner
SHOULD
0..*
Patient.generalPractitioner.reference
This SHOULD be populated. Where populated this MUST reference to an Organisation resource
SHOULD
0..1
urn:uuid:b83d13e2-8c2e-422c-88ac-63b8e86a4411
This resource is used to communicate details about the sender and receiver organisations.
> Organization
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
Organization
This resource is used to communicate details about the sender organisations.
https://simplifier.net/hl7fhirukcorer4/ukcore-organization
2..*
Organization.id
This MUST only be populated with an id generated by the Receiver in the synchronous HTTP response.
MUST
0..1
5d897313-c62d-4e7e-92b7-b2199804fed3
Organization.meta
https://www.hl7.org/fhir/resource.html#Meta
MUST
1..1
Organization.meta.profile
This MUST be populated. Follow UK Core guidance for populating this element
MUST
1..1
https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization
Organization.meta.lastUpdated
This MUST be populated. All resources MUST include 'lastUpdated' value, under meta section which MUST be the same timestamp for each resource when created from new, but MUST be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
1..1
2023-03-08T12:01:08.4677672+00:00
Organization.identifier
This MUST be populated with an organisation identifier e.g. ODS code
MUST
0..*
Organization.identifier.system
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
https://fhir.nhs.uk/id/ods-organization-code
Organization.identifier.value
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
ABD01
Organization.name
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
Organisation name
Entity Relationship Diagram - Cancellation Referral Request
The below diagram details the Cancellation Referral Request
Cancellation Booking Request Payload
MessageHeader Resource
Standard Patterns for BaRS Operations explains in detail how the MessageHeader resource must be used.
When cancelling a booking, in conjunction with the guidance provided under the Standard Patterns, the three important elements which drive workflow must be used as follows:
- eventCoding - this must be the same code as used in the request.
- reasonCode - a cancellation follows an initial request, therefore, this must always be 'update' for cancellation.
- definition - cancellation has a unique MessageDefinition the request must adhere to.
- focus - must point to the Appointment resource.
Appointment Resource
The 'focus' resource in a cancellation booking request is the Appointment resource. When the payload is created by the Sender and processed by the Receiver, this is the starting point from which it (the bundle) is understood and provides either the detail or references to all key FHIR resources, for example, the Patient. The guidance for this resource below provides more granular, element level, detail.
When a Receiver processes the cancellation booking request, the two key elements used are the Appointment.id and Appointment.status. The .id must already exist as a 'booked' (status) booking on the Receiver system (this must have been confirmed by a prior read (GET) by the Sender) and the .status, in the request, must be 'cancelled'. No other status is valid in the cancellation booking request.
Patient Resource
Key patient demographics should be cross-referenced between the current 'booked' (status) booking and incoming cancellation booking request to ensure validity.
Payload for Booking Cancellation Request
This payload is used to transmit all the necessary information that is required to transmit the cancellation of a Booking.
> Bundle
The Bundle resource is the container for the event message.
| BARSBundleMessage (Bundle) | https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle | ||
| type | Fixed Value | ||
| timestamp | 1.. |
| Data Item | Implementation Guidance | Necessity | Profile Cardinality | Example Value(s) |
|---|---|---|---|---|
| Bundle | The Bundle resource is the container for the event message https://simplifier.net/nhsbookingandreferrals/barsbundlemessage | 1..1 | ||
| Bundle.id | This id is generated by the originating sender of the message, retained in subsequent messages.. | MUST | 1..1 | 79120f41-a431-4f08-bcc5-1e67006fcae0 |
| Bundle.meta | https://www.hl7.org/fhir/resource.html#Meta | MUST | 0..1 | |
| Bundle.meta.versionId | This MUST be populated with the version of the Application the bundle complies with. The Receiver will read this to know whether they are capable of processing. | MUST | 0..1 | 1.0.0-beta |
| Bundle.meta.profile | This MUST be populated with the structure definition for BaRSBundleMessage : 'https://fhir.nhs.uk/StructureDefinition/BARSBundleMessage' - FIXED VALUE | MUST | 0..1 | https://fhir.nhs.uk/StructureDefinition/BARSBundleMessage |
| Bundle.meta.lastUpdated | All resources MUST include 'lastUpdated' value, under meta section which must be the same timestamp for each resource when created from new, but must be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent. | MUST | 1..1 | 2023-03-08T12:01:08.4677672+00:00 |
| Bundle.type | This must be populated with 'message' - FIXED VALUE | MUST | 1..1 | message |
| Bundle.timestamp | the date that the content of the message was assembled. This date is not changed by middleware engines unless they add additional data that changes the meaning of the time of the message | MUST | 0..1 | 2023-03-08T12:01:08.4677672+00:00 |
| Bundle.entry(s) | Follow BaRS profile guidance for populating this element | MUST | 1..* | |
| Bundle.entry.fullUrl | unique identifier for the resource entry. Transient id relative to the bundle | MUST | 0..1 | urn:uuid:1cbdfb97-5859-48a4-8301-d54eab818d68 |
| Bundle.entry.resourceType | Resources detailed in the message definition. | MUST | 0..1 | MessageHeader,Patient, Encounter |
A resource that describes the BaRS message being exchanged between two systems.
> Message Header
BARSMessageHeaderServiceRequestRequest (MessageHeader) https://fhir.hl7.org.uk/StructureDefinition/UKCore-MessageHeader event[x] system 1.. code 1.. destination 1.. receiver reference 1.. sender reference 1.. identifier assigner reference 1.. source extension 0.. myExtension 0.. Extension(Complex) endpoint reason 1.. coding system Fixed Value focus reference 1..
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
MessageHeader
A resource that describes the BaRS message being exchanged between two systems https://simplifier.net/nhsbookingandreferrals/barsmessageheaderservicerequestrequest
1..1
MessageHeader.meta
https://www.hl7.org/fhir/resource.html#Meta
MUST
0..1
MessageHeader.meta.profile
This MUST be populated with the structure definition for BARSMessageHeader-booking-request
MUST
0..1
https://fhir.nhs.uk/StructureDefinition/BARSMessageHeader-booking-request
MessageHeader.meta.lastUpdated
All resources MUST include 'lastUpdated' value, under the meta section which MUST be the same timestamp for each resource when created from new, but MUST be a later timestamp on updates to resources, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
0..1
2023-03-08T12:01:08.4677672+00:00
MessageHeader.eventcoding
MUST
1..1
MessageHeader.eventcoding.system
This MUST be populated with CodeSystem 'https://fhir.nhs.uk/CodeSystem/message-events-bars' - FIXED VALUE
MUST
0..1
https://fhir.nhs.uk/CodeSystem/message-events-bars
MessageHeader.eventcoding.code
The status MUST be populated with 'booking-request'. See CodeSystem: 'https://fhir.nhs.uk/CodeSystem/message-events-bars' - FIXED VALUE
MUST
0..1
booking-request
MessageHeader.destination
MUST
0..1
MessageHeader.destination.receiver
MUST
0..1
MessageHeader.destination.receiver.reference
This MUST be populated with the full URL to the Receiving Organisation resource.
MUST
0..1
urn:uuid:10397afd-479c-42ea-9d5d-e4024481e0f8
MessageHeader.destination.endpoint
This MUST be populated with the system and Service ID separated by a pipe. for example https://fhir.nhs.uk/id/dos-service-id\|11111111, this is to ensure the receiver knows the intended destination.
MUST
1..1
https://fhir.nhs.uk/id/dos-service-id\|1122334455
MessageHeader.sender
MUST
0..1
MessageHeader.sender.reference
This MUST be populated. Follow BaRS profile guidance for populating this element
MUST
0..1
urn:uuid:07939a0c-2854-46ff-9282-ad906bc93679
MessageHeader.source
MUST
1..1
MessageHeader.source.name
This MUST be populated with the sending system supplier name
MUST
0..1
NHS Trust
MessageHeader.source.software
This SHOULD be populated with the sending software application name
SHOULD
0..1
Supplier Software
MessageHeader.source.version
This SHOULD be populated with the sending software version
SHOULD
0..1
V1.0.0
MessageHeader.source.contact
SHOULD
0..1
MessageHeader.source.contact.system
This SHOULD be populated with the Contact Type - phone | fax | email | pager | url | sms | other
SHOULD
0..1
phone
MessageHeader.source.contact.value
This SHOULD be populated with the Contact Type value
SHOULD
0..1
+44 (0123) 123 4567
MessageHeader.source.endpoint
This MUST be populated with the system and Service ID separated by a pipe. for example https://fhir.nhs.uk/id/dos-service-id\|11111111, this is to ensure the receiver knows where any response messages SHOULD be addressed.
MUST
1..1
https://fhir.nhs.uk/id/dos-service-id\|5566778899
MessageHeader.reason
MUST
0..1
MessageHeader.reason.coding
MUST
0..1
MessageHeader.reason.coding.system
This MUST be populated with 'https://fhir.nhs.uk/CodeSystem/message-reason-bars' - FIXED VALUE
MUST
0..1
https://fhir.nhs.uk/CodeSystem/message-reason-bars
MessageHeader.reason.coding.code
This MUST be populated with "delete" for an cancellation. See CodeSystem: 'https://fhir.nhs.uk/CodeSystem/message-events-bars'
MUST
0..1
delete
MessageHeader.reason.coding.display
This MUST be populated with 'Delete' when cancelling a Booking.
SHOULD
0..1
Delete
MessageHeader.focus
MUST
0..*
MessageHeader.focus.reference
This MUST be populated with a reference to the ServiceRequest
MUST
0..1
urn:uuid:236bb75d-90ef-461f-b71e-fde7f899802c
MessageHeader.definition
This MUST be populated with the MessageDefinition the bundle is based on. This will be used for validation. Value - hhttps://fhir.nhs.uk/MessageDefinition/bars-message-booking-request-cancelled
MUST
0..1
https://fhir.nhs.uk/MessageDefinition/bars-message-booking-request-cancelled
This resource will be used to communicate information about an Appointment and is the focus of the Booking interation.
> Appointment
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
Appointment
https://simplifier.net/hl7fhirukcorer4/ukcore-appointment
This resource will be used to communicate information about an appointment.
1..1
Appointment.id
This MUST only be populated with an id generated by the Receiver in the synchronous HTTP response.
MUST
0..1
3713c8fc-dbcf-4f90-bacf-89d99e434e9b
Appointment.meta
https://www.hl7.org/fhir/resource.html#Meta
MUST
1..1
Appointment.meta.profile
This MUST be populated. Follow UK Core guidance for populating this element
MUST
1..1
https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment
Appointment.meta.lastupdated
This MUST be populated. All resources MUST include 'lastUpdated' value, under meta section which MUST be the same timestamp for each resource when created from new, but MUST be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
1..1
2023-03-08T12:01:08.4677672+00:00
Appointment.status
This MUST be populated with 'cancelled'
MUST
1..1
cancelled
Appointment.description
This SHOULD be populated. It is the human readable description of the booking
SHOULD
0..1
Reason for calling
Appointment.start
This MUST be populated with the Start time of the booking
MUST
0..1
2021-10-12T12:30:00+00:00
Appointment.end
This MUST be populated with the End time of the booking
MUST
0..1
2021-10-12T12:30:00+00:00
Appointment.slot
MUST
0..*
Appointment.slot.reference
This MUST be populated with the local logical bundle reference to the Slot resource
MUST
0..1
urn:uuid:c3f6145e-1a26-4345-b3f2-dccbcba62049
Appointment.created
This MUST only be populated with the date/time the booking was generated by the Receiver in the synchronous HTTP response.
MUST
0..1
2021-10-11T15:01:30+00:00"
Appointment.basedOn
This MAY be populated. When the Service Request is made before the booking in the workflow this MUST be populated.
MAY
0..*
Appointment.basedOn.reference
This MAY be populated. This is MUST be the relative reference to the Service Request when referral is made before booking in the workflow
MAY
0..1
ServiceRequest/236bb75d-90ef-461f-b71e-fde7f899802c
Appointment.participant
MUST
1..1
Appointment.participant.actor
This MUST be populated with reference to the patient
MUST
0..1
Appointment.participant.actor.reference
This MUST be populated with the local logical bundle reference to the Patient resource
MUST
0..1
urn:uuid:3a62607b-df65-4932-940c-14262787f62d
Appointment.participant.actor.status
This MUST be populated with 'accepted' - FIXED VALUE
MUST
1..1
accepted
This resource is used to communicate details about the patient who is the subject of the referral.
> Patient
It also includes contact information for third parties when required.
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
Patient
This resource is used to communicate details about the patient who is the subject of the referral.
It also includes contact information for third parties when required.
https://simplifier.net/hl7fhirukcorer4/ukcore-patient
1..1
Patient.id
If this value was included in the synchronous response to the original request, it MUST be populated in subsequent requests.
MUST
0..1
9589fb37-87a2-48d8-968f-b371429208a8
Patient.meta
https://simplifier.net/hl7fhirukcorer4/ukcore-patient
MUST
1..1
Patient.meta.profile
This MUST be populated. Follow UK Core guidance for populating this element
MUST
1..1
https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient
Patient.meta.LastUpdated
All resources MUST include 'lastUpdated' value, under meta section which must be the same timestamp for each resource when created from new, but must be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
1..1
2023-03-08T12:01:08.4677672+00:00
Patient.identifier
This is a human readable patient identifier. This MUST be populated with the NHS number when available. Additionally a Local Patient Identifier Should be populated where available. If no NHS number is available this Should be populated with the Local patient identifier.
SHOULD
0..*
Patient.identifier.system
https://simplifier.net/hl7-fhir--uk-core-r4-stu1-sequence/ukcore-nhsnumberverificationstatus
SHOULD
1..1
https://fhir.nhs.uk/Id/nhs-number
Patient.identifier.value
This SHOULD be populated with a human readable patient identifier. When used this MUST be populated with the NHS number when available.If no NHS number is available this SHOULD be populated with the Local patient identifier.
SHOULD
1..1
3478526985
Patient.identifier.extension
This extension is used to record the NHS number Verification status
SHOULD
0..*
Patient.identifier.extension.url
This SHOULD be populated. Where used this MUST be populated with Structure Definition 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus' - FIXED VALUE
SHOULD
1..1
https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus
Patient.identifier.extension.valueCodeableConcept
SHOULD
0..1
Patient.identifier.extension.valueCodeableConcept.coding
SHOULD
0..1
Patient.identifier.extension.valueCodeableConcept.coding.system
https://simplifier.net/hl7fhirukcorer4/extensionukcorenhsnumberverificationstatus
SHOULD
0..1
https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatus
Patient.identifier.extension.valueCodeableConcept.coding.code
Follow UK Core guidance for populating this element
SHOULD
0..1
number-present-and-verified
Patient.identifier.extension.valueCodeableConcept.coding.display
Follow UK Core guidance for populating this element
SHOULD
0..1
Number present and verified
Patient.name
SHOULD
0..*
Patient.name.use
Follow UK Core guidance for populating this element
SHOULD
0..1
official
Patient.name.text
Follow UK Core guidance for populating this element
SHOULD
0..1
Mrs Julie Jones
Patient.name.family
Follow UK Core guidance for populating this element
SHOULD
0..1
Jones
Patient.name.given
Follow UK Core guidance for populating this element
SHOULD
0..1
Julie
Patient.name.prefix
Follow UK Core guidance for populating this element
SHOULD
0..1
Mrs
Patient.gender
Follow UK Core guidance for populating this element
SHOULD
0..1
female
Patient.birthDate
Follow UK Core guidance for populating this element
SHOULD
0..1
1959-05-04
Patient.address
Follow UK Core guidance for populating this element
SHOULD
0..*
Patient.address.use
Follow UK Core guidance for populating this element
SHOULD
0..1
home
Patient.address.type
Follow UK Core guidance for populating this element
SHOULD
0..1
both
Patient.address.text
Follow UK Core guidance for populating this element
SHOULD
0..1
22 Brightside Crescent, Overtown, West Yorkshire, LS10 4YU
Patient.address.line
Follow UK Core guidance for populating this element
SHOULD
0..*
22 Brightside Crescent
Patient.address.city
Follow UK Core guidance for populating this element
SHOULD
0..1
Overtown
Patient.address.district
Follow UK Core guidance for populating this element
SHOULD
0..1
West Yorkshire
Patient.address.postalCode
Follow UK Core guidance for populating this element
SHOULD
0..1
LS10 4YU
Patient.contact
This should be used to record telecom information for the patient and/or the patient's representative for the encounter
MUST
0..*
Patient.contact.extension
MUST
0..*
Patient.contact.extension.url
This MUST be populated with Structure Definition 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank' - FIXED VALUE
MUST
0..1
https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference
Patient.contact.extension.urlvaluePositiveInt
This MUST be populated with the rank of the whole contact and MUST be populated with the value '1' for the primary person to contact for referral. There MUST be at least one contact for the referral.
MUST
0..1
1
Patient.contact.relationship
MUST
0..*
Patient.contact.relationship.coding
MUST
0..*
Patient.contact.relationship.coding.system
This MUST be populated with the CodeSystem from the ValueSet 'https://simplifier.net/hl7fhirukcorer4/valueset-ukcore-personrelationshiptype'.
Where the contact details relate to the patient this relationship MUST be populated with the value 'self'.
Where the contact details relate to a patient's representative this SHOULD be populated with their relationship to the patient.
If the relationship is not known this SHOULD be populated with the value 'Unknown'MUST
0..1
http://terminology.hl7.org/CodeSystem/v2-0131
Patient.contact.relationship.coding.code
This MUST be populated with Code of CodeSystem value. See ValueSet 'https://simplifier.net/hl7fhirukcorer4/valueset-ukcore-personrelationshiptype'.
MUST
0..1
EP
Patient.contact.relationship.coding.display
This MUST be populated with Display of CodeSystem value. See ValueSet 'https://simplifier.net/hl7fhirukcorer4/valueset-ukcore-personrelationshiptype'.
MUST
0..1
EP
Patient.contact.name
SHOULD
0..1
Patient.contact.name.family
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Grayson
Patient.contact.name.given
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Jack
Patient.contact.telecom
MUST
0..*
Patient.contact.telecom.system
This MUST be populated for the rank 1 contact. There MUST be at least one contact phone number for the referral
MUST
0..1
phone
Patient.contact.telecom.value
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
0789 1234567
Patient.contact.gender
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
male
Patient.Communication
SHOULD
0..*
Patient.Communication.Language
MUST
1..1
Patient.Communication.Language.coding
MUST
1..1
Patient.Communication.Language.coding.code
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
en
Patient.Communication.Language.coding.system
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
https://fhir.hl7.org.uk/CodeSystem/UKCore-HumanLanguage
Patient.Communication.Language.coding.display
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
English
Patient.Communication.Language.preferred
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
TRUE
Patient.extension
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..*
Patient.extension.url
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory
Patient.extension.url.valueCodeableConcept
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Patient.extension.url.valueCodeableConcept.coding
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
Patient.extension.url.valueCodeableConcept.coding.system
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategory
Patient.extension.url.valueCodeableConcept.coding.code
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
A
Patient.extension.url.valueCodeableConcept.coding.display
This SHOULD be populated. Follow UK Core guidance for populating this element
SHOULD
0..1
British, Mixed British
Patient.generalPractitioner
This SHOULD be populated with a reference to the GP Surgery ONLY rather than a specific practitioner
SHOULD
0..*
Patient.generalPractitioner.reference
This SHOULD be populated. Where populated this MUST reference to an Organisation resource
SHOULD
0..1
urn:uuid:b83d13e2-8c2e-422c-88ac-63b8e86a4411
This resource is used to communicate details about the sender and receiver organisations.
> Organization
Data Item
Implementation Guidance
Necessity
Profile Cardinality
Example Value(s)
Organization
This resource is used to communicate details about the sender organisations.
https://simplifier.net/hl7fhirukcorer4/ukcore-organization
2..*
Organization.id
This MUST only be populated with an id generated by the Receiver in the synchronous HTTP response.
MUST
0..1
5d897313-c62d-4e7e-92b7-b2199804fed3
Organization.meta
https://www.hl7.org/fhir/resource.html#Meta
MUST
1..1
Organization.meta.profile
This MUST be populated. Follow UK Core guidance for populating this element
MUST
1..1
https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization
Organization.meta.lastUpdated
This MUST be populated. All resources MUST include 'lastUpdated' value, under meta section which MUST be the same timestamp for each resource when created from new, but MUST be a later timestamp on updates, if the content of a particular resource contains updated info for subsequent updates. Otherwise, maintain the timestamp originally sent.
MUST
1..1
2023-03-08T12:01:08.4677672+00:00
Organization.identifier
This MUST be populated with an organisation identifier e.g. ODS code
MUST
0..*
Organization.identifier.system
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
https://fhir.nhs.uk/id/ods-organization-code
Organization.identifier.value
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
ABD01
Organization.name
This MUST be populated. Follow UK Core guidance for populating this element
MUST
0..1
Organisation name
Entity Relationship Diagram - Cancellation Booking Request
The below diagram details the Cancellation Booking Request
Use Case Categories
What are use case categories?
Use case categories define the specific type of referral being requested. The type is categorised at the service level. A BaRS Application can support multiple use cases; a use case can only ever belong to one BaRS Application. For instance, in Application 6 there are three defined use cases: Out of Area, Mutual Aid and Call Assist. All of these use cases relate to referrals between Ambulance Service Trusts but the workflow, timeframes and responses are not universal across all three scenarios.
The BaRS use case categories are defined in the BARS CodeSystem (https://simplifier.net/nhsbookingandreferrals/usecases-categories-bars). All BaRS compliant solutions must adopt use case categories.
How to use BaRS use case categories
The use case category is used in the initial content negotiation phase:
- when a Sender makes a request for MessageDefinitions and the Receiver responds
- when the Sender makes a referral request to the Receiver
When a Sender makes a request for MessageDefinitions, the MessageDefinitions returned by the Receiver will contain a use case category code (from the use case categories code system) under Message.Definition.useContext.code. The Sender must read this field to verify the Receiver supports the use case workflow they require. The use case category code will also be included in:
- the Sender's service request under ServiceRequest.category
- the Sender’s booking request under Appointment.ServiceCategory
If this is not a use case supported by the Receiver, they will respond with an error (Operation Outcome).
The sequence of events occurs as follows:
- the Sender requests the MessageDefinitions
- the Receiver indicates the use-case categories they support
- the Sender reads and only engages in the use-case workflows supported
- the Sender's request includes the use-case category code (the same code they read from the MessageDefinition), under ServiceRequest.category (referral) or Appointment.ServiceCategory (booking)
- the Receiver processes accordingly