Last updated
Was this helpful?
Last updated
Was this helpful?
While Aidbox SubSubscriptions are stable and fully functional, they will no longer receive active development or new features. For enhanced capabilities and ongoing support, please use . This newer implementation offers improved performance, flexibility, and will continue to be developed to meet future needs.
Aidbox subscriptions module is a way to subscribe and get notifications about updating resources on the server. It is a common denominator of FHIR R4/R5 subscriptions specification with some extensions.
This module introduces two new resources into Aidbox:
SubsSubscription — meta-resource which binds events (create/update/delete resource) with a communication channel through which subscriber is notified about changes.
SubsNotification — resource which represents notification with its status (sent or not).
Aidbox doesn't delete SubsNotification resources by itself. The simple way to implement a retention policy is to create a cron job. if there is a more clear way.
Your service can register subscription by POST SubsSubscription resource:
Filter matches if at least one of item in the collection matches, i.e. collection has or
semantic.
After you registered subscription, Aidbox sends on channel.endpoint handshake
notification in json format. It's good if your service responds with status: 200
On every trigger event Aidbox will send a notification to your service endpoint. Your service has to respond with status: 200
and optional json body.
Results of all notifications are logged into SubsNotification resource:
You can force a handshake notification for the specific subscription with:
To debug subscription notifications, you can send debug messages with:
Or you can send a list of notifications by providing a list of search params:
You can resend the specific notification with
You can subscribe one instance of Aidbox to notifications from another instance and replicate data between boxes by using /subs/webhook/<source-id>
endpoint:
Subscription.trigger is a key-value object, where key is resource type and each value can contain a collection of events (values can be 'all', 'create', 'update', 'delete') and .filter collection. For now filter support engine (FHIRPath and FHIR Search filters are coming soon):