<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ie-core-flag" />
  <url value="https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-flag" />
  <name value="IECoreFlag" />
  <title value="IE Core Flag (Alert)" />
  <status value="draft" />
  <description value="Profile for substantial medical alerts or warnings in the Irish healthcare system, aligned with the Xt-EHR EHDSAlert logical model v1.0.0. Used in the alerts sections of the Patient Summary (EHDSPatientSummary.alerts) and Hospital Discharge Report (EHDSDischargeReport.body.alerts). Covers any clinical information that health professionals must be aware of to prevent immediate threat to the patient's life or health." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Flag" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Flag" />
  <derivation value="constraint" />
  <differential>
    <element id="Flag.status">
      <path value="Flag.status" />
      <comment value="HIQA PS 4.3.2 Alert status (Mandatory)." />
      <mustSupport value="true" />
    </element>
    <element id="Flag.category">
      <path value="Flag.category" />
      <short value="Clinical focus of the alert (e.g. drug, allergy, safety, clinical)" />
      <mustSupport value="true" />
    </element>
    <element id="Flag.code">
      <path value="Flag.code" />
      <short value="Coded or textual description of the alert (SNOMED CT preferred)" />
      <comment value="HIQA PS 4.3.3 Alert (Optional, coded) and 4.3.4 Description of alert (Required, in code.text)." />
      <mustSupport value="true" />
    </element>
    <element id="Flag.subject">
      <path value="Flag.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Flag.period">
      <path value="Flag.period" />
      <short value="Time period during which the alert is relevant" />
      <comment value="HIQA PS 4.3.1 Time period of alert (Required)." />
      <mustSupport value="true" />
    </element>
    <element id="Flag.author">
      <path value="Flag.author" />
      <short value="Author or recorder of the alert" />
      <comment value="HIQA PS 4.4.6 Source of alert information (Optional; numbering as published)." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-practitioner" />
        <targetProfile value="https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-practitionerrole" />
        <targetProfile value="https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-organization" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>