<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="il-core-allergy-intolerance" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="1" />
  </extension>
  <url value="http://fhir.health.gov.il/StructureDefinition/il-core-allergy-intolerance" />
  <version value="0.21.0" />
  <name value="ILCoreAllergyIntolerance" />
  <title value="ILCore AllergyIntolerance Profile" />
  <status value="active" />
  <date value="2026-03-23" />
  <publisher value="Israel Core Team" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="tal.primak@moh.gov.il" />
    </telecom>
  </contact>
  <description value="Israel Core proposed constraints and extensions on the AllergyIntolerance Resource" />
  <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" />
      <short value="ILCore AllergyIntolerance Profile" />
      <definition value="Israel Core proposed constraints and extensions on the AllergyIntolerance resource profile." />
    </element>
    <element id="AllergyIntolerance.extension">
      <path value="AllergyIntolerance.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="AllergyIntolerance.extension:AllergyIntoleranceEnd">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="AllergyIntoleranceEnd" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/ext-allergy-intolerance-end" />
      </type>
    </element>
    <element id="AllergyIntolerance.identifier">
      <path value="AllergyIntolerance.identifier" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-identifier" />
      </type>
    </element>
    <element id="AllergyIntolerance.clinicalStatus">
      <path value="AllergyIntolerance.clinicalStatus" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.verificationStatus">
      <path value="AllergyIntolerance.verificationStatus" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code">
      <path value="AllergyIntolerance.code" />
      <min value="1" />
      <example>
        <label value="Valid Example" />
        <valueCodeableConcept>
          <coding>
            <system value="http://snomed.info/sct" />
            <code value="1003755004" />
            <display value="Allergy to Hevea brasiliensis latex protein (finding)" />
          </coding>
        </valueCodeableConcept>
      </example>
      <constraint>
        <key value="element-sct" />
        <severity value="warning" />
        <human value="Element.coding SHOULD contain a SNOMED-CT code. Other code systems included in the ValueSet are for historical purposes only" />
        <expression value="coding.where(system='http://snomed.info/sct' and code.exists()).exists()" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-allergy-intolerance" />
      </constraint>
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-allergy-intolerance-code" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.coding">
      <path value="AllergyIntolerance.code.coding" />
      <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.patient">
      <path value="AllergyIntolerance.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
      </type>
    </element>
    <element id="AllergyIntolerance.encounter">
      <path value="AllergyIntolerance.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-encounter" />
      </type>
    </element>
    <element id="AllergyIntolerance.recorder">
      <path value="AllergyIntolerance.recorder" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-practitioner" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-practitioner-role" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-related-person" />
      </type>
    </element>
    <element id="AllergyIntolerance.asserter">
      <path value="AllergyIntolerance.asserter" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-related-person" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-practitioner" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-practitioner-role" />
      </type>
    </element>
    <element id="AllergyIntolerance.reaction.extension">
      <path value="AllergyIntolerance.reaction.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="AllergyIntolerance.reaction.extension:duration">
      <path value="AllergyIntolerance.reaction.extension" />
      <sliceName value="duration" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/ext-reaction-duration" />
      </type>
    </element>
    <element id="AllergyIntolerance.reaction.substance">
      <path value="AllergyIntolerance.reaction.substance" />
      <example>
        <label value="Valid Example" />
        <valueCodeableConcept>
          <coding>
            <system value="http://snomed.info/sct" />
            <code value="387458008" />
            <display value="Aspirin (substance)" />
          </coding>
        </valueCodeableConcept>
      </example>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-substance" />
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.manifestation">
      <path value="AllergyIntolerance.reaction.manifestation" />
      <example>
        <label value="Valid Example" />
        <valueCodeableConcept>
          <coding>
            <system value="http://snomed.info/sct" />
            <code value="60862001" />
            <display value="Tinnitus (finding)" />
          </coding>
        </valueCodeableConcept>
      </example>
      <constraint>
        <key value="element-sct" />
        <severity value="warning" />
        <human value="Element.coding SHOULD contain a SNOMED-CT code. Other code systems included in the ValueSet are for historical purposes only" />
        <expression value="coding.where(system='http://snomed.info/sct' and code.exists()).exists()" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-allergy-intolerance" />
      </constraint>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-manifestation" />
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.exposureRoute">
      <path value="AllergyIntolerance.reaction.exposureRoute" />
      <example>
        <label value="Valid Example" />
        <valueCodeableConcept>
          <coding>
            <system value="http://snomed.info/sct" />
            <code value="26643006" />
            <display value="Oral route (qualifier value)" />
          </coding>
        </valueCodeableConcept>
      </example>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-route-code" />
      </binding>
    </element>
  </differential>
</StructureDefinition>