Profiles & Operations > Interaction: Search Subscriptions
Interaction: Search Subscriptions
The Search Subscriptions interaction allows an Electronic Medical Record (EMR) system to retrieve all active Subscriptions it has previously created. This interaction is aligned with the FHIR R5 Subscription Backport model.
The requesting EMR is identified by a unique emr_id
, passed as a search parameter. The server returns a Bundle
of type searchset
containing matching Subscription
resources.
Scope
This interaction involves a request by a Point of Service system to search Subscriptions based on the search criteria. The request is received by the Subscription service which assembles list of Subscription that match search criteria and an OperationOutcome resource if applicable.
Interaction Sequence Diagram
Specification
Search Subscription Request
The Search Subscription shall retrieve all FHIR Subscription resource from the repository created by specific EMR instance.
'GET \[base]/Subscription?emr_id=[EMR_ID]'
Search Parameter
Name | Type | Cardinality | Description |
---|---|---|---|
emr_id | token | 1..1 | Unique identifier for the EMR that owns the subscription. Filtered against meta.tag.code . |
Note: The
emr_id
parameter is a custom search parameter mapped toSubscription.meta.tag
.
Search Subscription Response
The server returns a 200 OK HTTP status code.
The response bodfy contains FHIR Resource Type:
Bundle
(type =searchset
)Each
entry.resource
is aSubscription
that matches the providedemr_id
.
Example Search Subscriptions Interaction
Example Search Subscriptions Request
GET [base]/Subscription?emr_id=EMR-12345]
POST method can be used when search parameters are too complex or long for a URL (e.g., long queries or special characters). Parameters are passed in the body as application/x-www-form-urlencoded.
POST [base]/Subscription/_search
Content-Type: application/x-www-form-urlencoded
Example Search Subscriptions Response Body
{ "resourceType": "Bundle", "type": "searchset", "total": 2, "entry": [ { "resource": { "resourceType": "Subscription", "id": "sub-001", "status": "active", "criteria": "Patient?identifier=12345", "channelType": { "code": "rest-hook" }, "endpoint": "https://emr.example.org/notify", "content": "id-only", "meta": { "tag": [ { "system": "https://healthauthority.ca/fhir/emr-id", "code": "EMR-12345" } ] } } }, { "resource": { "resourceType": "Subscription", "id": "sub-002", "status": "active", "criteria": "Encounter?status=planned", "channelType": { "code": "rest-hook" }, "endpoint": "https://emr.example.org/notify", "content": "id-only", "meta": { "tag": [ { "system": "https://healthauthority.ca/fhir/emr-id", "code": "EMR-12345" } ] } } } ] }
Error Handling
HTTP Status | Reason | Description |
---|---|---|
400 | Missing or invalid emr_id parameter |
The required search parameter is not valid. |
401 | Unauthorized | Request is missing a valid access token. |
500 | Internal Server Error | A server-side error occurred. |
Notes
- Subscriptions are filtered using
meta.tag.code
to match the providedemr_id
. - This interaction supports the use case of allowing EMRs to view and manage their registered topics/subscriptions.
- Subscription resources returned conform to the R5 Subscription Backport Profile.