Skip to main content
Skip table of contents

Reading Events

Client Systems can query the Events endpoint to obtain previous events which have occurred on an existing Subscription. This is the mechanism by which Clients using an event-pull Subscription may poll for events which have occurred since they last synchronised data. The Events endpoint may also be used by Clients using a rest-hook Subscription, for example to obtain any events missed during external system outages.


Read Events

GET /Subscription/{subscription-id}/$events?eventsSinceNumber={first}&eventsUntilNumber={last}

A maximum of 100 events may be requested per query

Events are available for 90 days before being deleted

Parameters

Name

Type

Description

subscription-id

String (path)

The ID of the Subscription to get Events for

eventsSinceNumber

Int (query)

The starting event number, inclusive of this event (lower bound)

eventsUntilNumber

Int (query)

The ending event number, inclusive of this event (upper bound).

Responses

Code

Description

200

Success

JSON
{
    "resourceType": "Bundle",
    "id": "e96b11b7-7cae-4b04-ad45-fa43c9b9863b",
    "type": "collection",
    "timestamp": "2022-11-30T16:53:43.6559921+00:00",
    "entry": [
        {
            "resource": {
                "resourceType": "SubscriptionStatus",
                "id": "0f6a9573-84b2-4901-9f0b-2face7b3a450",
                "status": "active",
                "type": "query-event",
                "eventsSinceSubscriptionStart": 754,                
                "notificationEvent": [
                    {
                        "eventNumber": 603,
                        "timestamp": "2022-11-28T23:48:03.1224839+00:00",
                        "focus": {
                            "reference": "Patient/3ae208cd-2854-4a80-af10-aed3d9326ac6"
                        }
                    },
                    {
                        "eventNumber": 604,
                        "timestamp": "2022-11-28T23:47:58.8704579+00:00",
                        "focus": {
                            "reference": "Patient/3ae208cd-2854-4a80-af10-aed3d9326ac6"
                        }
                    },
                    {
                        "eventNumber": 605,
                        "timestamp": "2022-11-28T23:48:00.901795+00:00",
                        "focus": {
                            "reference": "Patient/3ae208cd-2854-4a80-af10-aed3d9326ac6"
                        }
                    }
                ],
                "subscription": {
                    "reference": "Subscription/e22e94df-f2f9-4cc4-ae56-62950e95f2d6"
                },
                "topic": "https://clevermed.com/fhir/r5/SubscriptionTopic/pregnancy-event"
            }
        }
    ]
}

422

Unprocessable Entity

404

Not Found


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.