EventDefinition
Introduction
Scope and Usage
This resource is a definition resource from a FHIR workflow perspective - see Workflow, specifically Definition.
The EventDefinition resource provides a reusable description of an event. The resource supports describing different kinds of events, including named events, periodic events, and data-based events. For each of these, the resource also supports a formal description of the event. For example, a 'monitor-emergency-admissions' event can be a named event, but also provide a formal description of the event as monitoring for encounters that occur in emergency department locations.
Boundaries and Relationships
The EventDefinition resource is intended to be used to provide a reusable description of events for use by other resources that require event definition, such as MessageDefinition. The SubscriptionTopic resource is focused on supporting the definition of topics that can be used in Subscriptions. EventDefinition is a definition of an event that could occur, whereas Subscription is asking for notification of events when they occur.
The EventDefinition resource uses the TriggerDefinition data type to represent the description of an event as one of:
- Named event: An event identified by the implementation environment
- Schedule event: An event occurs on a fixed or periodic schedule
- Data event: An event that occurs when data is change such as a record being added, updated, or deleted
- Subscription topic: An event that is defined by referencing a subscription topic
This allows an EventDefinition to be used to reference a SubscriptionTopic, enabling subscriptions to be used in MessageDefinition and PlanDefinition.
Background and Context
Provides additional detail on exactly how the resource is to be used
Notes
Examples
The following examples illustrate EventDefinition resources representing the event "3 consecutive negative stick tests" using the different approaches to event representation supported by the resource.
Named Event
The named event approach uses a name, or code to identify the event. In this approach, a unique code for the event is agreed upon by both sides of an integration. The Workflow and Task usage context types are another example. CDS Hooks hook names are another example of this approach.
The following example illustrates this approach for a three-consecutive-negative-stick-tests event:
<trigger>
<type value="named-event"/>
<code>
<coding>
<system value="http://example.org/CodeSystem/events"/>
<code value="three-consecutive-negative-stick-tests"/>
</coding>
</code>
</trigger>
Data Event
Alternatively, a trigger may be identified as a data event. In this approach, a DataRequirement is used to identify the data change event:
<trigger>
<type value="data-changed"/>
<data>
<type value="Observation"/>
<codeFilter>
<path value="code"/>
<valueSet value="http://example.org/ValueSet/stick-test-codes"/>
</codeFilter>
</data>
<condition>
<language value="text/cql-expression"/>
<expression value="StickTest.consecutivelyFrom(%context).take(3).negative().count() = 3"/>
</condition>
</trigger>
This example indicates that the event should be triggered when Observations with a code matching a code in the http://example.org/ValueSet/stick-test-codes value set is created, updated, or deleted.
In addition, the example has a condition element providing an expression that is evaluated as part of determining whether or not the event is triggered. If the expression evaluates to true, the event is triggered.
The expression in this case:
StickTest.consecutivelyFrom(%context).take(3).negative().count() = 3
Relies on the fluent functions defined in the ExampleEventDefinitionLogic library:
define StickTest:
[Observation: "Stick Test Codes"] O
where O.status in { 'final', 'amended', 'corrected' }
define fluent function negative(observations List<Observation>):
observations O
where O.interpretation ~ "LA6577-6|http://loinc.org"
define fluent function during(observations List<Observation>, encounter Encounter):
observations O
where O.issued during minute of encounter.period
define fluent function within(observations List<Observation>, quantity Quantity):
observations O
where (O.issued + quantity) on or after minute of Now()
define fluent function consecutively(observations List<Observation>):
observations O
sort by issued
define fluent function consecutivelyFrom(observations List<Observation>, observation Observation):
observations O
where O.issued on or after observation.issued
sort by issued
Alternatively, if a profile is available, it can be used to define the data requirement, as well as to provide the starting data element in the expression:
<trigger>
<type value="data-changed"/>
<data>
<type value="Observation"/>
<profile value="http://example.org/StructureDefinition/stick-test-profile"/>
</data>
<condition>
<language value="text/cql-expression"/>
<expression value="[StickTestProfile].consecutivelyFrom(%context).take(3).negative().count() = 3"/>
</condition>
</trigger>
Periodic Event
And finally, the periodic approach can be used to indicate the event should occur on a timing:
<trigger>
<type value="periodic"/>
<timingTiming>
<repeat>
<frequency value="1"/>
<period value="3"/>
<periodUnit value="h"/>
</repeat>
</timingTiming>
<condition>
<language value="text/cql-expression"/>
<expression value="StickTest.within(3 hours).consecutively.take(3).negative().count() = 3"/>
</condition>
</trigger>
Use With RelativeTime
Once an event has been defined, it can be referenced as the context of a RelativeTime:
<Procedure>
<occurrenceDateTime>
<extension url="relativeTime">
<valueRelativeTime>
<contextDefinition value="http://example.org/EventDefinition/three-consecutive-negative-stick-tests"/>
<offsetDuration>
<value value="1"/>
<code value="h"/>
<system value="http://unitsofmeasure.org"/>
</offsetDuration>
</valueRelativeTime>
</extension>
</occurrenceDateTime>
</Procedure>
StructureDefinition
Elements (Simplified)
- EventDefinition [0..*]: - A description of when an event can occur
- EventDefinition.url [0..1]: uri Canonical identifier for this event definition, represented as a URI (globally unique)
- EventDefinition.identifier [0..*]: Identifier Additional identifier for the event definition
- EventDefinition.version [0..1]: string Business version of the event definition
- EventDefinition.versionAlgorithm[x] [0..1]: string, Coding extensible:version-algorithm How to compare versions
- EventDefinition.name [0..1]: string Name for this event definition (computer friendly)
- EventDefinition.title [0..1]: string Name for this event definition (human friendly)
- EventDefinition.subtitle [0..1]: string Subordinate title of the event definition
- EventDefinition.status [1..1]: code required:publication-status draft | active | retired | unknown
- EventDefinition.experimental [0..1]: boolean For testing only - never for real usage
- EventDefinition.subject[x] [0..1]: CodeableConcept, Reference(Group) extensible:participant-resource-types Type of individual the event definition is focused on
- EventDefinition.date [0..1]: dateTime Date last changed
- EventDefinition.publisher [0..1]: string Name of the publisher/steward (organization or individual)
- EventDefinition.contact [0..*]: ContactDetail Contact details for the publisher
- EventDefinition.description [0..1]: markdown Natural language description of the event definition
- EventDefinition.useContext [0..*]: UsageContext The context that the content is intended to support
- EventDefinition.jurisdiction [0..*]: CodeableConcept extensible:jurisdiction Jurisdiction of the authority that maintains the event definition (if applicable)
- EventDefinition.purpose [0..1]: markdown Why this event definition is defined
- EventDefinition.usage [0..1]: markdown Describes the clinical usage of the event definition
- EventDefinition.copyright [0..1]: markdown Notice about intellectual property ownership, can include restrictions on use
- EventDefinition.copyrightLabel [0..1]: string Copyright holder and year(s)
- EventDefinition.approvalDate [0..1]: date When the event definition was approved by publisher
- EventDefinition.lastReviewDate [0..1]: date When the event definition was last reviewed by the publisher
- EventDefinition.effectivePeriod [0..1]: Period When the event definition is expected to be used
- EventDefinition.topic [0..*]: CodeableConcept example:definition-topic E.g. Education, Treatment, Assessment, etc
- EventDefinition.author [0..*]: ContactDetail Who authored the content
- EventDefinition.editor [0..*]: ContactDetail Who edited the content
- EventDefinition.reviewer [0..*]: ContactDetail Who reviewed the content
- EventDefinition.endorser [0..*]: ContactDetail Who endorsed the content
- EventDefinition.relatedArtifact [0..*]: RelatedArtifact Additional documentation, citations, etc
- EventDefinition.trigger [1..*]: TriggerDefinition "when" the event occurs (multiple = 'or')
Mappings
- EventDefinition Mappings — 43 mapping entries
Resource Packs
list-EventDefinition-packs.xml
<?xml version="1.0" encoding="UTF-8"?>
<List xmlns="http://hl7.org/fhir">
<id value="EventDefinition-packs"/>
<status value="current"/>
<mode value="working"/>
</List>
Search Parameters
- composed-of — reference — What resource is being referenced —
EventDefinition.relatedArtifact.where(type='composed-of').resource - context — token — A use context assigned to the event definition —
(EventDefinition.useContext.value.ofType(CodeableConcept)) - context-quantity — quantity — A quantity- or range-valued use context assigned to the event definition —
(EventDefinition.useContext.value.ofType(Quantity)) | (EventDefinition.useContext.value.ofType(Range)) - context-type — token — A type of use context assigned to the event definition —
EventDefinition.useContext.code - context-type-quantity — composite — A use context type and quantity- or range-based value assigned to the event definition —
EventDefinition.useContext - context-type-value — composite — A use context type and value assigned to the event definition —
EventDefinition.useContext - date — date — The event definition publication date —
EventDefinition.date - depends-on — reference — What resource is being referenced —
EventDefinition.relatedArtifact.where(type='depends-on').resource - derived-from — reference — What resource is being referenced —
EventDefinition.relatedArtifact.where(type='derived-from').resource - description — string — The description of the event definition —
EventDefinition.description - effective — date — The time during which the event definition is intended to be in use —
EventDefinition.effectivePeriod - identifier — token — External identifier for the event definition —
EventDefinition.identifier - jurisdiction — token — Jurisdiction of the authority that maintains the the event definition —
EventDefinition.jurisdiction - name — string — Computationally friendly name of the event definition —
EventDefinition.name - predecessor — reference — What resource is being referenced —
EventDefinition.relatedArtifact.where(type='predecessor').resource - publisher — string — Name of the publisher of the event definition —
EventDefinition.publisher - status — token — The current status of the event definition —
EventDefinition.status - successor — reference — What resource is being referenced —
EventDefinition.relatedArtifact.where(type='successor').resource - title — string — The human-friendly name of the event definition —
EventDefinition.title - topic — token — Topics associated with the module —
EventDefinition.topic - url — uri — The uri that identifies the event definition —
EventDefinition.url - version — token — The business version of the event definition —
EventDefinition.version - experimental — token — Whether the EventDefinition is experimental —
EventDefinition.experimental
Examples
- eventdefinition-example — eventdefinition-example
- eventdefinition-example-data — eventdefinition-example-data
- eventdefinition-example-data-with-profile — eventdefinition-example-data-with-profile
- eventdefinition-example-named — eventdefinition-example-named
- eventdefinition-example-periodic — eventdefinition-example-periodic
- eventdefinition-examples-header — eventdefinition-examples-header
- example — eventdefinition-example — Example of an EventDefinition for monitoring emergency department admissions.
- example-data — eventdefinition-example-data — Example of an EventDefinition using the data event approach.
- example-data-with-profile — eventdefinition-example-data-with-profile — Example of an EventDefinition using the data event approach with a profile in the data requirement.
- example-named — eventdefinition-example-named — Example of an EventDefinition using the named event approach.
- example-periodic — eventdefinition-example-periodic — Example of an EventDefinition using the periodic approach.
Mapping Exceptions
eventdefinition-definition-mapping-exceptions.xml
Divergent Elements
- Definition.url → EventDefinition.url
- shortUnmatched | reason=Unknown | pattern=Canonical identifier for this event definition, represented as an absolute URI (globally unique) | resource=Canonical identifier for this event definition, represented as a URI (globally unique)
- commentsUnmatched | reason=Unknown | pattern=Can be a
urn:uuid:or aurn:oid:but realhttp/s:addresses are preferred. Multiple instances may share the same URL if they have a distinct version.
The determination of when to create a new version of a resource (same url, new version) vs. defining a new artifact is up to the author. Considerations for making this decision are found in Technical and Business Versions.
In some cases, the resource can no longer be found at the stated url, but the url itself cannot change. Implementations can use the meta.source element to indicate where the current master source of the resource can be found. | resource=Can be a urn:uuid: or a urn:oid: but real http: addresses are preferred. Multiple instances may share the same URL if they have a distinct version.
The determination of when to create a new version of a resource (same url, new version) vs. defining a new artifact is up to the author. Considerations for making this decision are found in Technical and Business Versions.
In some cases, the resource can no longer be found at the stated url, but the url itself cannot change. Implementations can use the meta.source element to indicate where the current master source of the resource can be found.
- Definition.identifier → EventDefinition.identifier
- shortUnmatched | reason=Unknown | pattern=Business identifier for event definition | resource=Additional identifier for the event definition
- commentsUnmatched | reason=Unknown | pattern=Typically, this is used for identifiers that can go in an HL7 V3 II (instance identifier) data type, and can then identify this event definition outside of FHIR, where it is not possible to use the logical URI.
- requirementsUnmatched | reason=Unknown | pattern=Allows externally provided and/or usable business identifiers to be easily associated with the event definition. | resource=Allows externally provided and/or usable business identifiers to be easily associated with the module.
- Definition.version → EventDefinition.version
- commentsUnmatched | reason=Unknown | pattern=There may be different event definitions that have the same url but different versions. The version can be appended to the url in a reference to allow a reference to a particular business version of the event definition with the format. The version SHOULD NOT contain a '#' - see Business Version. | resource=There may be different event definition instances that have the same identifier but different versions. The version can be appended to the url in a reference to allow a reference to a particular business version of the event definition with the format [url]|[version]. The version SHOULD NOT contain a '#' - see Business Version.
- Definition.name → EventDefinition.name
- commentsUnmatched | reason=Unknown | pattern=The name is not expected to be globally unique. The name should be a simple alphanumeric type no-whitespace name to ensure that it is machine-processing friendly. | resource=The name is not expected to be globally unique. The name should be a simple alphanumeric type name to ensure that it is machine-processing friendly.
- requirementsUnmatched | reason=Unknown | pattern=Supports code generation. | resource=Support human navigation and code generation.
- Definition.status → EventDefinition.status
- definitionUnmatched | reason=Unknown | pattern=The current state of this event definition. | resource=The status of this event definition. Enables tracking the life-cycle of the content.
- commentsUnmatched | reason=Unknown | pattern=A nominal state-transition diagram can be found in the] documentation
Unknown does not represent 'other' - one of the defined statuses must apply. Unknown is used when the authoring system is not sure what the current status is. | resource=Allows filtering of event definitions that are appropriate for use versus not.
See guidance around (not) making local changes to elements here.
- requirementsUnmatched | reason=Unknown | pattern=Enables tracking the lifecycle of the content and filtering of event definitions that are appropriate for use versus not.
- Definition.subject → EventDefinition.subject[x]
- missingTypes | reason=Unknown | pattern=CodeableReference(Group)
- extraTypes | reason=Unknown
- summary | reason=Unknown | pattern=true
- bindingStrength | reason=Unknown | pattern=example
- shortUnmatched | reason=Unknown | pattern=Type of individual the defined service is for | resource=Type of individual the event definition is focused on
- definitionUnmatched | reason=Unknown | pattern=A code or group definition that describes the intended subject of instantiations of this definition. | resource=A code or group definition that describes the intended subject of the event definition.
- requirementsUnmatched | reason=Unknown | pattern=Many protocols, order sets and guidelines are intended for use only with specific types of patients or subjects.
- Definition.description → EventDefinition.description
- summary | reason=Unknown | pattern=true
- commentsUnmatched | reason=Unknown | pattern=This description can be used to capture details such as comments about misuse, instructions for clinical use and interpretation, literature references, examples from the paper world, etc. It is not a rendering of the event definition as conveyed in the 'text' field of the resource itself. This item SHOULD be populated unless the information is available from context. | resource=This description can be used to capture details such as comments about misuse, instructions for clinical use and interpretation, literature references, examples from the paper world, etc. It is not a rendering of the event definition as conveyed in the 'text' field of the resource itself. This item SHOULD be populated unless the information is available from context (e.g. the language of the event definition is presumed to be the predominant language in the place the event definition was created).
- Definition.useContext → EventDefinition.useContext
- definitionUnmatched | reason=Unknown | pattern=The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate event definitions. | resource=The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate event definition instances.
- commentsUnmatched | reason=Unknown | pattern=When multiple useContexts are specified, there is no expectation that all or even any of the contexts apply. | resource=When multiple useContexts are specified, there is no expectation that all or any of the contexts apply.
- Definition.jurisdiction → EventDefinition.jurisdiction
- shortUnmatched | reason=Unknown | pattern=Intended jurisdiction for event definition (if applicable) | resource=Jurisdiction of the authority that maintains the event definition (if applicable)
- definitionUnmatched | reason=Unknown | pattern=A legal or geographic region in which the event definition is intended to be used. | resource=A legal or geographic region in which the authority that maintains the resource is operating. In general, the jurisdiction is also found in the useContext. The useContext may reference additional jurisdictions because the defining jurisdiction does not necessarily limit the jurisdictions of use.
- commentsUnmatched | reason=Unknown | pattern=It may be possible for the event definition to be used in jurisdictions other than those for which it was originally designed or intended
DEPRECATION NOTE: For consistency, implementations are encouraged to migrate to using the new 'jurisdiction' code in the useContext element. (I.e. useContext.code indicating http://terminology.hl7.org/CodeSystem/usage-context-type#jurisdiction and useContext.valueCodeableConcept indicating the jurisdiction.). | resource=It may be possible for the event definition to be used in jurisdictions other than those for which it was originally designed or intended.
DEPRECATION NOTE: For consistency, implementations are encouraged to migrate to using the new 'jurisdiction' code in the useContext element. (I.e. useContext.code indicating http://terminology.hl7.org/CodeSystem/usage-context-type#jurisdiction and useContext.valueCodeableConcept indicating the jurisdiction.)
- Definition.copyright → EventDefinition.copyright
- requirementsUnmatched | reason=Unknown | pattern=Consumers of the event definition must be able to determine any legal restrictions on the use of the artifact and/or its content. | resource=Consumers must be able to determine any legal restrictions on the use of the event definition and/or its content.
- Definition.approvalDate → EventDefinition.approvalDate
- summary | reason=Unknown | pattern=false
- Definition.lastReviewDate → EventDefinition.lastReviewDate
- summary | reason=Unknown | pattern=false
- Definition.effectivePeriod → EventDefinition.effectivePeriod
- commentsUnmatched | reason=Unknown | pattern=The effective period for a event definition determines when the content is applicable for usage and is independent of publication and review dates. For example, a measure intended to be used for the year 2016 might be published in 2015. | resource=The effective period for an event definition determines when the content is applicable for usage and is independent of publication and review dates. For example, a definition intended to be used for the year 2016 might be published in 2015.
See guidance around (not) making local changes to elements here.
Unmapped Elements
- Definition.derivedFromCanonical — Unknown
- Definition.product — Unknown
- Definition.code — Unknown
- Definition.derivedFromUri — Unknown
- Definition.performerType — Unknown
- Definition.partOf — Unknown
- Definition.topic — Unknown
eventdefinition-fivews-mapping-exceptions.xml
Unmapped Elements
- FiveWs.what — Unknown
- FiveWs.author — Unknown
- FiveWs.actor — Unknown
- FiveWs.cause — Unknown
- FiveWs.where — Unknown
- FiveWs.context — Unknown
- FiveWs.init — Unknown
- FiveWs.source — Unknown
- FiveWs.who — Unknown
- FiveWs.grade — Unknown
- FiveWs.planned — Unknown
- FiveWs.done — Unknown
- FiveWs.subject — Unknown