<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="UKCore-MedicationDispense" />
  <url value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense" />
  <version value="2.4.0" />
  <name value="UKCoreMedicationDispense" />
  <title value="UK Core Medication Dispense" />
  <status value="active" />
  <date value="2024-07-11" />
  <publisher value="HL7 UK" />
  <contact>
    <name value="HL7 UK" />
    <telecom>
      <system value="email" />
      <value value="ukcore@hl7.org.uk" />
      <use value="work" />
      <rank value="1" />
    </telecom>
  </contact>
  <description value="This profile defines the UK constraints and extensions on the International FHIR resource [MedicationDispense](https://hl7.org/fhir/R4/MedicationDispense.html)." />
  <purpose value="This profile covers the supply of medications to a patient. Examples include dispensing and pick-up from an outpatient or community pharmacy, dispensing patient-specific medications from inpatient pharmacy to ward, as well as issuing a single dose from ward stock to a patient for consumption. The medication dispense is the result of a pharmacy system responding to a medication order." />
  <copyright value="Copyright © 2021+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at  https://www.hl7.org/fhir/license.html." />
  <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.identifier">
      <path value="MedicationDispense.identifier" />
      <short value="Allows the resource to be referenced within / by other resources." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.status">
      <path value="MedicationDispense.status" />
      <short value="A code that describes the status of the dispensing event." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.medication[x]">
      <path value="MedicationDispense.medication[x]" />
      <short value="What medication was supplied." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationCode" />
      </binding>
    </element>
    <element id="MedicationDispense.subject">
      <path value="MedicationDispense.subject" />
      <short value="Identifies the patient." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.performer">
      <path value="MedicationDispense.performer" />
      <short value="Who or what performed the dispensing event." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.type">
      <path value="MedicationDispense.type" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationSupplyType" />
      </binding>
    </element>
    <element id="MedicationDispense.quantity">
      <path value="MedicationDispense.quantity" />
      <short value="Quantity of medication dispensed." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.whenPrepared">
      <path value="MedicationDispense.whenPrepared" />
      <short value="Timestamp for when the medication was prepared." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction">
      <path value="MedicationDispense.dosageInstruction" />
      <short value="Dosage instruction for the dispensed medication." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.text">
      <path value="MedicationDispense.dosageInstruction.text" />
      <short value="Free text dosage instructions." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.timing">
      <path value="MedicationDispense.dosageInstruction.timing" />
      <short value="When medication should be administered." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.asNeeded[x]">
      <path value="MedicationDispense.dosageInstruction.asNeeded[x]" />
      <binding>
        <strength value="preferred" />
      </binding>
    </element>
    <element id="MedicationDispense.dosageInstruction.site">
      <path value="MedicationDispense.dosageInstruction.site" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-BodySite" />
      </binding>
    </element>
    <element id="MedicationDispense.dosageInstruction.route">
      <path value="MedicationDispense.dosageInstruction.route" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-SubstanceOrProductAdministrationRoute" />
      </binding>
    </element>
    <element id="MedicationDispense.dosageInstruction.method">
      <path value="MedicationDispense.dosageInstruction.method" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-MedicationDosageMethod" />
      </binding>
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate">
      <path value="MedicationDispense.dosageInstruction.doseAndRate" />
      <short value="Dosage instructions for the medication." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.dose[x]">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.dose[x]" />
      <short value="Quantity of medication administered." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationDispense.dosageInstruction.doseAndRate.rate[x]">
      <path value="MedicationDispense.dosageInstruction.doseAndRate.rate[x]" />
      <short value="Rate at which the medication is to be administered." />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>