<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HdBe-Alert" />
  <url value="https://fhir.healthdata.be/StructureDefinition/HdBe-Alert" />
  <name value="HdBeAlert" />
  <title value="HdBe Alert" />
  <status value="draft" />
  <date value="2022-10-17T09:09:13.9562003+00:00" />
  <publisher value="Healthdata.be (Sciensano)" />
  <contact>
    <name value="Service portal – healthdata.be" />
    <telecom>
      <system value="url" />
      <value value="https://sciensano.service-now.com/sp" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="An alert describes a clinical or administrative fact brought to the attention of the users of the clinical systems to be taken into account when shaping diagnostic and therapeutic policy or in dealing with the patient, usually because of a safety risk.&#xD;&#xA;Disorders that describe the body’s sensitivity to a substance which results in a specific physiological reaction after being exposed to that substance are referred to as allergies. These are described in a separate information model.&#xD;&#xA;Warnings for non-allergic disorders can concern:&#xD;&#xA;* A disorder, condition or diagnosis which can be considered as a contraindication for undergoing a certain type of therapy, such as pregnancy or long QT syndrome;&#xD;&#xA;* Impaired functioning of an organ system (heart failure, impaired liver or kidney function, weakened immune system);&#xD;&#xA;* Risk of spreading certain microorganisms (multi-resistant bacteria, tubercle bacilli, HIV, HBV, Ebola virus);&#xD;&#xA;* Other risks" />
  <copyright value="Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="zib-alert-v4.1-2020EN" />
    <uri value="https://zibs.nl/wiki/Alert-v4.1(2020EN)" />
    <name value="zib Alert-v4.1(2020EN)" />
  </mapping>
  <mapping>
    <identity value="HdBe-Alert" />
    <uri value="https://fhir.healthdata.be/StructureDefinition/LogicalModel/HdBe-Alert" />
    <name value="HdBe logical model Alert" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Flag" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Flag" />
  <derivation value="constraint" />
  <differential>
    <element id="Flag">
      <path value="Flag" />
      <short value="Alert" />
      <comment value="One of the CBB concepts Condition::Concern and AlertName must be selected. If `.code` contains a code from AlertNameCodelist, `.extension:concern` SHALL not exist. On the other hand, if `.extension:concern` is populated, `.code` SHALL contain code _not-applicable_ from system _http://hl7.org/fhir/ValueSet/data-absent-reason_." />
      <constraint>
        <key value="HdBe-Alert-1" />
        <severity value="error" />
        <human value="One concept from Condition::Concern and AlertName must be selected. If Flag.code contains a code from AlertNameCodelist, Flag.extension:concern SHALL not exist." />
        <expression value="code.memberOf('https://fhir.healthdata.be/ValueSet/AlertName') implies extension.where(url = 'http://hl7.org/fhir/StructureDefinition/flag-detail').exists().not()" />
      </constraint>
      <constraint>
        <key value="HdBe-Alert-2" />
        <severity value="error" />
        <human value="One concept from Condition::Concern and AlertName must be selected. If Flag.extension:concern is filled, Flag.code SHALL contain code 'not-applicable' from system 'http://terminology.hl7.org/CodeSystem/data-absent-reason'." />
        <expression value="extension('http://hl7.org/fhir/StructureDefinition/flag-detail').exists() implies code.coding.where($this.system = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' and $this.code = 'not-applicable').exists()" />
      </constraint>
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.1" />
        <comment value="Alert" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert" />
      </mapping>
    </element>
    <element id="Flag.extension">
      <path value="Flag.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="Flag.extension:concern">
      <path value="Flag.extension" />
      <sliceName value="concern" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/flag-detail" />
      </type>
    </element>
    <element id="Flag.extension:concern.value[x]">
      <path value="Flag.extension.value[x]" />
      <short value="Condition" />
      <definition value="The patient’s health problem or condition that is the subject of the alert. This could involve a patient’s problem, condition or diagnosis that is seen as a contraindication in prescribing medication or which has to be taken into account when shaping diagnostic and therapeutic policy. This can be in the patient’s own interest, or it can involve a problem or disorder that can make the patient a risk to their surroundings, such as an infection hazard. These are references to conditions included on the patient’s problem list." />
      <comment value="One of the CBB concepts Condition::Concern and AlertName must be selected. If `.code` contains a code from AlertNameCodelist, `.extension:concern` SHALL not exist. On the other hand, if `.extension:concern` is populated, `.code` SHALL contain code _not-applicable_ from system _http://hl7.org/fhir/ValueSet/data-absent-reason_." />
      <alias value="Conditie" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
        <targetProfile value="https://fhir.healthdata.be/StructureDefinition/HdBe-Problem" />
      </type>
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.3" />
        <comment value="Condition" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.Condition" />
      </mapping>
    </element>
    <element id="Flag.extension:comment">
      <path value="Flag.extension" />
      <sliceName value="comment" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-Comment" />
      </type>
    </element>
    <element id="Flag.extension:comment.value[x]">
      <path value="Flag.extension.value[x]" />
      <short value="Comment" />
      <definition value="Explanatory comments to the alert that cannot be expressed in any of the other elements." />
      <alias value="Toelichting" />
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.7" />
        <comment value="Comment" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.Comment" />
      </mapping>
    </element>
    <element id="Flag.status">
      <path value="Flag.status" />
      <comment value="Sending systems that don't record an explicit status can use the following guidance to infer a value from the CBB:&#xD;&#xA;&#xD;&#xA;* EndDateTime present and in the past: _inactive_&#xD;&#xA;* EndDateTime absent: _active_&#xD;&#xA;* EndDateTime present and in the future - goes against both FHIR and CBB definitions, but in a case where this might occur: _active_" />
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.5" />
        <comment value="StartDateTime (implicit, main mapping is on Flag.period.start)" />
      </mapping>
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.8" />
        <comment value="EndDateTime (implicit, main mapping is on Flag.period.end)" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.EndDateTime (implicit, main mapping is on Flag.Period.End)" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.StartDateTime (implicit, main mapping is on Flag.Period.Start)" />
      </mapping>
    </element>
    <element id="Flag.category">
      <path value="Flag.category" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Flag.category:alertType">
      <path value="Flag.category" />
      <sliceName value="alertType" />
      <short value="AlertType" />
      <definition value="Indicates the type of alert, meaning a rough description of the cause or origin of the warning." />
      <alias value="AlertType" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.healthdata.be/ValueSet/AlertType" />
      </binding>
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.6" />
        <comment value="AlertType" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.AlertType" />
      </mapping>
    </element>
    <element id="Flag.code.coding">
      <path value="Flag.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Flag.code.coding:alertName">
      <path value="Flag.code.coding" />
      <sliceName value="alertName" />
      <short value="AlertName" />
      <definition value="A warning, other than a condition or problem. For example, a patient can be given an ‘Aggressive patient' alert. The warning can be entered in code (there are codes for frequently used alerts), but seeing the dynamic nature of the warnings cf. SARS and Ebola, these alerts will often be entered as free text." />
      <comment value="If this slice is used, slice `:dataAbsentReason` MUST be absent and `Flag.extension:concern` MUST NOT exist. See the guidance on the root." />
      <alias value="AlertNaam" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.healthdata.be/ValueSet/AlertName" />
      </binding>
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.4" />
        <comment value="AlertName" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.AlertName" />
      </mapping>
    </element>
    <element id="Flag.code.coding:dataAbsentReason">
      <path value="Flag.code.coding" />
      <sliceName value="dataAbsentReason" />
      <comment value="This slice MUST be used when `Flag.extension:concern` is populated. Slice `:alertName` MUST be absent in this case. See the guidance on the root." />
      <max value="1" />
      <patternCoding>
        <system value="http://terminology.hl7.org/CodeSystem/data-absent-reason" />
        <code value="not-applicable" />
      </patternCoding>
    </element>
    <element id="Flag.subject">
      <path value="Flag.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PlanDefinition" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Medication" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure" />
        <targetProfile value="https://fhir.healthdata.be/StructureDefinition/HdBe-Patient" />
      </type>
    </element>
    <element id="Flag.period.start">
      <path value="Flag.period.start" />
      <short value="StartDateTime" />
      <definition value="The date and time at which the described condition was entered as a warning. This can be an exact date and time, or a rough indication of the date (such as only the year, or the month and the year)." />
      <alias value="BeginDatumTijd" />
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.5" />
        <comment value="StartDateTime" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.StartDateTime" />
      </mapping>
    </element>
    <element id="Flag.period.end">
      <path value="Flag.period.end" />
      <short value="EndDateTime" />
      <definition value="The date and time at which the described condition was retracted as a warning. This can be an exact date and time, or a rough indication of the date (such as only the year, or the month and the year)." />
      <alias value="EindDatumTijd" />
      <mapping>
        <identity value="zib-alert-v4.1-2020EN" />
        <map value="NL-CM:8.3.8" />
        <comment value="EndDateTime" />
      </mapping>
      <mapping>
        <identity value="HdBe-Alert" />
        <map value="Alert.EndDateTime" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>