Subscriptions R5 Backport
0.1.0 - ballot

Subscriptions R5 Backport - Local Development build (v0.1.0). 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:

FHIR ServerFHIR ServerClientClientEndpointServer Implementation1Implement core Subscription functionality2Implement topics and advertise viaSubscriptionTopicresourcesClient Implementation[Client Topic Discovery]3Search for a supportedSubscriptionTopic, e.g.:GET .../SubscriptionTopic?[params]4Bundlewith matchingSubscriptionTopicresources[Client Subscription Request]5Create, configure, or initializethe necessary EndpointEndpoint6Create a Subscription, e.g.:POST .../SubscriptionServer Accepting or Rejecting a Subscription[Valid Subscription, without Handshake]7Success: status =activeSend notifications...[Valid Subscription, with Handshake Success]8Success: status =requested9Handshake10Success, e.g.:200: OKUpdate Subscription:Subscription.status: errorSend notifications...[Valid Subscription, with Handshake Failure]11Success: status =requested12Handshake13Failure, e.g.:404: Not FoundUpdate Subscription:Subscription.status: error[Invalid Subscription]14Failure, e.g.:400: Bad RequestNo subscription was created
Sequence diagram of creating a FHIR Subscription
  1. Server implements the core functionality required for subscriptions (see Conformance).
  2. Server implements one or more SubscriptionTopic resources. Implementation is specific to each topic, and will vary between servers.
  3. Client asks the server for the list of supported SubscriptionTopic resources, via querying the resource.
  4. Server responds with a searchset Bundle.
  5. Client ensures that the endpoint is prepared (if applicable - see Channels).
  6. Client requests a Subscription (e.g., via POST, PUT, etc.).
  7. Server MAY accept the Subscription request (e.g., supported channel and payload).
  8. Server MAY reject the Subscription request (e.g., unsupported channel type).
  9. If applicable, the server MAY send a handshake to the endpoint.
  10. If the Server sends a handshake, the endpoint should respond appropriately.

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.