Subscription API
Create Subscription - POST /fhir/Subscription
POST /fhir/Subscription
Creates a new subscription. Takes params depending on the current version of FHIR used in Aidbox.
The R4B Subscriptions resource uses FHIR extension fields that should be written according to the specification.
You should also add the subscription backport profile URL to your resource's meta.profile
field.
Params:
Parameter | Type | Required | Description |
---|---|---|---|
meta | object | ||
meta.profile | string[] | ||
id | string | Identifier of the resource. Will be auto-generated if not provided. | |
reason | string | Human readable reason for subscription. | |
criteria | string | Canonical URL for the topic used to generate events. Example: http://aidbox.app/SubscriptionTopic/patient-test-1 | |
criteria.extension: | string[] | The filters applied to events in the following format:
(
When multiple filters are applied, it evaluates to true if all the conditions applicable to that resource are met; otherwise, it returns false (i.e., logical AND). Example: patient-birth=gt2005-01-01T01:00:00Z | |
channel.extension: | integer | Interval in seconds to send 'heartbeat' notification. Default value: 120 | |
channel.extension: | integer | Timeout in seconds to attempt notification delivery. Default value: 30 | |
channel.extension: | integer | Maximum number of triggering resources included in notification bundles. Default value: 10 | |
channel.type | string | The type of channel to send notifications on. Supported values: rest-hook | |
channel.header | string[] | Additional headers/information to send as part of the notification. For the rest-hook channel type, this will be HTTP request headers. Example: ["random-header: secret123"] | |
channel.endpoint | string | The URL that describes the actual end-point to send messages to. Example: https://my.app/endpoint | |
channel.payload | string | MIME-type to send, or omit for no payload. Supported values: application/fhir+json | |
channel.payload.extension: | string | ||
status | string | Status of the subscription. On the creation of this resource, the status is always | |
end | string | When to automatically delete the subscription. |
Result:
Parameter | Type | Description |
---|---|---|
resource | object | Created Subscription resource. |
Subscription Status - GET /fhir/Subscription/[id]/$status
GET /fhir/Subscription/[id]/$status
This operation is used to get the current status information about a topic-based Subscription.
Returns FHIR bundle where the SubscriptionStatus resource is the only entry element.
Params:
No params are required.
Subscription Events - GET /fhir/Subscription/[id]/$events
GET /fhir/Subscription/[id]/$events
This operation is used to search for and get notifications that have been previously triggered by a topic-based Subscription.
Returns FHIR bundle where the SubscriptionStatus resource is the first entry element, and triggered events are the rest.
Params:
Parameter | Type | required | Description |
---|---|---|---|
eventsSinceNumber | integer | The starting event number, inclusive of this event (lower bound). | |
eventsUntilNumber | integer | The ending event number, inclusive of this event (upper bound). |
If the params above are not provided, returns the latest 20 events.
Delete Subscription - DELETE /fhir/Subscription/[id]
DELETE /fhir/Subscription/[id]
Delete Subscription resource.
Result:
Parameter | Type | Description |
---|---|---|
resource | object | Deleted Subscription resource. |
Last updated