<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-DwImmunization" />
  <url value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwImmunization" />
  <version value="2.0.0" />
  <name value="DwImmunization" />
  <status value="active" />
  <date value="2026-05-29" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Immunization" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Immunization" />
  <derivation value="constraint" />
  <differential>
    <element id="Immunization.id">
      <path value="Immunization.id" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.meta.lastUpdated">
      <path value="Immunization.meta.lastUpdated" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.meta.source">
      <path value="Immunization.meta.source" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.meta.security">
      <path value="Immunization.meta.security" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.extension">
      <path value="Immunization.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Immunization.extension:archivedIndicator">
      <path value="Immunization.extension" />
      <sliceName value="archivedIndicator" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-ArchivedIndicator" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Immunization.identifier">
      <path value="Immunization.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.status">
      <path value="Immunization.status" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.statusReason">
      <path value="Immunization.statusReason" />
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <valueSet value="http://hl7.org/fhir/ValueSet/immunization-status-reason" />
      </binding>
    </element>
    <element id="Immunization.statusReason.coding.code">
      <path value="Immunization.statusReason.coding.code" />
      <comment value="PS &amp; CHR - Code will be PATOBJ when immunization is refused&#xD;&#xA;&#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1MB in size" />
    </element>
    <element id="Immunization.statusReason.coding.display">
      <path value="Immunization.statusReason.coding.display" />
      <comment value="PS &amp; CHR - display patient objection when flagged as refused&#xD;&#xA;MA - &#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1MB in size" />
    </element>
    <element id="Immunization.statusReason.text">
      <path value="Immunization.statusReason.text" />
      <comment value="PS - Refused Treatment &#xD;&#xA;CHR - Patient Refused" />
    </element>
    <element id="Immunization.vaccineCode">
      <path value="Immunization.vaccineCode" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.vaccineCode.coding">
      <path value="Immunization.vaccineCode.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Immunization.vaccineCode.coding:absentOrUnknownImmunization">
      <path value="Immunization.vaccineCode.coding" />
      <sliceName value="absentOrUnknownImmunization" />
      <comment value="Usage Note:  Where there are no immunizations recorded for the patient the &quot;no known immunization&quot; code will be provided." />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/absent-or-unknown-immunizations-uv-ips" />
      </binding>
    </element>
    <element id="Immunization.vaccineCode.coding:absentOrUnknownImmunization.system">
      <path value="Immunization.vaccineCode.coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.vaccineCode.coding:absentOrUnknownImmunization.version">
      <path value="Immunization.vaccineCode.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.vaccineCode.coding:absentOrUnknownImmunization.code">
      <path value="Immunization.vaccineCode.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.vaccineCode.coding:absentOrUnknownImmunization.display">
      <path value="Immunization.vaccineCode.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.vaccineCode.text">
      <path value="Immunization.vaccineCode.text" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.patient">
      <path value="Immunization.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Immunization.encounter">
      <path value="Immunization.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwEncounter" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Immunization.occurrence[x]">
      <path value="Immunization.occurrence[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.recorded">
      <path value="Immunization.recorded" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.primarySource">
      <path value="Immunization.primarySource" />
      <comment value="Reflects the &quot;reliability&quot; of the content." />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.reportOrigin">
      <path value="Immunization.reportOrigin" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.manufacturer">
      <path value="Immunization.manufacturer" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwOrganization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Immunization.lotNumber">
      <path value="Immunization.lotNumber" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.expirationDate">
      <path value="Immunization.expirationDate" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.site">
      <path value="Immunization.site" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.site.coding">
      <path value="Immunization.site.coding" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Immunization.site.coding:siteCVC">
      <path value="Immunization.site.coding" />
      <sliceName value="siteCVC" />
      <min value="0" />
      <max value="*" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/immunizationadministrationanatomicalsitecode" />
      </binding>
    </element>
    <element id="Immunization.site.text">
      <path value="Immunization.site.text" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.route">
      <path value="Immunization.route" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.route.coding">
      <path value="Immunization.route.coding" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Immunization.route.coding:routeCVC">
      <path value="Immunization.route.coding" />
      <sliceName value="routeCVC" />
      <min value="0" />
      <max value="*" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/immunizationrouteofadministrationcode" />
      </binding>
    </element>
    <element id="Immunization.route.coding:routeCVC.system">
      <path value="Immunization.route.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.route.coding:routeCVC.code">
      <path value="Immunization.route.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.route.coding:routeCVC.display">
      <path value="Immunization.route.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.route.text">
      <path value="Immunization.route.text" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.doseQuantity">
      <path value="Immunization.doseQuantity" />
      <comment value="The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator." />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.performer">
      <path value="Immunization.performer" />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.performer.function">
      <path value="Immunization.performer.function" />
      <comment value="MA - &quot;Vaccine Administered&quot; here = AP (administering provider) not provided when &quot;Vaccine Administered&quot; =elsewhere&#xD;&#xA;PSS -  AP  or not provide when &quot;Performed by External Provider&quot; &#xD;&#xA;&#xD;&#xA;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." />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://hl7.org/fhir/ValueSet/immunization-function" />
      </binding>
    </element>
    <element id="Immunization.performer.function.coding">
      <path value="Immunization.performer.function.coding" />
      <comment value="PSS - AP for any immunizations given by the clinic  Not provided for immunizations given elsewhere and being recorded in the EMR &#xD;&#xA;MA - TBD&#xD;&#xA;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.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
    </element>
    <element id="Immunization.performer.actor">
      <path value="Immunization.performer.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitioner" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitionerRole" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwOrganization" />
      </type>
    </element>
    <element id="Immunization.note">
      <path value="Immunization.note" />
      <comment value="For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time.  This element may need to be included in narrative because of the potential for modifying information.  *Annotations SHOULD NOT* be used to communicate &quot;modifying&quot; information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible)." />
      <mustSupport value="true" />
    </element>
    <element id="Immunization.reasonCode">
      <path value="Immunization.reasonCode" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="coding.system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <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="example" />
        <valueSet value="http://hl7.org/fhir/ValueSet/immunization-reason" />
      </binding>
    </element>
    <element id="Immunization.reasonCode:ICD9Code">
      <path value="Immunization.reasonCode" />
      <sliceName value="ICD9Code" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Immunization.reasonCode:ICD9Code.coding">
      <path value="Immunization.reasonCode.coding" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/psca/ValueSet/ICD9CM" />
      </binding>
    </element>
    <element id="Immunization.reasonCode:ICD9Code.coding.system">
      <path value="Immunization.reasonCode.coding.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/icd9cm" />
    </element>
    <element id="Immunization.reasonCode:ICD10Code">
      <path value="Immunization.reasonCode" />
      <sliceName value="ICD10Code" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Immunization.reasonCode:ICD10Code.coding.system">
      <path value="Immunization.reasonCode.coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/sid/icd-10" />
    </element>
    <element id="Immunization.reasonCode:SNOMEDCode">
      <path value="Immunization.reasonCode" />
      <sliceName value="SNOMEDCode" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Immunization.reasonCode:SNOMEDCode.coding">
      <path value="Immunization.reasonCode.coding" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/healthconditioncode" />
      </binding>
    </element>
    <element id="Immunization.reasonCode:SNOMEDCode.coding.system">
      <path value="Immunization.reasonCode.coding.system" />
      <min value="1" />
      <fixedUri value="http://snomed.info/sct" />
    </element>
    <element id="Immunization.reasonCode:ENCODECode">
      <path value="Immunization.reasonCode" />
      <sliceName value="ENCODECode" />
      <code>
        <system value="https://www.insite-fm.com/encode-fm" />
      </code>
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Immunization.reasonCode:ENCODECode.coding.system">
      <path value="Immunization.reasonCode.coding.system" />
      <min value="1" />
      <fixedUri value="https://www.insite-fm.com/encode-fm" />
    </element>
  </differential>
</StructureDefinition>