This page is part of the Subscriptions R5 Backport (v1.1.0: STU 1.1) based on FHIR v4.3.0. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions
This section gives an overview of the workflow for both Servers and Clients to work with Subscriptions. Each channel MAY vary slightly from this general overview - specifically around interactions involving the Endpoint (e.g., when using a rest-hook the client must pre-configure an HTTP endpoint which the server validates, but when using websockets the client simply connects to the server).
Overview
The workflow for topic-based subscriptions can be broken down into three matched process steps for each a server or client:
#
Server
Client
1.
Implement Topic-Based Subscriptions
Topic Discovery
2.
Subscription Negotiation
Request a Subscription
3.
Send Notifications
Receive Notifications
Workflow: FHIR R4B
Server implements the core functionality required for subscriptions (see Conformance).
Server implements one or more SubscriptionTopic resources. Implementation is specific to each topic, and will vary between servers.
Client asks the server for the list of supported SubscriptionTopic resources, via querying the resource.
Client ensures that the endpoint is prepared (if applicable - see Channels).
Client requests a Subscription (e.g., via POST, PUT, etc.).
Server MAY accept the Subscription request and mark it active (e.g., supported channel and payload, no handshake required).
Server MAY accept the Subscription request and mark it requested (e.g., supported channel and payload, handshake required).
Server sends a handshake bundle to the endpoint.
If the Endpoint responds appropriately, per the channel requirements (e.g., in REST an HTTP Success code such as 200), the Server updates the subscription to active.
Server MAY accept the Subscription request and mark it requested (e.g., supported channel and payload, handshake required).
Server sends a handshake bundle to the endpoint.
If the handshake fails (e.g., connection failure, bad response, etc.), the Server updates the subscription to error.
Server MAY reject the Subscription request (e.g., unsupported channel type).
Once the subscription is active, notifications will be sent according to the Channel. Note that error states may occur, see Handling Errors for more information.
Workflow: FHIR R4
Server implements the core functionality required for subscriptions (see Conformance).
Server implements one or more subscription topics. Implementation is specific to each topic, and will vary between servers.
Optional Client attempts topic discovery via the CapabilityStatement.instantiates element.
Server responds with its CapabilityStatement.
Optional Client attempts topic discovery via the CapabilityStatement.implementationGuide element.
Server responds with its CapabilityStatement.
Client ensures that the endpoint is prepared (if applicable - see Channels).
Client requests a Subscription (e.g., via POST, PUT, etc.).
Server MAY accept the Subscription request and mark it active (e.g., supported channel and payload, no handshake required).
Server MAY accept the Subscription request and mark it requested (e.g., supported channel and payload, handshake required).
Server sends a handshake bundle to the endpoint.
If the Endpoint responds appropriately, per the channel requirements (e.g., in REST an HTTP Success code such as 200), the Server updates the subscription to active.
Server MAY accept the Subscription request and mark it requested (e.g., supported channel and payload, handshake required).
Server sends a handshake bundle to the endpoint.
If the handshake fails (e.g., connection failure, bad response, etc.), the Server updates the subscription to error.
Server MAY reject the Subscription request (e.g., unsupported channel type).
Once the subscription is active, notifications will be sent according to the Channel. Note that error states may occur, see Handling Errors for more information.