<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="AllergyIntoleranceMERT" />
  <url value="https://intrahealth.com/fhir/mert/StructureDefinition/AllergyIntoleranceMERT" />
  <name value="AllergyIntoleranceMERT" />
  <title value="AllergyIntolerance (MERT)" />
  <status value="draft" />
  <description value="This profile describes the AllergyIntolerance for MERT." />
  <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.clinicalStatus">
      <path value="AllergyIntolerance.clinicalStatus" />
      <comment value="Required in MERT. Uses base required binding (AllergyIntoleranceClinicalStatusCodes)." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <comment value="Indicates allergy or intolerance mechanism when known. Uses base required binding." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.category">
      <path value="AllergyIntolerance.category" />
      <comment value="Use category when known (food | medication | environment | biologic). Uses base required binding." />
    </element>
    <element id="AllergyIntolerance.code">
      <path value="AllergyIntolerance.code" />
      <comment value="Transport-first: send existing source coding when available (e.g., DIN for medication allergies). If no appropriate coded concept is available, populate CodeableConcept.text." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.patient">
      <path value="AllergyIntolerance.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://intrahealth.com/fhir/mert/StructureDefinition/PatientMERT" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.encounter">
      <path value="AllergyIntolerance.encounter" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.onset[x]">
      <path value="AllergyIntolerance.onset[x]" />
      <comment value="Use onset[x] when available to indicate when the allergy/intolerance was first identified." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.recordedDate">
      <path value="AllergyIntolerance.recordedDate" />
      <comment value="Date the first version of the resource instance was recorded." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.asserter">
      <path value="AllergyIntolerance.asserter" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://intrahealth.com/fhir/mert/StructureDefinition/PractitionerMERT" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.note">
      <path value="AllergyIntolerance.note" />
      <comment value="Additional information about the allergy/intolerance not captured in structured fields." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction">
      <path value="AllergyIntolerance.reaction" />
      <comment value="Details about adverse reaction events linked to exposure." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance">
      <path value="AllergyIntolerance.reaction.substance" />
      <comment value="Specific substance or product responsible for the reaction (base example binding)." />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation">
      <path value="AllergyIntolerance.reaction.manifestation" />
      <comment value="Clinical signs or symptoms associated with the reaction. Prefer SNOMED CT when available." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.description">
      <path value="AllergyIntolerance.reaction.description" />
      <comment value="Narrative description of the reaction event." />
    </element>
    <element id="AllergyIntolerance.reaction.onset">
      <path value="AllergyIntolerance.reaction.onset" />
      <comment value="Date/time when reaction manifestations occurred." />
    </element>
    <element id="AllergyIntolerance.reaction.severity">
      <path value="AllergyIntolerance.reaction.severity" />
      <comment value="Severity of the reaction event (mild | moderate | severe). Uses base required binding." />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.exposureRoute">
      <path value="AllergyIntolerance.reaction.exposureRoute" />
      <comment value="Route of exposure (e.g., oral, inhaled). Prefer SNOMED CT route codes when available." />
    </element>
    <element id="AllergyIntolerance.reaction.note">
      <path value="AllergyIntolerance.reaction.note" />
      <comment value="Additional text about the reaction not captured elsewhere." />
    </element>
  </differential>
</StructureDefinition>