<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ca-on-eReferral-profile-AllergyIntolerance" />
  <url value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-AllergyIntolerance" />
  <version value="1.0.0" />
  <name value="EReferralAllergyIntolerance" />
  <title value="AllergyIntolerance" />
  <status value="draft" />
  <description value="This profile details the clinical assessment of an allergy or intolerance; a propensity, or a potential risk to an individual, to have an adverse reaction on future exposure to the specified substance, or class of substance." />
  <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="AllergyIntolerance Profile" />
      <definition value="The AllergyIntolerance Profile is based upon the core FHIR AllergyIntolerance Resource" />
    </element>
    <element id="AllergyIntolerance.meta">
      <path value="AllergyIntolerance.meta" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.meta.profile">
      <path value="AllergyIntolerance.meta.profile" />
      <comment value="#### **_` FOR eREFERRAL USAGE: The meta.profile = http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-AllergyIntolerance|1.0.0 `_**&#xD;&#xA;&#xD;&#xA;It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.identifier">
      <path value="AllergyIntolerance.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.identifier.system">
      <path value="AllergyIntolerance.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.identifier.value">
      <path value="AllergyIntolerance.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus">
      <path value="AllergyIntolerance.clinicalStatus" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergyintolerance-clinical" />
      </binding>
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding">
      <path value="AllergyIntolerance.clinicalStatus.coding" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding.system">
      <path value="AllergyIntolerance.clinicalStatus.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding.code">
      <path value="AllergyIntolerance.clinicalStatus.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding.display">
      <path value="AllergyIntolerance.clinicalStatus.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.verificationStatus">
      <path value="AllergyIntolerance.verificationStatus" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergyintolerance-verification" />
      </binding>
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding">
      <path value="AllergyIntolerance.verificationStatus.coding" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.system">
      <path value="AllergyIntolerance.verificationStatus.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.code">
      <path value="AllergyIntolerance.verificationStatus.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.display">
      <path value="AllergyIntolerance.verificationStatus.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-type" />
      </binding>
    </element>
    <element id="AllergyIntolerance.category">
      <path value="AllergyIntolerance.category" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-category" />
      </binding>
    </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" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <description value="Discriminated by the bound value set" />
        <rules value="open" />
      </slicing>
      <short value="Concept - reference to a terminology or just  text" />
      <definition value="A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <description value="Type of the substance/product, allergy or intolerance condition." />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code:allergyIntoleranceGPSCode">
      <path value="AllergyIntolerance.code" />
      <sliceName value="allergyIntoleranceGPSCode" />
      <short value="Code for allergy or intolerance from the SNOMED CT GPS code set" />
      <definition value="Code for an allergy or intolerance statement that is selected from the SNOMED CT GPS code set." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <mustSupport value="true" />
      <isModifier value="false" />
      <binding>
        <strength value="extensible" />
        <description value="Codes for allergy or intolerance from the SNOMED CT GPS code set" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-gps-uv-ips" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code:absentOrUnknownAllergy">
      <path value="AllergyIntolerance.code" />
      <sliceName value="absentOrUnknownAllergy" />
      <short value="Code for absent or unknown allergy" />
      <definition value="Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This describes a categorical negated statement (e.g., &quot;No known allergy&quot;)." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="negation/exclusion codes for reporting no known allergies or not available data." />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/absent-or-unknown-allergies-uv-ips" />
      </binding>
    </element>
    <element id="AllergyIntolerance.patient">
      <path value="AllergyIntolerance.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Patient" />
        <aggregation value="referenced" />
      </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.onset[x]">
      <path value="AllergyIntolerance.onset[x]" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.recordedDate">
      <path value="AllergyIntolerance.recordedDate" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.lastOccurrence">
      <path value="AllergyIntolerance.lastOccurrence" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.note">
      <path value="AllergyIntolerance.note" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.note.text">
      <path value="AllergyIntolerance.note.text" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction">
      <path value="AllergyIntolerance.reaction" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance">
      <path value="AllergyIntolerance.reaction.substance" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding">
      <path value="AllergyIntolerance.reaction.substance.coding" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding.system">
      <path value="AllergyIntolerance.reaction.substance.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding.code">
      <path value="AllergyIntolerance.reaction.substance.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation">
      <path value="AllergyIntolerance.reaction.manifestation" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding">
      <path value="AllergyIntolerance.reaction.manifestation.coding" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.system">
      <path value="AllergyIntolerance.reaction.manifestation.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.code">
      <path value="AllergyIntolerance.reaction.manifestation.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.description">
      <path value="AllergyIntolerance.reaction.description" />
      <mustSupport value="true" />
    </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" />
    </element>
    <element id="AllergyIntolerance.reaction.note">
      <path value="AllergyIntolerance.reaction.note" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>