This page is part of the FHIR Specification v4.3.0-snapshot1: R4B Snapshot to support the Jan 2022 Connectathon. About the R4B version of FHIR. The current officially released version is 4.3.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B
FHIR Infrastructure Work Group | Maturity Level: 0 | Draft | Security Category: Business | Compartments: Not linked to any defined compartments |
Describes a stream of resource state changes or events and annotated with labels useful to filter projections from this topic.
This document contains information about the SubscriptionTopic
resource and details specific to options in it. It is defined as part of the Pub/Sub (Publish / Subscribe) model of Subscriptions.
The SubscriptionTopic
resource is used to define conceptual or computable events for Subscription resources. A SubscriptionTopic
defines the data and change of interest, as well as allowed filters so that servers can implement specific functionality around subscriptions and clearly communicate boundaries to clients. In other words, a SubscriptionTopic
is a way of describing a state change to know what is of interest. Because it describes a state change, a SubscriptionTopic
is defined by:
Subscription Topics are intended to be discoverable, reusable, and extensible. Definitions should be computably defined whenever possible, but the conceptual definition is the arbiter between any discrepancies. For example, a query-based and a FHIRPath-based definition may differ slightly because of what is expressable in each language. In such cases, the goal is correct implmentation of the concept - not literal translations between computable definitions.
The SubscriptionTopic
resource is used in the Pub/Sub (Publisher/Subscriber) model of FHIR Subscriptions. Information about the Boundaries and Relationships both within the Subscriptions Framework and to other areas of the FHIR specification can be found here.
This resource is referenced by SubscriptionStatus and itself.
This resource implements the Definition pattern.
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
SubscriptionTopic | D | DomainResource | The definition of a specific topic for triggering events within the Subscriptions framework Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension | |
url | Σ | 1..1 | uri | Logical canonical URL to reference this SubscriptionTopic (globally unique) |
identifier | Σ | 0..* | Identifier | Business Identifier for SubscriptionTopic |
version | Σ | 0..1 | string | Business version of the SubscriptionTopic |
title | Σ | 0..1 | string | Name for this SubscriptionTopic (Human friendly) |
derivedFrom | Σ | 0..* | canonical(SubscriptionTopic) | Based on FHIR protocol or definition |
status | ?!Σ | 1..1 | code | draft | active | retired | unknown PublicationStatus (Required) |
experimental | ?!Σ | 0..1 | boolean | If for testing purposes, not real usage |
date | Σ | 0..1 | dateTime | Date status first applied |
publisher | Σ | 0..1 | string | The name of the individual or organization that published the SubscriptionTopic |
contact | Σ | 0..* | ContactDetail | Contact details for the publisher |
description | 0..1 | markdown | Natural language description of the SubscriptionTopic | |
useContext | Σ | 0..* | UsageContext | Content intends to support these contexts |
jurisdiction | Σ | 0..* | CodeableConcept | Intended jurisdiction of the SubscriptionTopic (if applicable) Jurisdiction (Extensible) |
purpose | 0..1 | markdown | Why this SubscriptionTopic is defined | |
copyright | 0..1 | markdown | Use and/or publishing restrictions | |
approvalDate | 0..1 | date | When SubscriptionTopic is/was approved by publisher | |
lastReviewDate | 0..1 | date | Date the Subscription Topic was last reviewed by the publisher | |
effectivePeriod | Σ | 0..1 | Period | The effective date range for the SubscriptionTopic |
resourceTrigger | Σ | 0..* | BackboneElement | Definition of a resource-based trigger for the subscription topic |
description | Σ | 0..1 | markdown | Text representation of the resource trigger |
resource | Σ | 1..1 | uri | Data Type or Resource (reference to definition) for this trigger definition FHIRDefinedType (Extensible) |
supportedInteraction | Σ | 0..* | code | create | update | delete Interaction Trigger (Required) |
queryCriteria | Σ | 0..1 | BackboneElement | Query based trigger rule |
previous | Σ | 0..1 | string | Rule applied to previous resource state |
resultForCreate | Σ | 0..1 | code | test-passes | test-fails CriteriaNotExistsBehavior (Required) |
current | Σ | 0..1 | string | Rule applied to current resource state |
resultForDelete | Σ | 0..1 | code | test-passes | test-fails CriteriaNotExistsBehavior (Required) |
requireBoth | Σ | 0..1 | boolean | Both must be true flag |
fhirPathCriteria | Σ | 0..1 | string | FHIRPath based trigger rule |
eventTrigger | Σ | 0..* | BackboneElement | Event definitions the SubscriptionTopic |
description | Σ | 0..1 | markdown | Text representation of the event trigger |
event | Σ | 1..1 | CodeableConcept | Event which can trigger a notification from the SubscriptionTopic hl7VS-eventTypeCode (Example) |
resource | Σ | 1..1 | uri | Data Type or Resource (reference to definition) for this trigger definition FHIRDefinedType (Extensible) |
canFilterBy | Σ | 0..* | BackboneElement | Properties by which a Subscription can filter notifications from the SubscriptionTopic |
description | Σ | 0..1 | markdown | Description of this filter parameter |
resource | Σ | 0..1 | uri | URL of the triggering Resource that this filter applies to FHIRDefinedType (Extensible) |
filterParameter | Σ | 0..1 | string | Resource Search Parameter or filter parameter defined in this topic that serves as filter key |
modifier | Σ | 0..* | code | = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type Subscription Search Modifier (Required) |
notificationShape | Σ | 0..* | BackboneElement | Properties for describing the shape of notifications generated by this topic |
resource | Σ | 1..1 | uri | URL of the Resource that is the focus (main) resource in a notification shape FHIRDefinedType (Extensible) |
include | Σ | 0..* | string | Include directives, rooted in the resource for this shape |
revInclude | Σ | 0..* | string | Reverse include directives, rooted in the resource for this shape |
Documentation for this format |
UML Diagram (Legend)
XML Template
<SubscriptionTopic xmlns="http://hl7.org/fhir"> <!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension --> <url value="[uri]"/><!-- 1..1 Logical canonical URL to reference this SubscriptionTopic (globally unique) --> <identifier><!-- 0..* Identifier Business Identifier for SubscriptionTopic --></identifier> <version value="[string]"/><!-- 0..1 Business version of the SubscriptionTopic --> <title value="[string]"/><!-- 0..1 Name for this SubscriptionTopic (Human friendly) --> <derivedFrom><!-- 0..* canonical(SubscriptionTopic) Based on FHIR protocol or definition --></derivedFrom> <status value="[code]"/><!-- 1..1 draft | active | retired | unknown --> <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage --> <date value="[dateTime]"/><!-- 0..1 Date status first applied --> <publisher value="[string]"/><!-- 0..1 The name of the individual or organization that published the SubscriptionTopic --> <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact> <description value="[markdown]"/><!-- 0..1 Natural language description of the SubscriptionTopic --> <useContext><!-- 0..* UsageContext Content intends to support these contexts --></useContext> <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction of the SubscriptionTopic (if applicable) --></jurisdiction> <purpose value="[markdown]"/><!-- 0..1 Why this SubscriptionTopic is defined --> <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions --> <approvalDate value="[date]"/><!-- 0..1 When SubscriptionTopic is/was approved by publisher --> <lastReviewDate value="[date]"/><!-- 0..1 Date the Subscription Topic was last reviewed by the publisher --> <effectivePeriod><!-- 0..1 Period The effective date range for the SubscriptionTopic --></effectivePeriod> <resourceTrigger> <!-- 0..* Definition of a resource-based trigger for the subscription topic --> <description value="[markdown]"/><!-- 0..1 Text representation of the resource trigger --> <resource value="[uri]"/><!-- 1..1 Data Type or Resource (reference to definition) for this trigger definition --> <supportedInteraction value="[code]"/><!-- 0..* create | update | delete --> <queryCriteria> <!-- 0..1 Query based trigger rule --> <previous value="[string]"/><!-- 0..1 Rule applied to previous resource state --> <resultForCreate value="[code]"/><!-- 0..1 test-passes | test-fails --> <current value="[string]"/><!-- 0..1 Rule applied to current resource state --> <resultForDelete value="[code]"/><!-- 0..1 test-passes | test-fails --> <requireBoth value="[boolean]"/><!-- 0..1 Both must be true flag --> </queryCriteria> <fhirPathCriteria value="[string]"/><!-- 0..1 FHIRPath based trigger rule --> </resourceTrigger> <eventTrigger> <!-- 0..* Event definitions the SubscriptionTopic --> <description value="[markdown]"/><!-- 0..1 Text representation of the event trigger --> <event><!-- 1..1 CodeableConcept Event which can trigger a notification from the SubscriptionTopic --></event> <resource value="[uri]"/><!-- 1..1 Data Type or Resource (reference to definition) for this trigger definition --> </eventTrigger> <canFilterBy> <!-- 0..* Properties by which a Subscription can filter notifications from the SubscriptionTopic --> <description value="[markdown]"/><!-- 0..1 Description of this filter parameter --> <resource value="[uri]"/><!-- 0..1 URL of the triggering Resource that this filter applies to --> <filterParameter value="[string]"/><!-- 0..1 Resource Search Parameter or filter parameter defined in this topic that serves as filter key --> <modifier value="[code]"/><!-- 0..* = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type --> </canFilterBy> <notificationShape> <!-- 0..* Properties for describing the shape of notifications generated by this topic --> <resource value="[uri]"/><!-- 1..1 URL of the Resource that is the focus (main) resource in a notification shape --> <include value="[string]"/><!-- 0..* Include directives, rooted in the resource for this shape --> <revInclude value="[string]"/><!-- 0..* Reverse include directives, rooted in the resource for this shape --> </notificationShape> </SubscriptionTopic>
JSON Template
{ "resourceType" : "SubscriptionTopic", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "url" : "<uri>", // R! Logical canonical URL to reference this SubscriptionTopic (globally unique) "identifier" : [{ Identifier }], // Business Identifier for SubscriptionTopic "version" : "<string>", // Business version of the SubscriptionTopic "title" : "<string>", // Name for this SubscriptionTopic (Human friendly) "derivedFrom" : [{ canonical(SubscriptionTopic) }], // Based on FHIR protocol or definition "status" : "<code>", // R! draft | active | retired | unknown "experimental" : <boolean>, // If for testing purposes, not real usage "date" : "<dateTime>", // Date status first applied "publisher" : "<string>", // The name of the individual or organization that published the SubscriptionTopic "contact" : [{ ContactDetail }], // Contact details for the publisher "description" : "<markdown>", // Natural language description of the SubscriptionTopic "useContext" : [{ UsageContext }], // Content intends to support these contexts "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction of the SubscriptionTopic (if applicable) "purpose" : "<markdown>", // Why this SubscriptionTopic is defined "copyright" : "<markdown>", // Use and/or publishing restrictions "approvalDate" : "<date>", // When SubscriptionTopic is/was approved by publisher "lastReviewDate" : "<date>", // Date the Subscription Topic was last reviewed by the publisher "effectivePeriod" : { Period }, // The effective date range for the SubscriptionTopic "resourceTrigger" : [{ // Definition of a resource-based trigger for the subscription topic "description" : "<markdown>", // Text representation of the resource trigger "resource" : "<uri>", // R! Data Type or Resource (reference to definition) for this trigger definition "supportedInteraction" : ["<code>"], // create | update | delete "queryCriteria" : { // Query based trigger rule "previous" : "<string>", // Rule applied to previous resource state "resultForCreate" : "<code>", // test-passes | test-fails "current" : "<string>", // Rule applied to current resource state "resultForDelete" : "<code>", // test-passes | test-fails "requireBoth" : <boolean> // Both must be true flag }, "fhirPathCriteria" : "<string>" // FHIRPath based trigger rule }], "eventTrigger" : [{ // Event definitions the SubscriptionTopic "description" : "<markdown>", // Text representation of the event trigger "event" : { CodeableConcept }, // R! Event which can trigger a notification from the SubscriptionTopic "resource" : "<uri>" // R! Data Type or Resource (reference to definition) for this trigger definition }], "canFilterBy" : [{ // Properties by which a Subscription can filter notifications from the SubscriptionTopic "description" : "<markdown>", // Description of this filter parameter "resource" : "<uri>", // URL of the triggering Resource that this filter applies to "filterParameter" : "<string>", // Resource Search Parameter or filter parameter defined in this topic that serves as filter key "modifier" : ["<code>"] // = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type }], "notificationShape" : [{ // Properties for describing the shape of notifications generated by this topic "resource" : "<uri>", // R! URL of the Resource that is the focus (main) resource in a notification shape "include" : ["<string>"], // Include directives, rooted in the resource for this shape "revInclude" : ["<string>"] // Reverse include directives, rooted in the resource for this shape }] }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:SubscriptionTopic; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension fhir:SubscriptionTopic.url [ uri ]; # 1..1 Logical canonical URL to reference this SubscriptionTopic (globally unique) fhir:SubscriptionTopic.identifier [ Identifier ], ... ; # 0..* Business Identifier for SubscriptionTopic fhir:SubscriptionTopic.version [ string ]; # 0..1 Business version of the SubscriptionTopic fhir:SubscriptionTopic.title [ string ]; # 0..1 Name for this SubscriptionTopic (Human friendly) fhir:SubscriptionTopic.derivedFrom [ canonical(SubscriptionTopic) ], ... ; # 0..* Based on FHIR protocol or definition fhir:SubscriptionTopic.status [ code ]; # 1..1 draft | active | retired | unknown fhir:SubscriptionTopic.experimental [ boolean ]; # 0..1 If for testing purposes, not real usage fhir:SubscriptionTopic.date [ dateTime ]; # 0..1 Date status first applied fhir:SubscriptionTopic.publisher [ string ]; # 0..1 The name of the individual or organization that published the SubscriptionTopic fhir:SubscriptionTopic.contact [ ContactDetail ], ... ; # 0..* Contact details for the publisher fhir:SubscriptionTopic.description [ markdown ]; # 0..1 Natural language description of the SubscriptionTopic fhir:SubscriptionTopic.useContext [ UsageContext ], ... ; # 0..* Content intends to support these contexts fhir:SubscriptionTopic.jurisdiction [ CodeableConcept ], ... ; # 0..* Intended jurisdiction of the SubscriptionTopic (if applicable) fhir:SubscriptionTopic.purpose [ markdown ]; # 0..1 Why this SubscriptionTopic is defined fhir:SubscriptionTopic.copyright [ markdown ]; # 0..1 Use and/or publishing restrictions fhir:SubscriptionTopic.approvalDate [ date ]; # 0..1 When SubscriptionTopic is/was approved by publisher fhir:SubscriptionTopic.lastReviewDate [ date ]; # 0..1 Date the Subscription Topic was last reviewed by the publisher fhir:SubscriptionTopic.effectivePeriod [ Period ]; # 0..1 The effective date range for the SubscriptionTopic fhir:SubscriptionTopic.resourceTrigger [ # 0..* Definition of a resource-based trigger for the subscription topic fhir:SubscriptionTopic.resourceTrigger.description [ markdown ]; # 0..1 Text representation of the resource trigger fhir:SubscriptionTopic.resourceTrigger.resource [ uri ]; # 1..1 Data Type or Resource (reference to definition) for this trigger definition fhir:SubscriptionTopic.resourceTrigger.supportedInteraction [ code ], ... ; # 0..* create | update | delete fhir:SubscriptionTopic.resourceTrigger.queryCriteria [ # 0..1 Query based trigger rule fhir:SubscriptionTopic.resourceTrigger.queryCriteria.previous [ string ]; # 0..1 Rule applied to previous resource state fhir:SubscriptionTopic.resourceTrigger.queryCriteria.resultForCreate [ code ]; # 0..1 test-passes | test-fails fhir:SubscriptionTopic.resourceTrigger.queryCriteria.current [ string ]; # 0..1 Rule applied to current resource state fhir:SubscriptionTopic.resourceTrigger.queryCriteria.resultForDelete [ code ]; # 0..1 test-passes | test-fails fhir:SubscriptionTopic.resourceTrigger.queryCriteria.requireBoth [ boolean ]; # 0..1 Both must be true flag ]; fhir:SubscriptionTopic.resourceTrigger.fhirPathCriteria [ string ]; # 0..1 FHIRPath based trigger rule ], ...; fhir:SubscriptionTopic.eventTrigger [ # 0..* Event definitions the SubscriptionTopic fhir:SubscriptionTopic.eventTrigger.description [ markdown ]; # 0..1 Text representation of the event trigger fhir:SubscriptionTopic.eventTrigger.event [ CodeableConcept ]; # 1..1 Event which can trigger a notification from the SubscriptionTopic fhir:SubscriptionTopic.eventTrigger.resource [ uri ]; # 1..1 Data Type or Resource (reference to definition) for this trigger definition ], ...; fhir:SubscriptionTopic.canFilterBy [ # 0..* Properties by which a Subscription can filter notifications from the SubscriptionTopic fhir:SubscriptionTopic.canFilterBy.description [ markdown ]; # 0..1 Description of this filter parameter fhir:SubscriptionTopic.canFilterBy.resource [ uri ]; # 0..1 URL of the triggering Resource that this filter applies to fhir:SubscriptionTopic.canFilterBy.filterParameter [ string ]; # 0..1 Resource Search Parameter or filter parameter defined in this topic that serves as filter key fhir:SubscriptionTopic.canFilterBy.modifier [ code ], ... ; # 0..* = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type ], ...; fhir:SubscriptionTopic.notificationShape [ # 0..* Properties for describing the shape of notifications generated by this topic fhir:SubscriptionTopic.notificationShape.resource [ uri ]; # 1..1 URL of the Resource that is the focus (main) resource in a notification shape fhir:SubscriptionTopic.notificationShape.include [ string ], ... ; # 0..* Include directives, rooted in the resource for this shape fhir:SubscriptionTopic.notificationShape.revInclude [ string ], ... ; # 0..* Reverse include directives, rooted in the resource for this shape ], ...; ]
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
SubscriptionTopic | D | DomainResource | The definition of a specific topic for triggering events within the Subscriptions framework Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension | |
url | Σ | 1..1 | uri | Logical canonical URL to reference this SubscriptionTopic (globally unique) |
identifier | Σ | 0..* | Identifier | Business Identifier for SubscriptionTopic |
version | Σ | 0..1 | string | Business version of the SubscriptionTopic |
title | Σ | 0..1 | string | Name for this SubscriptionTopic (Human friendly) |
derivedFrom | Σ | 0..* | canonical(SubscriptionTopic) | Based on FHIR protocol or definition |
status | ?!Σ | 1..1 | code | draft | active | retired | unknown PublicationStatus (Required) |
experimental | ?!Σ | 0..1 | boolean | If for testing purposes, not real usage |
date | Σ | 0..1 | dateTime | Date status first applied |
publisher | Σ | 0..1 | string | The name of the individual or organization that published the SubscriptionTopic |
contact | Σ | 0..* | ContactDetail | Contact details for the publisher |
description | 0..1 | markdown | Natural language description of the SubscriptionTopic | |
useContext | Σ | 0..* | UsageContext | Content intends to support these contexts |
jurisdiction | Σ | 0..* | CodeableConcept | Intended jurisdiction of the SubscriptionTopic (if applicable) Jurisdiction (Extensible) |
purpose | 0..1 | markdown | Why this SubscriptionTopic is defined | |
copyright | 0..1 | markdown | Use and/or publishing restrictions | |
approvalDate | 0..1 | date | When SubscriptionTopic is/was approved by publisher | |
lastReviewDate | 0..1 | date | Date the Subscription Topic was last reviewed by the publisher | |
effectivePeriod | Σ | 0..1 | Period | The effective date range for the SubscriptionTopic |
resourceTrigger | Σ | 0..* | BackboneElement | Definition of a resource-based trigger for the subscription topic |
description | Σ | 0..1 | markdown | Text representation of the resource trigger |
resource | Σ | 1..1 | uri | Data Type or Resource (reference to definition) for this trigger definition FHIRDefinedType (Extensible) |
supportedInteraction | Σ | 0..* | code | create | update | delete Interaction Trigger (Required) |
queryCriteria | Σ | 0..1 | BackboneElement | Query based trigger rule |
previous | Σ | 0..1 | string | Rule applied to previous resource state |
resultForCreate | Σ | 0..1 | code | test-passes | test-fails CriteriaNotExistsBehavior (Required) |
current | Σ | 0..1 | string | Rule applied to current resource state |
resultForDelete | Σ | 0..1 | code | test-passes | test-fails CriteriaNotExistsBehavior (Required) |
requireBoth | Σ | 0..1 | boolean | Both must be true flag |
fhirPathCriteria | Σ | 0..1 | string | FHIRPath based trigger rule |
eventTrigger | Σ | 0..* | BackboneElement | Event definitions the SubscriptionTopic |
description | Σ | 0..1 | markdown | Text representation of the event trigger |
event | Σ | 1..1 | CodeableConcept | Event which can trigger a notification from the SubscriptionTopic hl7VS-eventTypeCode (Example) |
resource | Σ | 1..1 | uri | Data Type or Resource (reference to definition) for this trigger definition FHIRDefinedType (Extensible) |
canFilterBy | Σ | 0..* | BackboneElement | Properties by which a Subscription can filter notifications from the SubscriptionTopic |
description | Σ | 0..1 | markdown | Description of this filter parameter |
resource | Σ | 0..1 | uri | URL of the triggering Resource that this filter applies to FHIRDefinedType (Extensible) |
filterParameter | Σ | 0..1 | string | Resource Search Parameter or filter parameter defined in this topic that serves as filter key |
modifier | Σ | 0..* | code | = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type Subscription Search Modifier (Required) |
notificationShape | Σ | 0..* | BackboneElement | Properties for describing the shape of notifications generated by this topic |
resource | Σ | 1..1 | uri | URL of the Resource that is the focus (main) resource in a notification shape FHIRDefinedType (Extensible) |
include | Σ | 0..* | string | Include directives, rooted in the resource for this shape |
revInclude | Σ | 0..* | string | Reverse include directives, rooted in the resource for this shape |
Documentation for this format |
XML Template
<SubscriptionTopic xmlns="http://hl7.org/fhir"> <!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension --> <url value="[uri]"/><!-- 1..1 Logical canonical URL to reference this SubscriptionTopic (globally unique) --> <identifier><!-- 0..* Identifier Business Identifier for SubscriptionTopic --></identifier> <version value="[string]"/><!-- 0..1 Business version of the SubscriptionTopic --> <title value="[string]"/><!-- 0..1 Name for this SubscriptionTopic (Human friendly) --> <derivedFrom><!-- 0..* canonical(SubscriptionTopic) Based on FHIR protocol or definition --></derivedFrom> <status value="[code]"/><!-- 1..1 draft | active | retired | unknown --> <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage --> <date value="[dateTime]"/><!-- 0..1 Date status first applied --> <publisher value="[string]"/><!-- 0..1 The name of the individual or organization that published the SubscriptionTopic --> <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact> <description value="[markdown]"/><!-- 0..1 Natural language description of the SubscriptionTopic --> <useContext><!-- 0..* UsageContext Content intends to support these contexts --></useContext> <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction of the SubscriptionTopic (if applicable) --></jurisdiction> <purpose value="[markdown]"/><!-- 0..1 Why this SubscriptionTopic is defined --> <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions --> <approvalDate value="[date]"/><!-- 0..1 When SubscriptionTopic is/was approved by publisher --> <lastReviewDate value="[date]"/><!-- 0..1 Date the Subscription Topic was last reviewed by the publisher --> <effectivePeriod><!-- 0..1 Period The effective date range for the SubscriptionTopic --></effectivePeriod> <resourceTrigger> <!-- 0..* Definition of a resource-based trigger for the subscription topic --> <description value="[markdown]"/><!-- 0..1 Text representation of the resource trigger --> <resource value="[uri]"/><!-- 1..1 Data Type or Resource (reference to definition) for this trigger definition --> <supportedInteraction value="[code]"/><!-- 0..* create | update | delete --> <queryCriteria> <!-- 0..1 Query based trigger rule --> <previous value="[string]"/><!-- 0..1 Rule applied to previous resource state --> <resultForCreate value="[code]"/><!-- 0..1 test-passes | test-fails --> <current value="[string]"/><!-- 0..1 Rule applied to current resource state --> <resultForDelete value="[code]"/><!-- 0..1 test-passes | test-fails --> <requireBoth value="[boolean]"/><!-- 0..1 Both must be true flag --> </queryCriteria> <fhirPathCriteria value="[string]"/><!-- 0..1 FHIRPath based trigger rule --> </resourceTrigger> <eventTrigger> <!-- 0..* Event definitions the SubscriptionTopic --> <description value="[markdown]"/><!-- 0..1 Text representation of the event trigger --> <event><!-- 1..1 CodeableConcept Event which can trigger a notification from the SubscriptionTopic --></event> <resource value="[uri]"/><!-- 1..1 Data Type or Resource (reference to definition) for this trigger definition --> </eventTrigger> <canFilterBy> <!-- 0..* Properties by which a Subscription can filter notifications from the SubscriptionTopic --> <description value="[markdown]"/><!-- 0..1 Description of this filter parameter --> <resource value="[uri]"/><!-- 0..1 URL of the triggering Resource that this filter applies to --> <filterParameter value="[string]"/><!-- 0..1 Resource Search Parameter or filter parameter defined in this topic that serves as filter key --> <modifier value="[code]"/><!-- 0..* = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type --> </canFilterBy> <notificationShape> <!-- 0..* Properties for describing the shape of notifications generated by this topic --> <resource value="[uri]"/><!-- 1..1 URL of the Resource that is the focus (main) resource in a notification shape --> <include value="[string]"/><!-- 0..* Include directives, rooted in the resource for this shape --> <revInclude value="[string]"/><!-- 0..* Reverse include directives, rooted in the resource for this shape --> </notificationShape> </SubscriptionTopic>
JSON Template
{ "resourceType" : "SubscriptionTopic", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "url" : "<uri>", // R! Logical canonical URL to reference this SubscriptionTopic (globally unique) "identifier" : [{ Identifier }], // Business Identifier for SubscriptionTopic "version" : "<string>", // Business version of the SubscriptionTopic "title" : "<string>", // Name for this SubscriptionTopic (Human friendly) "derivedFrom" : [{ canonical(SubscriptionTopic) }], // Based on FHIR protocol or definition "status" : "<code>", // R! draft | active | retired | unknown "experimental" : <boolean>, // If for testing purposes, not real usage "date" : "<dateTime>", // Date status first applied "publisher" : "<string>", // The name of the individual or organization that published the SubscriptionTopic "contact" : [{ ContactDetail }], // Contact details for the publisher "description" : "<markdown>", // Natural language description of the SubscriptionTopic "useContext" : [{ UsageContext }], // Content intends to support these contexts "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction of the SubscriptionTopic (if applicable) "purpose" : "<markdown>", // Why this SubscriptionTopic is defined "copyright" : "<markdown>", // Use and/or publishing restrictions "approvalDate" : "<date>", // When SubscriptionTopic is/was approved by publisher "lastReviewDate" : "<date>", // Date the Subscription Topic was last reviewed by the publisher "effectivePeriod" : { Period }, // The effective date range for the SubscriptionTopic "resourceTrigger" : [{ // Definition of a resource-based trigger for the subscription topic "description" : "<markdown>", // Text representation of the resource trigger "resource" : "<uri>", // R! Data Type or Resource (reference to definition) for this trigger definition "supportedInteraction" : ["<code>"], // create | update | delete "queryCriteria" : { // Query based trigger rule "previous" : "<string>", // Rule applied to previous resource state "resultForCreate" : "<code>", // test-passes | test-fails "current" : "<string>", // Rule applied to current resource state "resultForDelete" : "<code>", // test-passes | test-fails "requireBoth" : <boolean> // Both must be true flag }, "fhirPathCriteria" : "<string>" // FHIRPath based trigger rule }], "eventTrigger" : [{ // Event definitions the SubscriptionTopic "description" : "<markdown>", // Text representation of the event trigger "event" : { CodeableConcept }, // R! Event which can trigger a notification from the SubscriptionTopic "resource" : "<uri>" // R! Data Type or Resource (reference to definition) for this trigger definition }], "canFilterBy" : [{ // Properties by which a Subscription can filter notifications from the SubscriptionTopic "description" : "<markdown>", // Description of this filter parameter "resource" : "<uri>", // URL of the triggering Resource that this filter applies to "filterParameter" : "<string>", // Resource Search Parameter or filter parameter defined in this topic that serves as filter key "modifier" : ["<code>"] // = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type }], "notificationShape" : [{ // Properties for describing the shape of notifications generated by this topic "resource" : "<uri>", // R! URL of the Resource that is the focus (main) resource in a notification shape "include" : ["<string>"], // Include directives, rooted in the resource for this shape "revInclude" : ["<string>"] // Reverse include directives, rooted in the resource for this shape }] }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:SubscriptionTopic; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension fhir:SubscriptionTopic.url [ uri ]; # 1..1 Logical canonical URL to reference this SubscriptionTopic (globally unique) fhir:SubscriptionTopic.identifier [ Identifier ], ... ; # 0..* Business Identifier for SubscriptionTopic fhir:SubscriptionTopic.version [ string ]; # 0..1 Business version of the SubscriptionTopic fhir:SubscriptionTopic.title [ string ]; # 0..1 Name for this SubscriptionTopic (Human friendly) fhir:SubscriptionTopic.derivedFrom [ canonical(SubscriptionTopic) ], ... ; # 0..* Based on FHIR protocol or definition fhir:SubscriptionTopic.status [ code ]; # 1..1 draft | active | retired | unknown fhir:SubscriptionTopic.experimental [ boolean ]; # 0..1 If for testing purposes, not real usage fhir:SubscriptionTopic.date [ dateTime ]; # 0..1 Date status first applied fhir:SubscriptionTopic.publisher [ string ]; # 0..1 The name of the individual or organization that published the SubscriptionTopic fhir:SubscriptionTopic.contact [ ContactDetail ], ... ; # 0..* Contact details for the publisher fhir:SubscriptionTopic.description [ markdown ]; # 0..1 Natural language description of the SubscriptionTopic fhir:SubscriptionTopic.useContext [ UsageContext ], ... ; # 0..* Content intends to support these contexts fhir:SubscriptionTopic.jurisdiction [ CodeableConcept ], ... ; # 0..* Intended jurisdiction of the SubscriptionTopic (if applicable) fhir:SubscriptionTopic.purpose [ markdown ]; # 0..1 Why this SubscriptionTopic is defined fhir:SubscriptionTopic.copyright [ markdown ]; # 0..1 Use and/or publishing restrictions fhir:SubscriptionTopic.approvalDate [ date ]; # 0..1 When SubscriptionTopic is/was approved by publisher fhir:SubscriptionTopic.lastReviewDate [ date ]; # 0..1 Date the Subscription Topic was last reviewed by the publisher fhir:SubscriptionTopic.effectivePeriod [ Period ]; # 0..1 The effective date range for the SubscriptionTopic fhir:SubscriptionTopic.resourceTrigger [ # 0..* Definition of a resource-based trigger for the subscription topic fhir:SubscriptionTopic.resourceTrigger.description [ markdown ]; # 0..1 Text representation of the resource trigger fhir:SubscriptionTopic.resourceTrigger.resource [ uri ]; # 1..1 Data Type or Resource (reference to definition) for this trigger definition fhir:SubscriptionTopic.resourceTrigger.supportedInteraction [ code ], ... ; # 0..* create | update | delete fhir:SubscriptionTopic.resourceTrigger.queryCriteria [ # 0..1 Query based trigger rule fhir:SubscriptionTopic.resourceTrigger.queryCriteria.previous [ string ]; # 0..1 Rule applied to previous resource state fhir:SubscriptionTopic.resourceTrigger.queryCriteria.resultForCreate [ code ]; # 0..1 test-passes | test-fails fhir:SubscriptionTopic.resourceTrigger.queryCriteria.current [ string ]; # 0..1 Rule applied to current resource state fhir:SubscriptionTopic.resourceTrigger.queryCriteria.resultForDelete [ code ]; # 0..1 test-passes | test-fails fhir:SubscriptionTopic.resourceTrigger.queryCriteria.requireBoth [ boolean ]; # 0..1 Both must be true flag ]; fhir:SubscriptionTopic.resourceTrigger.fhirPathCriteria [ string ]; # 0..1 FHIRPath based trigger rule ], ...; fhir:SubscriptionTopic.eventTrigger [ # 0..* Event definitions the SubscriptionTopic fhir:SubscriptionTopic.eventTrigger.description [ markdown ]; # 0..1 Text representation of the event trigger fhir:SubscriptionTopic.eventTrigger.event [ CodeableConcept ]; # 1..1 Event which can trigger a notification from the SubscriptionTopic fhir:SubscriptionTopic.eventTrigger.resource [ uri ]; # 1..1 Data Type or Resource (reference to definition) for this trigger definition ], ...; fhir:SubscriptionTopic.canFilterBy [ # 0..* Properties by which a Subscription can filter notifications from the SubscriptionTopic fhir:SubscriptionTopic.canFilterBy.description [ markdown ]; # 0..1 Description of this filter parameter fhir:SubscriptionTopic.canFilterBy.resource [ uri ]; # 0..1 URL of the triggering Resource that this filter applies to fhir:SubscriptionTopic.canFilterBy.filterParameter [ string ]; # 0..1 Resource Search Parameter or filter parameter defined in this topic that serves as filter key fhir:SubscriptionTopic.canFilterBy.modifier [ code ], ... ; # 0..* = | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | not-in | of-type ], ...; fhir:SubscriptionTopic.notificationShape [ # 0..* Properties for describing the shape of notifications generated by this topic fhir:SubscriptionTopic.notificationShape.resource [ uri ]; # 1..1 URL of the Resource that is the focus (main) resource in a notification shape fhir:SubscriptionTopic.notificationShape.include [ string ], ... ; # 0..* Include directives, rooted in the resource for this shape fhir:SubscriptionTopic.notificationShape.revInclude [ string ], ... ; # 0..* Reverse include directives, rooted in the resource for this shape ], ...; ]
See the Profiles & Extensions and the alternate definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) + see the extensions & the dependency analysis
Path | Definition | Type | Reference |
---|---|---|---|
SubscriptionTopic.status | Required | PublicationStatus | |
SubscriptionTopic.jurisdiction | Extensible | Jurisdiction ValueSet | |
SubscriptionTopic.resourceTrigger.resource | Extensible | FHIRDefinedType | |
SubscriptionTopic.resourceTrigger.supportedInteraction | Required | InteractionTrigger | |
SubscriptionTopic.resourceTrigger.queryCriteria.resultForCreate | Required | CriteriaNotExistsBehavior | |
SubscriptionTopic.resourceTrigger.queryCriteria.resultForDelete | Required | CriteriaNotExistsBehavior | |
SubscriptionTopic.eventTrigger.event | Example | Hl7VSEventTypeCode | |
SubscriptionTopic.eventTrigger.resource | Extensible | FHIRDefinedType | |
SubscriptionTopic.canFilterBy.resource | Extensible | FHIRDefinedType | |
SubscriptionTopic.canFilterBy.modifier | Required | SubscriptionSearchModifier | |
SubscriptionTopic.notificationShape.resource | Extensible | FHIRDefinedType |
Example and Canonical Subscription Topics can be found at registry.fhir.org . It is strongly suggested that implementers reuse existing topics whenever possible for better compatibility.
Each server is responsible for accurately implementing each SubscriptionTopic it advertises support for. Due to the breadth of possible topics, detailed implementation guidance cannot be provided here. Following are a few topics to consider when implementing a Subscription Topic within a server:
Defining a new SubscriptionTopic
requires clear communication to implementers of both clients and servers around requirements and expectations. Anyone defining a SubscriptionTopic
is encouraged to publish their definition at registry.fhir.org . Below are some points which should be considered when creating a SubscriptionTopic
.
Definitions for Subscription Topics fall into three categories, which are described in more detail below. Good definitions will have useful definitions for two parts (conceptual and one of the other two), but the server implementation should always prioritize accurately representing the concept definition.
Subscription Topics MUST always document the concept it represents. While a short definition is included in the SubscriptionTopic
itself, this documentation will typically not be sufficient for implementers. Definitions must be clear and specific. For example, if the goal is to define an 'admission' topic, the single word is common enough to feel sufficient - implementers generally know what an 'admission' is and could implement something that would qualify. However, is the intention to represent a patient being physically admitted to a care facility, or the start of a clinical encounter? Either definition is common, and without more information implementations will not be consistent. Without complete and specific definitions, server implementions will vary and clients will have unexpected behavior.
Subscription Topics based on Resource Operation Pairs are the simplest to describe - definitions include the resource type (e.g., Patient
, Encounter
) and the operation of interest (e.g., create
, delete
).
Subscription Topics for resource-operation pairs are defined using the SubscriptionTopic.resourceTrigger.resource
and SubscriptionTopic.resourceTrigger.methodCriteria
fields.
Some Subscription Topics are designed to apply to all resources. For example, a topic may be designed to cover any resource being deleted, any resource being tagged with a specific tag, etc. In these cases, implementers should use the Resource
value from the FHIRDefinedType
code system, which is defined as the parent for any resource.
Subscription Topics defined around resource create
operations are triggered each time a resource of the specified type is created.
Filters for create
operations are restricted to the type of resource being created and must be evaluated on the created resource instance. If more complicated filtering is required (e.g., new Observations when a Patient has a given diagnosis), implementers should use the computable definitions provided by Resource Value Tests.
Subscription Topics defined around resource delete
operations are triggered each time a resource of the specified type is deleted.
Filters for delete
operations are restricted to the type of resource being deleted and must be evaluated on the resource instance being deleted. If more complicated filtering is required (e.g., deleting a Patient which has a particular Observation), implementers should use the computable definitions provided by Resource Value Tests.
Subscription Topics defined around resource update
operations are triggered each time the server updates a resource of the specified type. Triggering an update
operation does not imply that the resource has changes visible to the subscriber, nor does it require servers to monitor resources for actual changes. Servers MAY generate notifications on their internal triggers, regardless of actual changes (e.g., a client issuing an HTTP PUT with an identical resource).
Filters for update
operations are restricted to the type of resource being updated and must be evaluated on the resource instance after the update is performed (e.g., post-state change). If more complicated filtering is required (e.g., detecting when an Encounter leaves the 'in-progress' state), implementers should use the computable definitions provided by Resource Value Tests.
If a topic requires more granularity than operations provide, a topic can provide either FHIRPath or query (Search) definitions to test against state changes.
Computable Definitions serve two purposes when defining topics. First, some server implementers may be able to use computable definitions directly (or with minimal changes). In this scenario, the benifit of a computable definition is quite large (e.g., user-defined SubscriptionTopics
, high portability, etc.). Second, implementers that do not use computable definitions internally will be able to read definitions during their implementation in order to precisley understand what is being defined.
Query definitions are based on Search evaluations performed before and/or after a state change in the server. Allowed query parameters are based on the SubscriptionTopic.resourceTrigger.resource
(e.g., if the resource is an Encounter, the list of available search parameters can be found here).
FHIRPath expressions can be used to define topical state changes in a server. Each FHIRPath expression is assumed to be provided the inputs listed below. If multiple FHIRPath expressions are present in SubscriptionTopic.resourceTrigger.fhirPathCriteria
, they are joined together by AND clauses.
FHIRPath expression input variables:
Subscription Topics based on Event Definitions allow for the reuse of existing bodies of work and enable Subscriptions on concepts that may be difficult or impossible to describe based on the FHIR Resource model.
Subscription Topics for external event definitions are specified using the SubscriptionTopic.eventTrigger
fields.
Some events may definitionally include more than one resource. As an example, the HL7 v2 to FHIR mapping implementation guide (not yet published) currently includes the mapping for an ADT A01 message, which covers a patient admission event. In that mapping, the v2 message is converted into a FHIR Bundle, which may include instances of: Patient, Observation, RelatedPerson, Account, Encounter, AllergyIntolerance, and more. While the subscriptions framework can be used to include all the relevant resources, FHIR RESTful interactions are generally centered around a single resource. In order to establish better equivalency between the models, event definitions must also define a single focus resource type. Continuing with the example, a patient visit is generally rooted in the Encounter resource, so that would be a sensible root for such an event.
Some events may not have a logical resource mapping in the current FHIR version. As an example, a system may want to define subscriptions around hosptial staff sign-ins (e.g., a practitioner has become 'available'). In this case, it is recommended that Subscription Topics use the Parameters resource as the focus, with parameter
name-value pairs to convey the required information. Implementers creating topics that use Parameters this way should document what information is available, if possible both in the eventTrigger.description
element and a more formal Profile.
In order to reduce the complexity of evaluating Subscription
requests at runtime, topics define what filters clients are allowed to request. These filters are applied in servers to filter possible events into events that a particular client is interested in (e.g., from a topic defining all all admissions to a subscription for admissions on patients within a care team).
The element SubscriptionTopic.canFilterBy.searchParamName
contains the name of the search parameter used to filter events for the focus resource (defined by SubscriptionTopic.resourceTrigger.resource
). The search parameter must be either from the list of Parameters for all resources (e.g., _id
, _tag
) or the parameters defined by the specific resource (e.g., Encounter Search Parameters, Patient search parameters, etc.).
If a search parameter name is not provided, it is defaulted to _id
.
The element SubscriptionTopic.canFilterBy.searchModifier
contains the search modifier used when evaluating a change. Allowed search parameters are pulled from Search, with the addition of =
to show simple equality (e.g., no modifier). Note that modifiers are only valid for specific types of data (e.g., a modifer of sa
(starts after) has no meaning when applied to a string).
If a search modifier is not provided, it is defaulted to =
(no modifer).
When to evaluate filters depends on the type of change covered by the topic.
Filters for create
operations must be applied after the resource has been created. For example, a topic interested in new patients may allow filters on elements within the patient resource (e.g., new patients in a specified age range).
Filters for delete
operations must be applied before the resource has been deleted. For example, a topic interested in practitioners being removed may allow filters on the practitioner resource (e.g., removed practitioners with a specific qualification).
Filters for update
operations can be applied to either the pre-update or post-update state. Servers SHOULD document their method of operation.
In addition to the triggering information for a topic, this resource also defines the expected 'shape' of notifications via SubscriptionTopic.notificationShape
. This element defines the possible 'root' resources for a notification, as well as additional resources that may be included.
The element SubscriptionTopic.notificationShape.resource
defines a 'root' resource for notifications. Typically, this resource will be the same as the triggering resource (e.g., SubscriptionTopic.resourceTrigger.resource
or SubscriptionTopic.eventTrigger.resource
), however there may be situations where this is not the case. For example, a topic may be defined across all resources (e.g., every time a resource is deleted), but the author may want additional information depending on which resource is involved. In that scenario, the resourceTrigger.resource
could be set to Resource
to trigger on all resources. However, shapes could be defined for each resource in the patient compartment to include patient information with those notifications (e.g., if an Encounter
is deleted, include the Patient
record as well). Note that the opposite scenario is also supported - an author may define multiple triggers on different types of events and simply define a shape that is valid for all of those resources.
Sometimes it is benficial to include additional resources with a subscription notification. For example, queries for additional resources may be complex in the future, but simple at the time of notification due to context in the event. Alternatively, the subscriber may have limited ability to request additional resource (e.g., a client that is generally offline).
In order to facilitate these workflows, a Subscription can define additional resources that MAY be included when a notification is sent. These additions are based off of the focus resource of the notification, and are described as a list of _include and _revinclude directives. When notifications are generated, a server SHOULD check the appropriate SubscriptionTopic.notificationShape.resource
for a matching resource and SHOULD include any additional resources listed via SubscriptionTopic.notificationShape.include
and SubscriptionTopic.notificationShape.revInclude
, if they exist and the user context for the subscription is authorized to access them.
Included resources should be added in the same style as the focus resource - e.g., if notifications are id-only
, then included resources should only include their ids as well.
Implementers are encouraged to add additional filters, but cannot remove existing ones nor change the 'concept' of a SubscriptionTopic during derivation. For example:
Trial-Use Note: Warning: This section is still in early drafting.
Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.
Name | Type | Description | Expression | In Common |
date N | date | Date status first applied | SubscriptionTopic.date | |
derived-or-self N | uri | A server defined search that matches either the url or derivedFrom | SubscriptionTopic.url | SubscriptionTopic.derivedFrom | |
identifier TU | token | Business Identifier for SubscriptionTopic | SubscriptionTopic.identifier | |
resource N | uri | Allowed Data type or Resource (reference to definition) for this definition, searches resourceTrigger, eventTrigger, and notificationShape for matches. | SubscriptionTopic.resourceTrigger.resource | |
status N | token | draft | active | retired | unknown | SubscriptionTopic.status | |
title N | string | Name for this SubscriptionTopic (Human friendly) | SubscriptionTopic.title | |
trigger-description N | string | Text representation of the trigger | SubscriptionTopic.resourceTrigger.description | |
url N | uri | Logical canonical URL to reference this SubscriptionTopic (globally unique) | SubscriptionTopic.url | |
version N | token | Business version of the SubscriptionTopic | SubscriptionTopic.version |