<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="d5d38102-c557-41af-a34b-38bfa77a5ea0" />
  <meta>
    <lastUpdated value="2022-02-18T19:32:55.165+00:00" />
  </meta>
  <text>
    <status value="empty" />
    <div xmlns="http://www.w3.org/1999/xhtml">No human-readable text provided in this case.</div>
  </text>
  <url value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-MedicationDispense" />
  <version value="3.0.0" />
  <name value="MedicationDispense" />
  <status value="active" />
  <date value="2022-02-14T19:05:36.9336556+00:00" />
  <description value="Indicates that a medication is to be or has been dispensed for a named patient" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationDispense" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationDispense" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationDispense">
      <path value="MedicationDispense" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.id">
      <path value="MedicationDispense.id" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.meta">
      <path value="MedicationDispense.meta" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.meta.lastUpdated">
      <path value="MedicationDispense.meta.lastUpdated" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.meta.source">
      <path value="MedicationDispense.meta.source" />
      <definition value="A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.&#xD;&#xA;&#xD;&#xA;DHDR Note: &#xD;&#xA;HNS: http://ehealthontario.ca/hns&#xD;&#xA;NMS: http://ehealthontario.ca/nms&#xD;&#xA;Pharmacy: http://ehealthontario.ca/pharmacy" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.contained">
      <path value="MedicationDispense.contained" />
      <min value="1" />
      <type>
        <code value="Resource" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Medication" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-MedicationRequest" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Patient-dispense" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Practitioner-prescriber" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Practitioner-dispenser" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Organization-dispenser" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.contained.id">
      <path value="MedicationDispense.contained.id" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.contained.meta">
      <path value="MedicationDispense.contained.meta" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.contained.meta.lastUpdated">
      <path value="MedicationDispense.contained.meta.lastUpdated" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.contained.meta.source">
      <path value="MedicationDispense.contained.meta.source" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.extension">
      <path value="MedicationDispense.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="MedicationDispense.extension:DispenseRemainingRefills">
      <path value="MedicationDispense.extension" />
      <sliceName value="DispenseRemainingRefills" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-ext-refills-remaining" />
      </type>
    </element>
    <element id="MedicationDispense.extension:DispenseRemainingQuantity">
      <path value="MedicationDispense.extension" />
      <sliceName value="DispenseRemainingQuantity" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-ext-quantity-remaining" />
      </type>
    </element>
    <element id="MedicationDispense.identifier">
      <path value="MedicationDispense.identifier" />
      <comment value="This is a business identifier, not a resource identifier.&#xD;&#xA;&#xD;&#xA;DHDR: Current Rx Number. Identifier assigned by the dispensing pharmacy." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.identifier.system">
      <path value="MedicationDispense.identifier.system" />
      <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique.&#xD;&#xA;&#xD;&#xA;DHDR: The namespace for the identifier value. This might be unknown for some dispenses that get loaded to DHDR from non-pharmacy feeds, e.g. ODB or NMS.&#xD;&#xA;&#xD;&#xA;e.g. &quot;[id-system-local-base]/ca-on-pharmacy-[Pharmacy ID]-rx-number&quot;" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.identifier.value">
      <path value="MedicationDispense.identifier.value" />
      <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system.&#xD;&#xA;&#xD;&#xA;DHDR: Current Rx Number (assigned by a pharmacy). The unique identifier of the data source record." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.status">
      <path value="MedicationDispense.status" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.category">
      <path value="MedicationDispense.category" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Dispense type, e.g. drug, device or pharmacy service" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/medicationdispensecategory" />
      </binding>
    </element>
    <element id="MedicationDispense.category.coding">
      <path value="MedicationDispense.category.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.category.coding.system">
      <path value="MedicationDispense.category.coding.system" />
      <min value="1" />
      <fixedUri value="http://ehealthontario.ca/fhir/NamingSystem/ca-on-medication-dispense-category" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.category.coding.code">
      <path value="MedicationDispense.category.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.category.coding.display">
      <path value="MedicationDispense.category.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.medication[x]">
      <path value="MedicationDispense.medication[x]" />
      <type>
        <code value="Reference" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.medication[x].reference">
      <path value="MedicationDispense.medication[x].reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.subject">
      <path value="MedicationDispense.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Patient-dispense" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.subject.reference">
      <path value="MedicationDispense.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer">
      <path value="MedicationDispense.performer" />
      <max value="2" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer.actor">
      <path value="MedicationDispense.performer.actor" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="reference" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer.actor:performerOrganization">
      <path value="MedicationDispense.performer.actor" />
      <sliceName value="performerOrganization" />
      <definition value="The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.&#xD;&#xA;&#xD;&#xA;DHDR: Dispensing Pharmacy" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Organization-dispenser" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer.actor:performerOrganization.reference">
      <path value="MedicationDispense.performer.actor.reference" />
      <min value="1" />
      <fixedString value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Organization-dispenser" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer.actor:performerPractitioner">
      <path value="MedicationDispense.performer.actor" />
      <sliceName value="performerPractitioner" />
      <definition value="The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.&#xD;&#xA;&#xD;&#xA;DHDR: Dispenser (Dispensing Pharmacist)" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Practitioner-dispenser" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer.actor:performerPractitioner.reference">
      <path value="MedicationDispense.performer.actor.reference" />
      <min value="1" />
      <fixedString value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-Practitioner-dispenser" />
    </element>
    <element id="MedicationDispense.authorizingPrescription">
      <path value="MedicationDispense.authorizingPrescription" />
      <definition value="Indicates the medication order that is being dispensed against.&#xD;&#xA;&#xD;&#xA;DHDR: Medication / pharmacy service order." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-medications-profile-MedicationRequest" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.authorizingPrescription.reference">
      <path value="MedicationDispense.authorizingPrescription.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.quantity">
      <path value="MedicationDispense.quantity" />
      <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.&#xD;&#xA;&#xD;&#xA;DHDR: Dispensed Quantity. Quantity of medication dispensed (dosage units or metric weights)." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.quantity.value">
      <path value="MedicationDispense.quantity.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.quantity.unit">
      <path value="MedicationDispense.quantity.unit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.quantity.system">
      <path value="MedicationDispense.quantity.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.quantity.code">
      <path value="MedicationDispense.quantity.code" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://tgateway.infoway-inforoute.ca/vs/prescribedquantityunit" />
      </binding>
    </element>
    <element id="MedicationDispense.daysSupply">
      <path value="MedicationDispense.daysSupply" />
      <definition value="The amount of medication expressed as a timing amount.&#xD;&#xA;&#xD;&#xA;DHDR:  Days’ Supply. Estimated number of days of treatment based on the directions for use on the prescription and the pharmacists judgment on usage" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.daysSupply.value">
      <path value="MedicationDispense.daysSupply.value" />
      <min value="1" />
    </element>
    <element id="MedicationDispense.whenPrepared">
      <path value="MedicationDispense.whenPrepared" />
      <definition value="The time when the dispensed product was packaged and reviewed.&#xD;&#xA;&#xD;&#xA;DHDR: Dispense Date. When product was packaged and reviewed." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.whenHandedOver">
      <path value="MedicationDispense.whenHandedOver" />
      <definition value="The time the dispensed product was provided to the patient or their representative.&#xD;&#xA;&#xD;&#xA;DHDR: Pickup Date. When product was given out (picked up by a patient or their representative)." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction">
      <path value="MedicationDispense.dosageInstruction" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.text">
      <path value="MedicationDispense.dosageInstruction.text" />
      <definition value="Free text dosage instructions e.g. SIG.&#xD;&#xA;&#xD;&#xA;DHDR: Dosage Specification. Free text dosage instructions." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.patientInstruction">
      <path value="MedicationDispense.dosageInstruction.patientInstruction" />
      <definition value="Instructions in terms that are understood by the patient or consumer.&#xD;&#xA;&#xD;&#xA;DHDR: Patient Dosage Instruction.  The instructions to the patient on how to take the medication (e.g. with food)" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing">
      <path value="MedicationDispense.dosageInstruction.timing" />
      <definition value="When medication should be administered.&#xD;&#xA;&#xD;&#xA;DHDR: Frequency. A timing schedule that specifies an event that may occur multiple times" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing.repeat">
      <path value="MedicationDispense.dosageInstruction.timing.repeat" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing.repeat.frequency">
      <path value="MedicationDispense.dosageInstruction.timing.repeat.frequency" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing.repeat.period">
      <path value="MedicationDispense.dosageInstruction.timing.repeat.period" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing.repeat.periodMax">
      <path value="MedicationDispense.dosageInstruction.timing.repeat.periodMax" />
      <definition value="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as &quot;do this once every 3-5 days.&#xD;&#xA;&#xD;&#xA;DHDR: The upper limit of the period.  This field is used when the dosage is a range, for example, every 4-6 hours." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing.repeat.periodUnit">
      <path value="MedicationDispense.dosageInstruction.timing.repeat.periodUnit" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/units-of-time|4.0.0" />
      </binding>
    </element>
    <element id="MedicationDispense.dosageInstruction.asNeeded[x]">
      <path value="MedicationDispense.dosageInstruction.asNeeded[x]" />
      <definition value="DHDR: PRN Indicator.  Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept)." />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.route">
      <path value="MedicationDispense.dosageInstruction.route" />
      <requirements value="Route. A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.route.coding">
      <path value="MedicationDispense.dosageInstruction.route.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" />
      </binding>
    </element>
    <element id="MedicationDispense.dosageInstruction.route.coding.system">
      <path value="MedicationDispense.dosageInstruction.route.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.route.coding.code">
      <path value="MedicationDispense.dosageInstruction.route.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.route.text">
      <path value="MedicationDispense.dosageInstruction.route.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate">
      <path value="MedicationDispense.dosageInstruction.doseAndRate" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.dose[x]">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.dose[x]" />
      <definition value="Dose. Amount of medication per dose." />
      <type>
        <code value="Quantity" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.dose[x].value">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.dose[x].value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.dose[x].unit">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.dose[x].unit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.dose[x].system">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.dose[x].system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.dose[x].code">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.dose[x].code" />
      <definition value="A computer processable form of the unit in some unit representation system.&#xD;&#xA;&#xD;&#xA;Subset Defining URL: https://tgateway.infoway-inforoute.ca/vs/prescriptiondosequantityunit" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescribedquantityunit" />
      </binding>
    </element>
  </differential>
</StructureDefinition>