<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ext-allergy-intolerance-end" />
  <language value="en-US" />
  <url value="http://fhir.health.gov.il/StructureDefinition/ext-allergy-intolerance-end" />
  <version value="0.21.0" />
  <name value="AllergyIntoleranceEnd" />
  <title value="Ext: Allergy Intolerance End" />
  <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="Supports the date when the allergy or intolerance was no longer valid, and/or, the reason why the allergy or intolerance is no longer valid." />
  <purpose value="This extension extends the AllergyIntolerance resource to support the exchange of information describing the date when the allergy or intolerance was no longer valid, and/or, the reason why the allergy or intolerance is no longer valid, which is currently not supported by the FHIR standard." />
  <fhirVersion value="4.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <context>
    <type value="element" />
    <expression value="AllergyIntolerance" />
  </context>
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <short value="Ext: Allergy Intolerance End" />
      <definition value="Supports the date when the allergy or intolerance was no longer valid, and/or, the reason why the allergy or intolerance is no longer valid." />
    </element>
    <element id="Extension.extension:endDate">
      <path value="Extension.extension" />
      <sliceName value="endDate" />
      <short value="The date the allergy or intolerance was recorded as no longer valid" />
      <definition value="The date the allergy or intolerance was recorded as no longer valid." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Extension.extension:endDate.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:endDate.url">
      <path value="Extension.extension.url" />
      <fixedUri value="endDate" />
    </element>
    <element id="Extension.extension:endDate.value[x]">
      <path value="Extension.extension.value[x]" />
      <short value="The date the allergy was recorded as no longer valid" />
      <definition value="The date the allergy was recorded as no longer valid." />
      <min value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <example>
        <label value="Valid Example" />
        <valueDateTime value="2022-01-01" />
      </example>
    </element>
    <element id="Extension.extension:reasonEnded">
      <path value="Extension.extension" />
      <sliceName value="reasonEnded" />
      <short value="The reason why the allergy or intolerance has been resolved" />
      <definition value="The reason why the allergy or intolerance has been resolved." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Extension.extension:reasonEnded.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:reasonEnded.url">
      <path value="Extension.extension.url" />
      <fixedUri value="reasonEnded" />
    </element>
    <element id="Extension.extension:reasonEnded.value[x]">
      <path value="Extension.extension.value[x]" />
      <short value="The reason why the allergy or intolerance has been resolved" />
      <definition value="The reason why the allergy or intolerance has been resolved." />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <example>
        <label value="Valid Example" />
        <valueCodeableConcept>
          <coding>
            <system value="http://snomed.info/sct" />
            <code value="165009005" />
            <display value="Allergy testing - no reaction (finding)" />
          </coding>
        </valueCodeableConcept>
      </example>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-allergy-intolerance-end-reason" />
      </binding>
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="http://fhir.health.gov.il/StructureDefinition/ext-allergy-intolerance-end" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>