Skip to main content

Subscription Resource

FHIR Subscriptions allow external applications to receive notifications when specific events occur in AdvaPACS. Rather than repeatedly polling the FHIR API for changes, clients can subscribe to selected resources and receive notifications whenever matching resources are created, updated, or deleted.

Subscriptions are useful for integrating AdvaPACS with downstream systems, automating workflows, and keeping external applications synchronised with the latest clinical information. For full information on the Subscription resource, please refer to the FHIR Standard.


Important

Subscription support is currently limited to FHIR R4. If your application uses FHIR R5 Subscriptions, it must be adapted to the R4 specification when integrating with AdvaPACS.

Supported Transactions

AdvaPACS Supports the following transactions:

FunctionMethodEndpointDescription
Get SubscriptionGET/Subscription/{id}Retrieves a specific Subscription resource by its logical ID.
Search SubscriptionsGET/SubscriptionSearches for Subscription resources using one or more supported search parameters.
Create SubscriptionPOST/SubscriptionCreates a new Subscription resource.
Delete SubscriptionDELETE/Subscription/{id}Deletes an existing Subscription resource.

Create a Subscription

Create a new FHIR Subscription by submitting a Subscription resource to the FHIR server. The request defines the events to subscribe to, how notifications are delivered, and the endpoint that will receive them.

POST /Subscription
Authorization: ID=<ApiId>,Secret=<ApiSecret>
Content-Type: application/json
Host: <FhirEndpoint>

The following fields are supported when creating a Subscription:

FieldDescriptionExample
resourceTypeThe FHIR resource being created. This must always be Subscription.Subscription
statusThe initial status of the subscription. Typically requested when first created.requested
endThe date and time when the subscription expires. Omit this field if the subscription should remain active indefinitely.2024-01-01T00:00:00Z
reasonA human-readable description of the subscription's purpose. This is for informational purposes only.Test Patient
criteriaSpecifies which resource or search criteria should trigger notifications.ImagingStudy
channelTypeSpecifies how notifications are delivered.rest-hook
payloadSpecifies the format of the notification payload. An empty value indicates no resource content is included.""
endpointThe URL that will receive notification requests.https://example.com/webhook

Example Request

The following will create a a new subscription which will trigger a REST Webhook each time an ImagingStudy is updated.

POST fhir/Subscription
Host: sgp.integration.advapacs.com
Authorization: ID=<ApiId>,Secret=<ApiSecret>
Content-Type: application/fhir+json
{
"resourceType": "Subscription",
"status": "requested",
"end": "2024-01-01T00:00:00Z",
"reason": "Test Patient",
"criteria": "ImagingStudy",
"channelType": "rest-hook",
"payload": "",
"endpoint": "https://webhook.site/0c73e853-fb0d-4e7a-b40a-991b31736b20"
}

Example Response

If successful, the server returns the newly created Subscription resource, including its logical ID.

{
"resourceType": "Subscription",
"id": "2d5eb12f-9139-4d7f-a7cb-2f3a8f58b7ef",
"status": "requested",
"end": "2024-01-01T00:00:00Z",
"reason": "Test Patient",
"criteria": "ImagingStudy",
"channelType": "rest-hook",
"payload": "",
"endpoint": "https://webhook.site/0c73e853-fb0d-4e7a-b40a-991b31736b20"
}