visit the hl7 website
Ontario Subscription HL7® FHIR® Implementation Guide -v1.0.0-ballot1
fhir-logo
  • Index
  • Home
    • Home
    • Introduction
    • Relationship to Other Specifications
    • Scope
    • Glossary
  • Business Context
    • Business Context
    • Business Model
    • Business Data
    • Use Cases
    • Business Rules
  • Technical Context
    • Technical Context
    • Implementer Responsibility
    • Conformance Rules
    • Connectivity Summary
  • FHIR Artifacts
    • FHIR Artifacts
    • Interactions
    • Operations
    • Profiles
    • Terminology
    • System URIs
    • Capability Statement
    • Custom Search Parameters
    • Response Handling
    • Downloads
  • Change Log
    • Change Log
    • Known Issues & Future Developments
    • Revision History
    1. Index
    2. FHIR Artifacts
    3. Operations
    4. Subscription events

For a full list of available versions, see the Directory of published versions

4.2.1. Subscription events


4.2.1.1. Scope

The Subscription $events operation retrieves Subscription Notifications on an existing subscription, along with the associated payloads if requested. as a Parameters FHIR R4 resource conformant to R4 Backported R5 Subscription Events


4.2.1.2. Interaction Sequence Diagram

4.2.1.3.


4.2.1.4. Specification

This specification is based on the FHIR R5 Backport specification.

Notification Events Request

GET [base]/Subscription/[subscription-id]/$events?from=[start-notification-number]&to=[end-notification-number]

where [subscription-id] is the logical id of the existing Subscription resource.

Notification Events Response

The server returns a 200 OK HTTP status code.


4.2.1.5. Example Subscription Events Operation

4.2.1.6. While this $events operation is defined in FHIR R5 for the Subscription resource, it has also been backported to FHIR R4, functioning in the same way.

Subscription Events Request

GET [base]/Subscription/[subscription-id]/$events?from=150&to=160

Subscription Events Response message payload

{
  "resourceType" : "Bundle",
  "id" : "r4b-notification-full-resource",
  "meta" : {
    "profile" : [
      "https://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition-backport-subscription-notification-r4.html"
    ]
  },
  "type" : "history",
  "timestamp" : "2020-05-29T11:44:13.1882432-05:00",
  "entry" : [
    {
      "fullUrl" : "urn:uuid:120e93df-a9ab-4b01-b0e2-6660338e5927",
      "resource" : {
        "resourceType" : "SubscriptionStatus",
        "id" : "120e93df-a9ab-4b01-b0e2-6660338e5927",
        "text" : {
          "status" : "generated",
          "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"SubscriptionStatus_120e93df-a9ab-4b01-b0e2-6660338e5927\"> </a><p><b>Generated Narrative: SubscriptionStatus </b><a name=\"120e93df-a9ab-4b01-b0e2-6660338e5927\"> </a><a name=\"hc120e93df-a9ab-4b01-b0e2-6660338e5927\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">ResourceSubscriptionStatus &quot;120e93df-a9ab-4b01-b0e2-6660338e5927&quot; </p></div><p><b>status</b>: active</p><p><b>type</b>: event-notification</p><p><b>eventsSinceSubscriptionStart</b>: 2</p><h3>NotificationEvents</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>EventNumber</b></td><td><b>Timestamp</b></td><td><b>Focus</b></td></tr><tr><td style=\"display: none\">*</td><td>2</td><td>May 29, 2020, 4:44:13\u202fPM</td><td>See on this page: https://example.org/fhir/Encounter/86009987-eabe-42bf-8c02-b112b18cb616</td></tr></table><p><b>subscription</b>: <a href=\"https://example.org/fhir/Subscription/admission\">https://example.org/fhir/Subscription/admission</a></p><p><b>topic</b>: <a href=\"http://hl7.org/SubscriptionTopic/admission\">http://hl7.org/SubscriptionTopic/admission</a></p></div>"
        },
        "status" : "active",
        "type" : "event-notification",
        "eventsSinceSubscriptionStart" : "2",
        "notificationEvent" : [
          {
            "eventNumber" : "2",
            "timestamp" : "2020-05-29T11:44:13.1882432-05:00",
            "focus" : {
              "reference" : "https://example.org/fhir/Encounter/86009987-eabe-42bf-8c02-b112b18cb616"
            }
          }
        ],
        "subscription" : {
          "reference" : "https://example.org/fhir/Subscription/admission"
        },
        "topic" : "http://hl7.org/SubscriptionTopic/admission"
      },
      "request" : {
        "method" : "GET",
        "url" : "https://example.org/fhir/Subscription/admission/$status"
      },
      "response" : {
        "status" : "200"
      }
    },
    {
      "fullUrl" : "https://example.org/fhir/Encounter/86009987-eabe-42bf-8c02-b112b18cb616",
      "resource" : {
        "resourceType" : "Encounter",
        "id" : "86009987-eabe-42bf-8c02-b112b18cb616",
        "text" : {
          "status" : "generated",
          "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Encounter_86009987-eabe-42bf-8c02-b112b18cb616\"> </a><p><b>Generated Narrative: Encounter </b><a name=\"86009987-eabe-42bf-8c02-b112b18cb616\"> </a><a name=\"hc86009987-eabe-42bf-8c02-b112b18cb616\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">ResourceEncounter &quot;86009987-eabe-42bf-8c02-b112b18cb616&quot; </p></div><p><b>status</b>: in-progress</p><p><b>class</b>: virtual (Details: ActCode code VR  = ' virtual ', stated as ' null ')</p><p><b>subject</b>: <a href=\"Bundle-r4-notification-multi-resource.html#https-//example.org/fhir/Patient/1599eb66-431a-447c-a3de-6897fe9ae9a1\">https://example.org/fhir/Patient/1599eb66-431a-447c-a3de-6897fe9ae9a1: Example Patient</a></p></div>"
        },
        "status" : "in-progress",
        "class" : {
          "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code" : "VR"
        },
        "subject" : {
          "reference" : "https://example.org/fhir/Patient/1599eb66-431a-447c-a3de-6897fe9ae9a1",
          "display" : "Example Patient"
        }
      },
      "request" : {
        "method" : "POST",
        "url" : "Encounter"
      },
      "response" : {
        "status" : "201"
      }
    }
  ]
}

Please see the $events Operation Definition page from the R5 Subscriptions Backport for details on the $events operation used for the Ontario Health Subscriptions service.


4.2.1.7. Expected Bahaviour

4.2.1.8. |Case|Scenario Description|HTTP Status Code|Response Payload | |1|The request was successful, and the SubscriptionStatus resource is returned in the response body| HTTP 200 OK| Returns the history BUndle with event resources.| |2|The submitted Subscription does not exist| HTTP 404 | Bad Request. Returns an OperationOutcome resource indicating an issue. The client must fix the request and try again.| |3|Subsciprtion API cannot return a valid response due to internal issues. | HTTP 500 | Internal Server Error. Returns an OperationOutcome resource indicating an issue.|

Version: 1.0.0 FHIR Version: R4.0.1

Powered by SIMPLIFIER.NET

HL7® and FHIR® are the registered trademarks of Health Level Seven International