<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.1.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.1.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="false" />
    </element>
    <element id="AllergyIntolerance.identifier.system">
      <path value="AllergyIntolerance.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.identifier.value">
      <path value="AllergyIntolerance.identifier.value" />
      <min value="1" />
      <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="false" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding.system">
      <path value="AllergyIntolerance.clinicalStatus.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding.code">
      <path value="AllergyIntolerance.clinicalStatus.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.clinicalStatus.coding.display">
      <path value="AllergyIntolerance.clinicalStatus.coding.display" />
      <min value="1" />
      <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="false" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.system">
      <path value="AllergyIntolerance.verificationStatus.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.code">
      <path value="AllergyIntolerance.verificationStatus.coding.code" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.display">
      <path value="AllergyIntolerance.verificationStatus.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <mustSupport value="false" />
      <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="false" />
      <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" />
      <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="required" />
        <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.coding">
      <path value="AllergyIntolerance.code.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="false" />
    </element>
    <element id="AllergyIntolerance.code.coding:codeAllergyCA">
      <path value="AllergyIntolerance.code.coding" />
      <sliceName value="codeAllergyCA" />
      <short value="Optional slice for code for allergy or intolerance from the SNOMED CT CA code set" />
      <definition value="Code for an allergy or intolerance statement that is selected from the SNOMED CT Canadian edition value set." />
      <comment value="Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information." />
      <max value="1" />
      <mustSupport value="false" />
      <binding>
        <strength value="required" />
        <description value="Codes for allergy or intolerance from the SNOMED CT GPS code set" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/psca/ValueSet/substanceandpharmaceuticalbiologicproductcode" />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.coding:codeAllergyCA.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code.coding:codeAllergyCA.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code.coding:codeAllergyCA.display">
      <path value="AllergyIntolerance.code.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergy">
      <path value="AllergyIntolerance.code.coding" />
      <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." />
      <max value="1" />
      <mustSupport value="false" />
      <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.code.coding:absentOrUnknownAllergy.system">
      <path value="AllergyIntolerance.code.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergy.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code.coding:absentOrUnknownAllergy.display">
      <path value="AllergyIntolerance.code.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.code.text">
      <path value="AllergyIntolerance.code.text" />
      <mustSupport value="false" />
    </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="false" />
    </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="false" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding">
      <path value="AllergyIntolerance.reaction.substance.coding" />
      <mustSupport value="false" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding.system">
      <path value="AllergyIntolerance.reaction.substance.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding.code">
      <path value="AllergyIntolerance.reaction.substance.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.coding.display">
      <path value="AllergyIntolerance.reaction.substance.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.substance.text">
      <path value="AllergyIntolerance.reaction.substance.text" />
      <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="false" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.system">
      <path value="AllergyIntolerance.reaction.manifestation.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.code">
      <path value="AllergyIntolerance.reaction.manifestation.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.coding.display">
      <path value="AllergyIntolerance.reaction.manifestation.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="AllergyIntolerance.reaction.manifestation.text">
      <path value="AllergyIntolerance.reaction.manifestation.text" />
      <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>