{"resourceType":"EventDefinition","id":"example-data","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"informative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":6},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"cds"},{"url":"http://hl7.org/fhir/StructureDefinition/cqf-library","valueCanonical":"http://hl7.org/fhir/EventDefinition/ExampleEventDefinitionLogic"}],"url":"http://hl7.org/fhir/EventDefinition/example-data","name":"DataEventDefinitionExample","title":"Data EventDefinition Example","status":"draft","experimental":true,"publisher":"HL7 International / Clinical Decision Support","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/dss"}]}],"description":"Example of an EventDefinition using the data event approach.","purpose":"Monitor when 3 consecutive negative stick tests have occurred using a data change event.","trigger":[{"type":"data-changed","data":[{"type":"Observation","codeFilter":[{"path":"code","valueSet":"http://example.org/ValueSet/stick-test-codes"}]}],"condition":{"language":"text/cql-expression","expression":"StickTest.consecutivelyAfter(%context).take(3).negative().count() \u003d 3"}}]}
{"resourceType":"EventDefinition","id":"example-data-with-profile","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"informative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":6},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"cds"},{"url":"http://hl7.org/fhir/StructureDefinition/cqf-library","valueCanonical":"http://hl7.org/fhir/EventDefinition/ExampleEventDefinitionLogic"}],"url":"http://hl7.org/fhir/EventDefinition/example-data-with-profile","name":"DataWithProfileEventDefinitionExample","title":"Data With Profile EventDefinition Example","status":"draft","experimental":true,"publisher":"HL7 International / Clinical Decision Support","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/dss"}]}],"description":"Example of an EventDefinition using the data event approach with a profile in the data requirement.","purpose":"Monitor when 3 consecutive negative stick tests have occurred using a data change event and a profile.","trigger":[{"type":"data-changed","data":[{"type":"Observation","profile":["http://example.org/StructureDefinition/stick-test"]}],"condition":{"language":"text/cql-expression","expression":"[StickTestProfile].consecutivelyAfter(%context).take(3).negative().count() \u003d 3"}}]}
{"resourceType":"EventDefinition","id":"example-periodic","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"informative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":6},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"cds"},{"url":"http://hl7.org/fhir/StructureDefinition/cqf-library","valueCanonical":"http://hl7.org/fhir/EventDefinition/ExampleEventDefinitionLogic"}],"url":"http://hl7.org/fhir/EventDefinition/example-periodic","name":"PeriodicEventDefinitionExample","title":"Periodic EventDefinition Example","status":"draft","experimental":true,"publisher":"HL7 International / Clinical Decision Support","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/dss"}]}],"description":"Example of an EventDefinition using the periodic event approach.","purpose":"Monitor when 3 consecutive negative stick tests have occurred using a periodic event.","trigger":[{"type":"periodic","timingTiming":{"repeat":{"frequency":1,"period":3,"periodUnit":"h"}},"condition":{"language":"text/cql-expression","expression":"StickTest.within(3 hours).consecutively.take(3).negative().count() \u003d 3"}}]}
{"resourceType":"EventDefinition","id":"example","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"informative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":6},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"cds"}],"url":"http://hl7.org/fhir/EventDefinition/example","name":"EventDefinitionExample","title":"EventDefinition Example","status":"draft","experimental":true,"publisher":"HL7 International / Clinical Decision Support","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/dss"}]}],"description":"Example of an EventDefinition for monitoring emergency department admissions.","purpose":"Monitor all admissions to Emergency","trigger":[{"type":"data-changed","name":"monitor-emergency-admissions","data":[{"type":"Encounter"}],"condition":{"description":"Encounter Location \u003d emergency (active/completed encounters, current or previous)","language":"text/fhirpath","expression":"(%current | %previous).location.where(location \u003d \u0027Location/emergency\u0027 and status in {\u0027active\u0027, \u0027completed\u0027}).exists()"}}]}
{"resourceType":"EventDefinition","id":"example-named","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"informative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":6},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"cds"}],"url":"http://hl7.org/fhir/EventDefinition/example-named","name":"NamedEventDefinitionExample","title":"Named EventDefinition Example","status":"draft","experimental":true,"publisher":"HL7 International / Clinical Decision Support","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/dss"}]}],"description":"Example of an EventDefinition using the named event approach.","purpose":"Monitor when 3 consecutive negative stick tests have occurred using a named event.","trigger":[{"type":"named-event","code":{"coding":[{"system":"http://example.org/CodeSystem/events","code":"three-consecutive-negative-stick-tests","display":"3 consecutive negative stick tests"}]}}]}