<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://ehealth.bc.ca/fhir/StructureDefinition/ca-bc-eforms-profile-allergyIntolerance" />
  <name value="AllergyIntolerance" />
  <status value="draft" />
  <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.meta">
      <path value="AllergyIntolerance.meta" />
    </element>
    <element id="AllergyIntolerance.meta.profile">
      <path value="AllergyIntolerance.meta.profile" />
      <comment value="Apply &quot;http://ehealth.bc.ca/fhir/StructureDefinition/ca-bc-eforms-profile-allergyIntolerance&quot;" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.implicitRules">
      <path value="AllergyIntolerance.implicitRules" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.language">
      <path value="AllergyIntolerance.language" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.system">
      <path value="AllergyIntolerance.verificationStatus.coding.system" />
      <code>
        <system value="http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" />
      </code>
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.code">
      <path value="AllergyIntolerance.verificationStatus.coding.code" />
      <code>
        <code value="unfonfirmed" />
        <display value="Unconfirmed" />
      </code>
      <code>
        <code value="confirmed" />
        <display value="Confirmed" />
      </code>
      <code>
        <code value="refuted" />
        <display value="Refuted" />
      </code>
      <code>
        <code value="entered-in-error" />
        <display value="Entered in Error" />
      </code>
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.verificationStatus.coding.display">
      <path value="AllergyIntolerance.verificationStatus.coding.display" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <code>
        <system value="http://hl7.org/fhir/allergy-intolerance-type" />
      </code>
      <code>
        <code value="allergy" />
        <display value="Allergy" />
      </code>
      <code>
        <code value="intolerance" />
        <display value="Intolerance" />
      </code>
    </element>
    <element id="AllergyIntolerance.category">
      <path value="AllergyIntolerance.category" />
      <code>
        <system value="http://hl7.org/fhir/allergy-intolerance-category" />
        <code value="food" />
        <display value="Food" />
      </code>
      <code>
        <code value="medication" />
        <display value="Medication" />
      </code>
      <code>
        <code value="environment" />
        <display value="Environment" />
      </code>
      <code>
        <code value="biologic" />
        <display value="Biologic" />
      </code>
    </element>
    <element id="AllergyIntolerance.criticality">
      <path value="AllergyIntolerance.criticality" />
      <code>
        <system value="http://hl7.org/fhir/allergy-intolerance-criticality" />
      </code>
      <code>
        <code value="low" />
        <display value="Low Risk" />
      </code>
      <code>
        <code value="high" />
        <display value="High Risk" />
      </code>
    </element>
    <element id="AllergyIntolerance.code">
      <path value="AllergyIntolerance.code" />
      <comment value="if AllergyIntolerance.code represents NullFlavor concept, then AllergyIntolerance.verificationStatus SHALL be present" />
    </element>
    <element id="AllergyIntolerance.code.coding">
      <path value="AllergyIntolerance.code.coding" />
      <comment value="NotAsked: if AllergyIntolerance.code is a NullFlavor value, then AllergyIntolerance.clinicalStatus, AllergyIntolerance.verificationStatus, &#xD;&#xA;AllergyIntolerance.type, AllergyIntolerance.category, AllergyIntolerance.criticality SHALL NOT be present.  NoAllergy: if AllergyIntolerance.code is '716186003' No known allergy, then AllergyIntolerance.verificationStatus SHALL be one of the following: confirmed | refuted | entered-in-error" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.code.coding.code">
      <path value="AllergyIntolerance.code.coding.code" />
      <code>
        <code value="NotAsked" />
      </code>
      <code>
        <system value="https://fhir.infoway-inforoute.ca/valueSet/NullFlavor" />
        <code value="NotAsked" />
      </code>
      <code>
        <code value="NoAllergy" />
      </code>
      <comment value="NotAsked: if AllergyIntolerance.code is a NullFlavor value, then AllergyIntolerance.clinicalStatus, AllergyIntolerance.verificationStatus, &#xD;&#xA;AllergyIntolerance.type, AllergyIntolerance.category, AllergyIntolerance.criticality SHALL NOT be present.  NoAllergy: if AllergyIntolerance.code is '716186003' No known allergy, then AllergyIntolerance.verificationStatus SHALL be one of the following: confirmed | refuted | entered-in-error" />
    </element>
  </differential>
</StructureDefinition>