<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://fhir.healthbc.org/StructureDefinition/AllergyIntolerance" />
  <version value="1.0" />
  <name value="ca-bc-careconnect-allergy-intolerance" />
  <status value="active" />
  <date value="2021-07-13" />
  <fhirVersion value="3.0.2" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/w5" />
    <name value="W5 Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="AllergyIntolerance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" />
  <derivation value="constraint" />
  <differential>
    <element id="AllergyIntolerance.id">
      <path value="AllergyIntolerance.id" />
      <min value="1" />
    </element>
    <element id="AllergyIntolerance.meta">
      <path value="AllergyIntolerance.meta" />
      <max value="0" />
    </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.text">
      <path value="AllergyIntolerance.text" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.extension">
      <path value="AllergyIntolerance.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="AllergyIntolerance.extension:reportedByCode">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="reportedByCode" />
      <short value="Source of the reported adverse reaction" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-reported-by-code-extension" />
      </type>
    </element>
    <element id="AllergyIntolerance.extension:medicationReference">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="medicationReference" />
      <short value="The medication for which there was an adverse reaction." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-allergy-intolerance-medication-reference-extension" />
      </type>
    </element>
    <element id="AllergyIntolerance.extension:medicationReference.valueReference:valueReference">
      <path value="AllergyIntolerance.extension.valueReference" />
      <sliceName value="valueReference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-medication" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="AllergyIntolerance.identifier">
      <path value="AllergyIntolerance.identifier" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.type">
      <path value="AllergyIntolerance.type" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.criticality">
      <path value="AllergyIntolerance.criticality" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.id">
      <path value="AllergyIntolerance.code.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.coding">
      <path value="AllergyIntolerance.code.coding" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.patient">
      <path value="AllergyIntolerance.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="AllergyIntolerance.patient.id">
      <path value="AllergyIntolerance.patient.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.patient.identifier">
      <path value="AllergyIntolerance.patient.identifier" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.patient.display">
      <path value="AllergyIntolerance.patient.display" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.onset[x]">
      <path value="AllergyIntolerance.onset[x]" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.recorder">
      <path value="AllergyIntolerance.recorder" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.asserter">
      <path value="AllergyIntolerance.asserter" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.lastOccurrence">
      <path value="AllergyIntolerance.lastOccurrence" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.note.id">
      <path value="AllergyIntolerance.note.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.note.author[x]:authorReference">
      <path value="AllergyIntolerance.note.authorReference" />
      <sliceName value="authorReference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="AllergyIntolerance.note.author[x]:authorReference.id">
      <path value="AllergyIntolerance.note.authorReference.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.note.author[x]:authorReference.identifier">
      <path value="AllergyIntolerance.note.authorReference.identifier" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.reaction">
      <path value="AllergyIntolerance.reaction" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>