<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="immunization-profile" />
  <meta>
    <lastUpdated value="2021-02-27T01:47:55.510+00:00" />
  </meta>
  <url value="http://philforestall.ca/fhir/StructureDefinition/ImmunizationProfile" />
  <version value="0.4" />
  <name value="ImmunizationProfile" />
  <title value="Immunization Profile" />
  <status value="draft" />
  <date value="2021-02-27T01:41:13.0515911+00:00" />
  <publisher value="Me" />
  <contact>
    <name value="Phil" />
    <telecom>
      <system value="email" />
      <value value="phil.forestall@live.ca" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Defines the medicine regulatory authority constraints and extensions on the Immunization resource for the minimal set of data to query and retrieve an individual’s immunization information." />
  <purpose value="Attempt #4:&#xD;&#xA;- issues with CoreUK extension availability gumming up the works." />
  <copyright value="It's all mine, baby!" />
  <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.extension">
      <path value="Immunization.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Immunization.extension:administeredproduct">
      <path value="Immunization.extension" />
      <sliceName value="administeredproduct" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://philforestall.ca/fhir/StructureDefinition/ExtensionAdministeredProduct" />
      </type>
    </element>
    <element id="Immunization.extension:vaccinationProcedure">
      <path value="Immunization.extension" />
      <sliceName value="vaccinationProcedure" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-VaccinationProcedure" />
      </type>
    </element>
    <element id="Immunization.extension:vaccinationProcedure.value[x]">
      <path value="Immunization.extension.value[x]" />
      <type>
        <code value="Reference" />
      </type>
    </element>
    <element id="Immunization.vaccineCode.coding">
      <path value="Immunization.vaccineCode.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Immunization.vaccineCode.coding:vaccinesGpsUvIps">
      <path value="Immunization.vaccineCode.coding" />
      <sliceName value="vaccinesGpsUvIps" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/vaccines-gps-uv-ips" />
      </binding>
    </element>
    <element id="Immunization.vaccineCode.coding:vaccinesGpsUvIps.system">
      <path value="Immunization.vaccineCode.coding.system" />
      <min value="1" />
    </element>
    <element id="Immunization.vaccineCode.coding:vaccinesGpsUvIps.code">
      <path value="Immunization.vaccineCode.coding.code" />
      <min value="1" />
    </element>
    <element id="Immunization.vaccineCode.coding:whoAtcUvIps">
      <path value="Immunization.vaccineCode.coding" />
      <sliceName value="whoAtcUvIps" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/whoatc-uv-ips" />
      </binding>
    </element>
    <element id="Immunization.vaccineCode.coding:whoAtcUvIps.system">
      <path value="Immunization.vaccineCode.coding.system" />
      <min value="1" />
    </element>
    <element id="Immunization.vaccineCode.coding:whoAtcUvIps.code">
      <path value="Immunization.vaccineCode.coding.code" />
      <min value="1" />
    </element>
    <element id="Immunization.occurrence[x]">
      <path value="Immunization.occurrence[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Immunization.occurrence[x]:occurrenceDateTime">
      <path value="Immunization.occurrence[x]" />
      <sliceName value="occurrenceDateTime" />
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="Immunization.occurrence[x]:occurrenceString">
      <path value="Immunization.occurrence[x]" />
      <sliceName value="occurrenceString" />
      <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.&#xD;&#xA;This type should only be used in the rare event that the DateTime is not known with of patient self-administered dose.&#xD;&#xA;[Note: this isn't the best example of a type slice because the implementation comments we are adding could have been made clear on the occurrence[x] element without slicing. It does however simulate how to profile an element in multiple ways.]" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="Immunization.route">
      <path value="Immunization.route" />
      <min value="1" />
      <binding>
        <strength value="required" />
      </binding>
    </element>
    <element id="Immunization.education">
      <path value="Immunization.education" />
      <max value="0" />
    </element>
    <element id="Immunization.reaction.date">
      <path value="Immunization.reaction.date" />
      <min value="1" />
    </element>
    <element id="Immunization.reaction.detail">
      <path value="Immunization.reaction.detail" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>