{
  "resourceType": "EventDefinition",
  "id": "example",
  "text": {
    "status": "generated",
    "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\u003cp\u003e\u003cb\u003eGenerated Narrative: EventDefinition\u003c/b\u003e\u003ca name\u003d\"example\"\u003e \u003c/a\u003e\u003c/p\u003e\u003cdiv style\u003d\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"\u003e\u003cp style\u003d\"margin-bottom: 0px\"\u003eResource EventDefinition \u0026quot;example\u0026quot; \u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003cb\u003estatus\u003c/b\u003e: draft\u003c/p\u003e\u003cp\u003e\u003cb\u003epurpose\u003c/b\u003e: Monitor all admissions to Emergency\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003etrigger\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003etype\u003c/b\u003e: named-event\u003c/p\u003e\u003cp\u003e\u003cb\u003ename\u003c/b\u003e: monitor-emergency-admissions\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003edata\u003c/b\u003e\u003c/p\u003e\u003ctable class\u003d\"grid\"\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\"\u003e\u003cb\u003eType\u003c/b\u003e: \u003ca href\u003d\"encounter.html\"\u003eEncounter\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\u003c/blockquote\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003econdition\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cspan title\u003d\"text/fhirpath\"\u003e\u003ccode\u003e(%current | %previous).location.where(location \u003d \u0027Location/emergency\u0027 and status in {\u0027active\u0027, \u0027completed\u0027}).exists()\u003c/code\u003e\u003c/span\u003e(\u0026quot;Encounter Location \u003d emergency (active/completed encounters, current or previous)\u0026quot;)\u003c/p\u003e\u003c/blockquote\u003e\u003c/blockquote\u003e\u003c/div\u003e"
  },
  "status": "draft",
  "purpose": "Monitor all admissions to Emergency",
  "trigger": [
    {
      "type": "named-event",
      "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()"
      }
    }
  ],
  "meta": {
    "tag": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
        "code": "HTEST",
        "display": "test health data"
      }
    ]
  }
}