This page is part of the Subscriptions R5 Backport (v1.0.0: STU 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
Workflow
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).
Creating a Subscription
A workflow for creating a subscription is below:
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.