<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-immunization" />
  <url value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-immunization" />
  <version value="1.2.2" />
  <name value="ImmunizationProfile" />
  <title value="Immunization Profile" />
  <status value="draft" />
  <date value="2024-12-27" />
  <publisher value="HL7 Canada - FHIR Implementation Work Group" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="https://infocentral.infoway-inforoute.ca/en/collaboration/wg/fhir-implementations" />
    </telecom>
  </contact>
  <description value="Proposed constraints and extensions on the Immunization resource.  Generated as a first step toward creating a set of Canadian Baseline FHIR profiles." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="CA" />
    </coding>
  </jurisdiction>
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <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/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Immunization" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Immunization" />
  <derivation value="constraint" />
  <differential>
    <element id="Immunization">
      <path value="Immunization" />
    </element>
    <element id="Immunization.statusReason">
      <path value="Immunization.statusReason" />
      <comment value="CA Baseline Usage Notes: a reason should be provided if the status is &quot;not-done&quot;." />
    </element>
    <element id="Immunization.vaccineCode">
      <path value="Immunization.vaccineCode" />
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="preferred" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/vaccinehistoricalnamecode" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="Recommended for use when conveying vaccine generic names for scenarios when brand name is not known or does not exist (e.g., immunization history where provider does not have detail of the trade name, the product has been discontinued and/or never licensed in Canada)." />
          </extension>
        </extension>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="preferred" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/passiveadministeredimmunizingagentcode" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="per pCHDCF: Alternate value sets can be used when passive immunization products are used" />
          </extension>
        </extension>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="preferred" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/passivehistoricalimmunizingagentcode" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="per pCHDCF: Alternate value sets can be used when passive immunization products are used" />
          </extension>
        </extension>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="candidate" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="http://hl7.org/fhir/uv/ips/ValueSet/absent-or-unknown-immunizations-uv-ips" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="Absent or unknown codes" />
          </extension>
        </extension>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/vaccineadministeredtradenamecode" />
      </binding>
    </element>
    <element id="Immunization.patient">
      <path value="Immunization.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-patient" />
      </type>
    </element>
    <element id="Immunization.encounter">
      <path value="Immunization.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-encounter" />
      </type>
    </element>
    <element id="Immunization.occurrence[x]">
      <path value="Immunization.occurrence[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="closed" />
      </slicing>
      <short value="Vaccine administration date" />
      <definition value="Date vaccine administered or was to be administered." />
      <comment value="CA Baseline Usage Notes: While occurrenceString is allowed given its use in existing Canadian systems - a combination of occurrenceDateTime (full or partial) with the 'estimated' extension is the preferred mechanism for expressing when an exact date is unknown. For example, if a patient recalls that they were immunized in June 1980, occurrenceDateTime will have a partial date '1980-06' with 'estimated'=true. Another example: if in 2020, a 55 y.o. patient recalls that they were immunized at the age of 5, occurrenceDateTime will have a partial date '1970' with 'estimated'=true." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Immunization.occurrence[x]" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="Immunization.occurrence[x]:occurrenceDateTime">
      <path value="Immunization.occurrence[x]" />
      <sliceName value="occurrenceDateTime" />
      <short value="Vaccine administration date" />
      <definition value="Date vaccine administered or was to be administered." />
      <comment value="When immunizations are given a specific date and time should always be known.   When immunizations are patient reported, a specific date might not be known.  Although partial dates are allowed, an adult patient might not be able to recall the year a childhood immunization was given. An exact date is always preferable, but the use of the String data type is acceptable when an exact date is not known. A small number of vaccines (e.g. live oral typhoid vaccine) are given as a series of patient self-administered dose over a span of time. In cases like this, often, only the first dose (typically a provider supervised dose) is recorded with the occurrence indicating the date/time of the first dose." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Immunization.occurrence[x]" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="Immunization.occurrence[x]:occurrenceDateTime.extension">
      <path value="Immunization.occurrence[x].extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="Immunization.occurrence[x]:occurrenceDateTime.extension:estimated">
      <path value="Immunization.occurrence[x].extension" />
      <sliceName value="estimated" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-dateestimated" />
      </type>
      <mustSupport value="false" />
    </element>
    <element id="Immunization.primarySource">
      <path value="Immunization.primarySource" />
      <short value="Indicates that data is from the primary record created at the time the vaccine was administered." />
    </element>
    <element id="Immunization.reportOrigin">
      <path value="Immunization.reportOrigin" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://cvc.canimmunize.ca/v3/ValueSet/RepSource" />
      </binding>
    </element>
    <element id="Immunization.location">
      <path value="Immunization.location" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-location" />
      </type>
    </element>
    <element id="Immunization.manufacturer">
      <path value="Immunization.manufacturer" />
      <comment value="CA Baseline Usage Notes: This is a reference to an organization that manufactures the vaccine. TBD: if there is a need to reference a 'DPD Company', a new extension should be created and used. A 'DPD Company' name, as used in the Health Canada DPF, indicates the organization (company) that holds the authorization to place the product on the market in Canada. This may not be the company that has manufactured the product, but it is the company that holds the legal responsibility for the use of the product in Canada and should be the same as the company named on the product label/packaging." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization" />
      </type>
    </element>
    <element id="Immunization.site">
      <path value="Immunization.site" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://cvc.canimmunize.ca/v3/ValueSet/AnatomicalSite" />
      </binding>
    </element>
    <element id="Immunization.route">
      <path value="Immunization.route" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://cvc.canimmunize.ca/v3/ValueSet/RouteOfAdmin" />
      </binding>
    </element>
    <element id="Immunization.performer.actor">
      <path value="Immunization.performer.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-practitioner" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-practitionerrole" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization" />
      </type>
    </element>
    <element id="Immunization.reasonReference">
      <path value="Immunization.reasonReference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-condition" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-diagnosticreport" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-diagnosticreportnote" />
      </type>
    </element>
    <element id="Immunization.reaction.detail">
      <path value="Immunization.reaction.detail" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation" />
      </type>
    </element>
    <element id="Immunization.protocolApplied.authority">
      <path value="Immunization.protocolApplied.authority" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization" />
      </type>
    </element>
    <element id="Immunization.protocolApplied.targetDisease">
      <path value="Immunization.protocolApplied.targetDisease" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://cvc.canimmunize.ca/v3/ValueSet/Disease" />
      </binding>
    </element>
  </differential>
</StructureDefinition>