Subscriptions Tour
This page contains a tour of topic-based subscriptions in FHIR R4 .
Choose a topic
In FHIR R4, topics are discovered by looking at the server
CapabilityStatement
for the
SubscriptionTopic Canonical Extension.
For this walkthrough, we will be using the included encounter-complete
topic that has a canonical URL of http://example.org/FHIR/SubscriptionTopic/encounter-complete
.
The current metadata for this server can be viewed
here,
or requested (in FHIR) at
https://subscriptions.argo.run/fhir/r4/metadata
.
Note that in FHIR R4, there is not an official required format for representing SubscriptionTopic
resources. Since topics are canonical resources, the expectation is that they will be defined
by authors (e.g., in Implementation Guides) and communicated out-of-band. For example, for
an "encounter-start" topic, both the server and client can function with only the
canonical URL and the understanding of what that topic represents.
With that said, one possible way of representing topics in FHIR R4 is to use the model provided
in FHIR R5, ported using FHIR cross-version support. This implementation supports topics defined via
that mechanism. Our included encounter-complete
topic is thus available on this server
at Basic/encounter-complete
or in FHIR at
https://subscriptions.argo.run/fhir/r4/Basic/encounter-complete
.
Configure a subscription
In this step, we are configuration the subscription options.
The following options are fixed for this walkthrough and are displayed only for reference:
The following options are selected in this walkthrough:
Select filter data
The final piece of configuration for a subscription are filter values.
In this tour, we will be using Patient/example
as a
patient filter for our topic. Note that allowed filters are defined
by each topic.
Request subscription
With our configuration complete, we are ready to create our resource and request it on the server.
Server performs handshake
Waiting for handshake.
Check handshake
Trigger a notification
The topic we are using is set to trigger when an Encounter
is set to the
status of finished
. This can be true either when the encounter
resource is create, or it could be updated from another state.
Since we specified the filter that encounters need to have a patient
that matches Patient/example
, we need to also set the subject
reference to that patient.
For simplicity during this walkthrough, we will create an encounter with all the values needed to trigger a notification.
Review notifications
Waiting for notifications...
Clean up
That completes this tour. If you have any questions, comments, or suggestions for this software, please let us know. A link to the GitHub repository for this project can be found on the top right corner of the screen.
Please click the button below to remove the resources created during this session. Thank you!