<?xml version="1.0" encoding="UTF-8"?><EventDefinition xmlns="http://hl7.org/fhir">
  <id value="example"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
    </div>
  </text>
  <status value="draft"/>
  <purpose value="Monitor all admissions to Emergency"/>
  <trigger>
    <type value="named-event"/>
    <name value="monitor-emergency-admissions"/>
    <data>
      <type value="Encounter"/>
    </data>
    <condition>
      <description value="Encounter Location = emergency (active/completed encounters, current or previous)"/>
      <language value="text/fhirpath"/>
      <expression value="(this | %previous).location.where(location = &#39;Location/emergency&#39; and status in {&#39;active&#39;, &#39;completed&#39;}).exists()"/>
    </condition>
  </trigger>
</EventDefinition>