<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="biobankcy-sd-allergyIntollerance" />
  <url value="http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-allergyIntollerance" />
  <name value="BIOBANKCYSDAllergyIntolerance" />
  <title value="Profile: AllergyIntolerance (biobank.cy)" />
  <status value="draft" />
  <publisher value="biobank.cy" />
  <contact>
    <name value="Molecular Medicine Research Center (MMRC)" />
    <telecom>
      <system value="email" />
      <value value="biobank@ucy.ac.cy" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Represents an allergy of a donor (research subject) of the biobank.cy. The allergy can be self-reported by the patient or reported by a medical doctor or nurse." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="AllergyIntolerance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" />
  <derivation value="constraint" />
  <differential>
    <element id="AllergyIntolerance">
      <path value="AllergyIntolerance" />
      <definition value="Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.&#xD;&#xA;&#xD;&#xA;CyprusEHR: This profile is designed to meet the requirements of the patient summary and the value sets from eHDSI." />
    </element>
    <element id="AllergyIntolerance.extension">
      <path value="AllergyIntolerance.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="AllergyIntolerance.extension:abatement-datetime">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="abatement-datetime" />
      <short value="Date(/time) of the end date of a reaction." />
      <definition value="Date of resolution of the allergy (e.g. when the clinician deemed there is no longer any need to track the underlying condition)" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/abatement-dateTime-uv-ips" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.extension:abatement-datetime.url">
      <path value="AllergyIntolerance.extension.url" />
      <fixedUri value="http://hl7.org/fhir/uv/ips/StructureDefinition/abatement-dateTime-uv-ips" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <definition value="This element describes whether this condition refers to an allergy or non-allergy intolerance." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Identification of the underlying physiological mechanism for a Reaction Risk. Use ConceptMap CYEHRCMAllergyTypeSnomed2HL7FHIR to map terminology used for internal use (CYEHRVSEHDSIAdverseEventType) to profile terminology in valueSet AllergyIntoleranceClinicalStatusCodes." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-type|4.0.1">
          <extension url="http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap">
            <valueCanonical value="http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergytype-snomed2hl7fhir" />
          </extension>
        </valueSet>
      </binding>
    </element>
    <element id="AllergyIntolerance.type.extension">
      <path value="AllergyIntolerance.type.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode">
      <path value="AllergyIntolerance.type.extension" />
      <sliceName value="eHDSIAdverseEventTypeCode" />
      <short value="eHDSI Adverse Event Type Code" />
      <definition value="This extension is added here to include the required eHDSI value set." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.&#xA;&#xA; CyprusEHR: The concept map between the FHIR bound value set and the eHDSIAdverseEventType value set is:&#xA;&#xA; | HL7 FHIR: | Allergy | Intolerance |&#xA;|--&#xA;| **eHDSI:** |  |  | &#xA;| Allergic disposition  | X  |  |&#xA;| Propensity to adverse reaction | X |  |&#xA;| Intolerance | | X |&#xA;&#xA;&#xA; **See:** http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergytype-snomed2hl7fhir" />
      <requirements value="CyprusEHR: The binding strength of the valueset of thi element is required with cardinality 0..1 and therefore using a different valueset to represent these values is not allowed. To address the need of having codes as used for the eHDSI services, we adopt the values set as defined by FHIR for this element and we also use an extra code to define in  more detail the value of this element. Therefore, allergy type can be described by the code &quot;allergy&quot; from the required FHIR valueset and  &quot;Propensity to adverse reaction&quot; or &quot;Allergic disposition&quot; from the eHDSI MVC value set." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode" />
      </type>
      <mustSupport value="true" />
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.url">
      <path value="AllergyIntolerance.type.extension.url" />
      <fixedUri value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode" />
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x]">
      <path value="AllergyIntolerance.type.extension.value[x]" />
      <short value="Binding to the eHDSI value set for &quot;Adverse Event Type&quot;." />
      <definition value="Binding to include the required eHDSI value set. This covers additional values such as drug allergy, food allergy, allergy to substance etc." />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiadverseeventtype" />
      </binding>
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding">
      <path value="AllergyIntolerance.type.extension.value[x].coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding.system">
      <path value="AllergyIntolerance.type.extension.value[x].coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding.code">
      <path value="AllergyIntolerance.type.extension.value[x].coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding.display">
      <path value="AllergyIntolerance.type.extension.value[x].coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.category">
      <path value="AllergyIntolerance.category" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.criticality">
      <path value="AllergyIntolerance.criticality" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code">
      <path value="AllergyIntolerance.code" />
      <short value="Codeable concept for allergy to drugs, no drugs or unknown allergy intolerance." />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <description value="Code that identifies the allergy or intolerance" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.coding">
      <path value="AllergyIntolerance.code.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.display">
      <path value="AllergyIntolerance.code.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceDrugs">
      <path value="AllergyIntolerance.code.coding" />
      <sliceName value="allergyIntoleranceDrugs" />
      <short value="Codes for &quot;drugs allergy&quot; from the eHDSI value set." />
      <definition value="Codes for &quot;drugs allergy&quot; from the eHDSI value set (Active Ingredient)." />
      <binding>
        <strength value="required" />
        <description value="Codes for drugs." />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiactiveingredient" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceDrugs.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceDrugs.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceDrugs.display">
      <path value="AllergyIntolerance.code.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs">
      <path value="AllergyIntolerance.code.coding" />
      <sliceName value="allergyIntoleranceNoDrugs" />
      <short value="Codes for &quot;no drugs allergy&quot; from the eHDSI value set." />
      <definition value="Codes for &quot;no drugs allergy&quot; from the eHDSI value set (Allergen no drug)." />
      <binding>
        <strength value="required" />
        <description value="Codes for no drugs." />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiallergennodrug" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs.display">
      <path value="AllergyIntolerance.code.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance">
      <path value="AllergyIntolerance.code.coding" />
      <sliceName value="absentOrUnknownAllergyIntolerance" />
      <short value="Codes for &quot;absent or unknown allergy intolerance&quot; from the eHDSI value set." />
      <definition value="Codes for &quot;absent or unknown allergy intolerance&quot; from the eHDSI value set (absent or unknown allergy)." />
      <binding>
        <strength value="required" />
        <description value="negation/exclusion codes for reporting no known allergies or not available data." />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiabsentorunknownallergy" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance.display">
      <path value="AllergyIntolerance.code.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.patient">
      <path value="AllergyIntolerance.patient" />
      <comment value="For biobank.cy data warehouse use either the biobankcy-sd-citizen (if the patient receives biobank.cy services for diagnostic puprposes) or biobankcy-sd-donor (if the patient receives biobank.cy services for research purposes).&#xD;&#xA;&#xD;&#xA;FHIR core resrouce Patient is also included for storing patients received by other biobank or research organizations. In case this is not desired the FHIR core Patient resource should be removed from the target profiles." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-donor" />
        <targetProfile value="http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-citizen" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.patient.reference">
      <path value="AllergyIntolerance.patient.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.encounter">
      <path value="AllergyIntolerance.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
        <targetProfile value="http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-visit" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.encounter.reference">
      <path value="AllergyIntolerance.encounter.reference" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.onset[x]">
      <path value="AllergyIntolerance.onset[x]" />
      <type>
        <code value="dateTime" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.recorder">
      <path value="AllergyIntolerance.recorder" />
      <comment value="For biobank.cy this shall be the nurse or any other practitioner who recorded this information." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.recorder.reference">
      <path value="AllergyIntolerance.recorder.reference" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction">
      <path value="AllergyIntolerance.reaction" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation">
      <path value="AllergyIntolerance.reaction.manifestation" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding">
      <path value="AllergyIntolerance.reaction.manifestation.coding" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.system">
      <path value="AllergyIntolerance.reaction.manifestation.coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.code">
      <path value="AllergyIntolerance.reaction.manifestation.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.display">
      <path value="AllergyIntolerance.reaction.manifestation.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode">
      <path value="AllergyIntolerance.reaction.manifestation" />
      <sliceName value="allergyIntoleranceReactionManifestationGPSCode" />
      <short value="eHDSI value set for reaction allergy." />
      <definition value="eHDSI value set for reaction allergy." />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsireactionallergy" />
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding">
      <path value="AllergyIntolerance.reaction.manifestation.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding.system">
      <path value="AllergyIntolerance.reaction.manifestation.coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding.code">
      <path value="AllergyIntolerance.reaction.manifestation.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding.display">
      <path value="AllergyIntolerance.reaction.manifestation.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.onset">
      <path value="AllergyIntolerance.reaction.onset" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.severity">
      <path value="AllergyIntolerance.reaction.severity" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations. Use ConceptMap CYEHRCMAllergyReactionSeveritySnomed2HL7FHIR to map terminology used for internal use (CYEHRVSEHDSISeverity) to profile terminology in valueSet AllergyIntoleranceSeverity." />
        <valueSet value="http://hl7.org/fhir/ValueSet/reaction-event-severity|4.0.1">
          <extension url="http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap">
            <valueCanonical value="http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergyreactionseverity-snomed2hl7fhir" />
          </extension>
        </valueSet>
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension">
      <path value="AllergyIntolerance.reaction.severity.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode">
      <path value="AllergyIntolerance.reaction.severity.extension" />
      <sliceName value="eHDSISeverityCode" />
      <short value="eHDSI Severity Code" />
      <definition value="This extension is added here to include the required eHDSI value set. This covers additional values such as &quot;life threatening severity&quot;, &quot;mild to moderate&quot;, &quot;moderate to severe&quot;." />
      <comment value="The concept map between the FHIR bound value set and the eHDSISeverity value set is:&#xD;&#xA;&#xD;&#xA;|Severity| | | |&#xD;&#xA;|--&#xD;&#xA;| HL7 FHIR: | Mild | Moderate | Severe|&#xA;| **eHDSI:** |  |  |  |  &#xA;| Life threatening severity|   |  | X | &#xA;|Mild| X |  |  | &#xA;| Mild to moderate| | X |  | &#xA;| Moderate |  | X |  |&#xD;&#xA;| Moderate to severe |  |  | X |&#xD;&#xA;| Severe|  |  | X |&#xD;&#xA;&#xD;&#xA;**See:** http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergyreactionseverity-snomed2hl7fhir" />
      <requirements value="CyprusEHR: The binding strength of the valueset of thi element is required with cardinality 0..1 and therefore using a different valueset to represent these values is not allowed. To address the need of having codes as used for the eHDSI services, we adopt the values set as defined by FHIR for this element and we also use an extra code to define in  more detail the value of this element. Therefore, reaction severity can be described by the code &quot;mild&quot; from the required FHIR valueset and &quot;Mild to moderate&quot; or &quot;Moderate&quot; from the eHDSI MVC value set." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode" />
      </type>
      <mustSupport value="true" />
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.url">
      <path value="AllergyIntolerance.reaction.severity.extension.url" />
      <fixedUri value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x]">
      <path value="AllergyIntolerance.reaction.severity.extension.value[x]" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiseverity" />
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding">
      <path value="AllergyIntolerance.reaction.severity.extension.value[x].coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding.system">
      <path value="AllergyIntolerance.reaction.severity.extension.value[x].coding.system" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding.code">
      <path value="AllergyIntolerance.reaction.severity.extension.value[x].coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding.display">
      <path value="AllergyIntolerance.reaction.severity.extension.value[x].coding.display" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>