Skip to main content
Skip table of contents

Notification Payloads

Notification messages will be sent to the endpoint configured on rest-hook Subscriptions when corresponding events take place within the Spine which match the filter on the Subscription.

Notifications sent to an endpoint by the BadgerNet Spine consist of a JSON FHIR Bundle which contains a single SubscriptionStatus resource. The SubscriptionStatus resource indicates some status information about the Subscription which caused the notification to be received by the Endpoint and includes a list of the resource events included in the notification.

The content of affected FHIR resources is not included in the notification, nor is there an indication of the details of the change. The notification simply indicates that something has changed within the record, and the responsibility resides with the Spine Client System to read the record and handle it accordingly.


Contents of Notification messages

Messages will be sent to the endpoint using the HTTP POST method:

POST {endpoint-address}

Parameters

Name

Type

Description

body

JSON Object (body)

Example

JSON
{
    "resourceType": "Bundle",
    "id": "5eade07c-7fd2-4984-8d69-8ea595390254",
    "type": "collection",
    "timestamp": "2022-12-01T10:55:39.3774194+00:00",
    "entry": [
        {
            "resource": {
                "resourceType": "SubscriptionStatus",
                "id": "a613b79e-d798-473f-b59d-35cda3eb48d8",
                "status": "active",
                "type": "event-notification",
                "eventsSinceSubscriptionStart": 325,                
                "notificationEvent": [
                    {
                        "eventNumber": 323,
                        "timestamp": "2022-12-01T10:54:18.6471585+00:00",
                        "focus": {
                            "reference": "Patient/f0bd68c7-50d3-4e91-bd5d-b4cce4f57c50"
                        }
                    },
                    {
                        "eventNumber": 324,
                        "timestamp": "2022-12-01T10:54:23.8829898+00:00",
                        "focus": {
                            "reference": "Patient/37ad9f06-babe-4691-b328-8a6e42a3b993"
                        }
                    },
                    {
                        "eventNumber": 325,
                        "timestamp": "2022-12-01T10:54:29.0198883+00:00",
                        "focus": {
                            "reference": "Patient/f0bd68c7-50d3-4e91-bd5d-b4cce4f57c50"
                        }
                    }
                ],
                "subscription": {
                    "reference": "Subscription/62c0bbdc-ad01-40fd-8f7e-457fd549ca1e"
                },
                "topic": "https://clevermed.com/fhir/r5/SubscriptionTopic/pregnancy-event"
            }
        }
    ]
}

Notable properties within SubscriptionStatus:

  • type:

    • handshake - Part of the initial handshake on the Endpoint

    • heartbeat - A periodic notification to verify server connectivity

    • event-notification - A regular event notification

  • eventsSinceSubscriptionStart: The total number of events raised on this Subscription so far

  • notificationEvent: An array of zero or more events, each of which contains:

    • eventNumber: A unique incrementing number for this event

    • timestamp: The instant this event occurred

    • focus: A reference to a FHIR Resource which is the focus of the event, for example an event triggered by a pregnancy update would contain a reference to the Patient.

Response

The endpoint must respond with a ‘successful’ HTTP Response Code: 2xx (e.g. 200, 201, 204 etc) to acknowledge delivery of the notification.


JavaScript errors detected

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

If this problem persists, please contact our support.