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.
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:
| Function | Method | Endpoint | Description |
|---|---|---|---|
| Get Subscription | GET | /Subscription/{id} | Retrieves a specific Subscription resource by its logical ID. |
| Search Subscriptions | GET | /Subscription | Searches for Subscription resources using one or more supported search parameters. |
| Create Subscription | POST | /Subscription | Creates a new Subscription resource. |
| Delete Subscription | DELETE | /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:
| Field | Description | Example |
|---|---|---|
resourceType | The FHIR resource being created. This must always be Subscription. | Subscription |
status | The initial status of the subscription. Typically requested when first created. | requested |
end | The date and time when the subscription expires. Omit this field if the subscription should remain active indefinitely. | 2024-01-01T00:00:00Z |
reason | A human-readable description of the subscription's purpose. This is for informational purposes only. | Test Patient |
criteria | Specifies which resource or search criteria should trigger notifications. | ImagingStudy |
channelType | Specifies how notifications are delivered. | rest-hook |
payload | Specifies the format of the notification payload. An empty value indicates no resource content is included. | "" |
endpoint | The 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"
}