<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="MedicationDispense" />
  <meta>
    <lastUpdated value="2019-11-01T09:29:23.356+11:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Clinical.Medications" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="2" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="patient" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="phx" />
  </extension>
  <url value="https://fhir.kemkes.go.id/r4/StructureDefinition/MedicationDispense" />
  <version value="4.0.1" />
  <name value="MedicationDispense" />
  <status value="draft" />
  <date value="2022-07-08T15:10:50.6856647+00:00" />
  <publisher value="Health Level Seven International (Pharmacy)" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://hl7.org/fhir" />
    </telecom>
  </contact>
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://www.hl7.org/Special/committees/medication/index.cfm" />
    </telecom>
  </contact>
  <description value="Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </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="rx-dispense-rmim" />
    <uri value="http://www.hl7.org/v3/PORX_RM020070UV" />
    <name value="V3 Pharmacy Dispense RMIM" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationDispense" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
  <derivation value="specialization" />
  <differential>
    <element id="MedicationDispense">
      <path value="MedicationDispense" />
      <short value="Dispensing a medication to a named patient" />
      <definition value="Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order." />
      <constraint>
        <key value="mdd-1" />
        <severity value="error" />
        <human value="whenHandedOver cannot be before whenPrepared" />
        <expression value="whenHandedOver.empty() or whenPrepared.empty() or whenHandedOver &gt;= whenPrepared" />
        <xpath value="not(exists(f:whenHandedOver/@value)) or not(exists(f:whenPrepared/@value)) or ( f:whenHandedOver/@value &gt;= f:whenPrepared/@value)" />
        <source value="http://hl7.org/fhir/StructureDefinition/MedicationDispense" />
      </constraint>
      <mapping>
        <identity value="workflow" />
        <map value="Event" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Supply[moodCode=EVN]" />
      </mapping>
    </element>
    <element id="MedicationDispense.identifier">
      <path value="MedicationDispense.identifier" />
      <short value="External identifier" />
      <definition value="Identifiers associated with this Medication Dispense that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server." />
      <comment value="This is a business identifier, not a resource identifier." />
      <type>
        <code value="Identifier" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.identifier" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".id" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.id" />
      </mapping>
    </element>
    <element id="MedicationDispense.partOf">
      <path value="MedicationDispense.partOf" />
      <short value="Event that dispense is part of" />
      <definition value="The procedure that trigger the dispense." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.partOf" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=COMP]/target[classCode=PROC,moodCode=EVN]" />
      </mapping>
    </element>
    <element id="MedicationDispense.status">
      <path value="MedicationDispense.status" />
      <short value="preparation | in-progress | cancelled | on-hold | completed | entered-in-error | stopped | declined | unknown" />
      <definition value="A code specifying the state of the set of dispense events." />
      <comment value="This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <isModifier value="true" />
      <isModifierReason value="This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationDispenseStatus" />
        </extension>
        <strength value="required" />
        <description value="A coded concept specifying the state of the dispense event." />
        <valueSet value="http://hl7.org/fhir/ValueSet/medicationdispense-status|4.0.1" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.status" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.status" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".statusCode" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.statusCode" />
      </mapping>
    </element>
    <element id="MedicationDispense.statusReason[x]">
      <path value="MedicationDispense.statusReason[x]" />
      <short value="Why a dispense was not performed" />
      <definition value="Indicates the reason why a dispense was not performed." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DetectedIssue" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationDispenseStatusReason" />
        </extension>
        <strength value="example" />
        <description value="A code describing why a dispense was not performed." />
        <valueSet value="http://hl7.org/fhir/ValueSet/medicationdispense-status-reason" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.statusReason" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=&quot;not done reason&quot;].value" />
      </mapping>
    </element>
    <element id="MedicationDispense.category">
      <path value="MedicationDispense.category" />
      <short value="Type of medication dispense" />
      <definition value="Indicates the type of medication dispense (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient))." />
      <comment value="The category can be used to include where the medication is expected to be consumed or other types of dispenses.  Invariants can be used to bind to different value sets when profiling to bind." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationDispenseCategory" />
        </extension>
        <strength value="preferred" />
        <description value="A code describing where the dispensed medication is expected to be consumed or administered." />
        <valueSet value="http://hl7.org/fhir/ValueSet/medicationdispense-category" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=&quot;type of medication dispense&quot;].value" />
      </mapping>
    </element>
    <element id="MedicationDispense.medication[x]">
      <path value="MedicationDispense.medication[x]" />
      <short value="What medication was supplied" />
      <definition value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." />
      <comment value="If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example, if you require form or lot number, then you must reference the Medication resource." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Medication" />
      </type>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationCode" />
        </extension>
        <strength value="example" />
        <description value="A coded concept identifying which substance or product can be dispensed." />
        <valueSet value="http://hl7.org/fhir/ValueSet/medication-codes" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.code" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.what[x]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="RXD-2-Dispense/Give Code" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=PRD].role" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationRequest.component1.AdministrationRequest.consumable" />
      </mapping>
    </element>
    <element id="MedicationDispense.subject">
      <path value="MedicationDispense.subject" />
      <short value="Who the dispense is for" />
      <definition value="A link to a resource representing the person or the group to whom the medication will be given." />
      <comment value="SubstanceAdministration-&gt;subject-&gt;Patient." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.subject" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.subject[x]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PID-3-Patient ID List" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=SBJ].role[classCode=PAT]" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.subject" />
      </mapping>
    </element>
    <element id="MedicationDispense.context">
      <path value="MedicationDispense.context" />
      <short value="Encounter / Episode associated with event" />
      <definition value="The encounter or episode of care that establishes the context for this event." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.context" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code=&quot;type of encounter or episode&quot;]" />
      </mapping>
    </element>
    <element id="MedicationDispense.supportingInformation">
      <path value="MedicationDispense.supportingInformation" />
      <short value="Information that supports the dispensing of the medication" />
      <definition value="Additional information that supports the medication being dispensed." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
      </type>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.context" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=PERT].target[A_SupportingClinicalStatement CMET minimal with many different choices of classCodes(ORG, ENC, PROC, SPLY, SBADM, OBS) and each of the act class codes draws from one or more of the following moodCodes (EVN, DEF, INT PRMS, RQO, PRP, APT, ARQ, GOL)]" />
      </mapping>
    </element>
    <element id="MedicationDispense.performer">
      <path value="MedicationDispense.performer" />
      <short value="Who performed event" />
      <definition value="Indicates who or what performed the event." />
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=PRF]" />
      </mapping>
    </element>
    <element id="MedicationDispense.performer.function">
      <path value="MedicationDispense.performer.function" />
      <short value="Who performed the dispense and what they did" />
      <definition value="Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker." />
      <requirements value="Allows disambiguation of the types of involvement of different performers." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationDispensePerformerFunction" />
        </extension>
        <strength value="example" />
        <description value="A code describing the role an individual played in dispensing a medication." />
        <valueSet value="http://hl7.org/fhir/ValueSet/medicationdispense-performer-function" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="participation[typeCode=PRF].functionCode" />
      </mapping>
    </element>
    <element id="MedicationDispense.performer.actor">
      <path value="MedicationDispense.performer.actor" />
      <short value="Individual who was performing" />
      <definition value="The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.actor" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".role" />
      </mapping>
    </element>
    <element id="MedicationDispense.location">
      <path value="MedicationDispense.location" />
      <short value="Where the dispense occurred" />
      <definition value="The principal physical location where the dispense was performed." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=LOC].role" />
      </mapping>
    </element>
    <element id="MedicationDispense.authorizingPrescription">
      <path value="MedicationDispense.authorizingPrescription" />
      <short value="Medication order that authorizes the dispense" />
      <definition value="Indicates the medication order that is being dispensed against." />
      <comment value="Maps to basedOn in Event logical model." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.basedOn" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="ORC-2 Placer Order Number" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=FLFS].target[moodCode=RQO]" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.inFulfillmentOf" />
      </mapping>
    </element>
    <element id="MedicationDispense.type">
      <path value="MedicationDispense.type" />
      <short value="Trial fill, partial fill, emergency fill, etc." />
      <definition value="Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationDispenseType" />
        </extension>
        <strength value="example" />
        <description value="Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-ActPharmacySupplyType" />
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="RXD-33-Dispense Type" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".code" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.code" />
      </mapping>
    </element>
    <element id="MedicationDispense.quantity">
      <path value="MedicationDispense.quantity" />
      <short value="Amount dispensed" />
      <definition value="The amount of medication that has been dispensed. Includes unit of measure." />
      <max value="1" />
      <type>
        <code value="Quantity" />
        <profile value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
      </type>
      <mapping>
        <identity value="v2" />
        <map value="RXD-4-Actual Dispense Amount / RXD-5.1-Actual Dispense Units.code / RXD-5.3-Actual Dispense Units.name of coding system" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".quantity" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.quantity" />
      </mapping>
    </element>
    <element id="MedicationDispense.daysSupply">
      <path value="MedicationDispense.daysSupply" />
      <short value="Amount of medication expressed as a timing amount" />
      <definition value="The amount of medication expressed as a timing amount." />
      <max value="1" />
      <type>
        <code value="Quantity" />
        <profile value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
      </type>
      <mapping>
        <identity value="v2" />
        <map value="TQ1.6 Timing/Quantity Segment Service Duration.&#xD;Prior to v2.5, ORC.7.3 Common Order Segment / Quantity/Timing / Duration component.  This is a formatted string, first character for the time unit (e.g., D=days), followed by the value.  For example, “D14” represents “14 days supply”&#xD;From v2.5 on, TQ1.6 Timing/Quantity Segment / Service Duration.  This is a CQ data type (&lt;Quantity (NM)&gt; ^ &lt;Units (CWE)&gt;), thus for days supply, assuming the unit of measure is “days”, the numeric value is TQ1.6.1 (…|14^&#xD;For backwards compatibility, ORC.7 was permitted through v2.6.  Both forms (field and segment) may be present in v2.5, v2.5.1, and v2.6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="effectiveUseTime" />
      </mapping>
    </element>
    <element id="MedicationDispense.whenPrepared">
      <path value="MedicationDispense.whenPrepared" />
      <short value="When product was packaged and reviewed" />
      <definition value="The time when the dispensed product was packaged and reviewed." />
      <max value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="RXD-3-Date/Time Dispensed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime[xmi:type=IVL_TS].low" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.effectiveTime" />
      </mapping>
    </element>
    <element id="MedicationDispense.whenHandedOver">
      <path value="MedicationDispense.whenHandedOver" />
      <short value="When product was given out" />
      <definition value="The time the dispensed product was provided to the patient or their representative." />
      <max value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.occurrence[x]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="RXD-3-Date/Time Dispensed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime[xmi:type=IVL_TS].high" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.effectiveTime" />
      </mapping>
    </element>
    <element id="MedicationDispense.destination">
      <path value="MedicationDispense.destination" />
      <short value="Where the medication was sent" />
      <definition value="Identification of the facility/location where the medication was shipped to, as part of the dispense event." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
      <mapping>
        <identity value="v2" />
        <map value="RXD-13 Dispense-to Location; RXD-30 Dispense to Pharmacy; RXD-31 Dispense to Pharmacy Address" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=DST].role" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.destination" />
      </mapping>
    </element>
    <element id="MedicationDispense.receiver">
      <path value="MedicationDispense.receiver" />
      <short value="Who collected the medication" />
      <definition value="Identifies the person who picked up the medication.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=RCV].role" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.SupplyEvent.receiver" />
      </mapping>
    </element>
    <element id="MedicationDispense.note">
      <path value="MedicationDispense.note" />
      <short value="Information about the dispense" />
      <definition value="Extra information about the dispense that could not be conveyed in the other attributes." />
      <type>
        <code value="Annotation" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.note" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="RXD-9 Dispense Notes" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=SUBJ]/source[classCode=ACT,moodCode=EVN]" />
      </mapping>
    </element>
    <element id="MedicationDispense.dosageInstruction">
      <path value="MedicationDispense.dosageInstruction" />
      <short value="How the medication is to be used by the patient or administered by the caregiver" />
      <definition value="Indicates how the medication is to be used by the patient." />
      <comment value="When the dose or rate is intended to change over the entire administration period (e.g. Tapering dose prescriptions), multiple instances of dosage instructions will need to be supplied to convey the different doses/rates.&#xD;The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed." />
      <type>
        <code value="Dosage" />
      </type>
    </element>
    <element id="MedicationDispense.substitution">
      <path value="MedicationDispense.substitution" />
      <short value="Whether a substitution was performed on the dispense" />
      <definition value="Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done." />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=COMP].target[classCode=SUBST, moodCode=EVN]" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.substitutionMade" />
      </mapping>
    </element>
    <element id="MedicationDispense.substitution.wasSubstituted">
      <path value="MedicationDispense.substitution.wasSubstituted" />
      <short value="Whether a substitution was or was not performed on the dispense" />
      <definition value="True if the dispenser dispensed a different drug or product from what was prescribed." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="boolean" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".actionNegationInd" />
      </mapping>
    </element>
    <element id="MedicationDispense.substitution.type">
      <path value="MedicationDispense.substitution.type" />
      <short value="Code signifying whether a different drug was dispensed from what was prescribed" />
      <definition value="A code signifying whether a different drug was dispensed from what was prescribed." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationIntendedSubstitutionType" />
        </extension>
        <strength value="example" />
        <description value="A coded concept describing whether a different medicinal product may be dispensed other than the product as specified exactly in the prescription." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-ActSubstanceAdminSubstitutionCode" />
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="RXO-9-Allow Substitutions / RXE-9-Substitution Status" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".code" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.substitutionMade.code" />
      </mapping>
    </element>
    <element id="MedicationDispense.substitution.reason">
      <path value="MedicationDispense.substitution.reason" />
      <short value="Why was substitution made" />
      <definition value="Indicates the reason for the substitution (or lack of substitution) from what was prescribed." />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MedicationIntendedSubstitutionReason" />
        </extension>
        <strength value="example" />
        <description value="A coded concept describing the reason that a different medication should (or should not) be substituted from what was prescribed." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-SubstanceAdminSubstitutionReason" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".reasonCode" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.substitutionMade.reasonCode" />
      </mapping>
    </element>
    <element id="MedicationDispense.substitution.responsibleParty">
      <path value="MedicationDispense.substitution.responsibleParty" />
      <short value="Who is responsible for the substitution" />
      <definition value="The person or organization that has primary responsibility for the substitution." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=PFM].role[classCode=ASSIGN]" />
      </mapping>
      <mapping>
        <identity value="rx-dispense-rmim" />
        <map value="CombinedMedicationDispense.substitutionMade.ResponsibleParty" />
      </mapping>
    </element>
    <element id="MedicationDispense.detectedIssue">
      <path value="MedicationDispense.detectedIssue" />
      <short value="Clinical issue with action" />
      <definition value="Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. drug-drug interaction, duplicate therapy, dosage alert etc." />
      <comment value="This element can include a detected issue that has been identified either by a decision support system or by a clinician and may include information on the steps that were taken to address the issue." />
      <alias value="Contraindication" />
      <alias value="Drug Utilization Review (DUR)" />
      <alias value="Alert" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DetectedIssue" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=SUBJ]/source[classCode=ALRT,moodCode=EVN].value" />
      </mapping>
    </element>
    <element id="MedicationDispense.eventHistory">
      <path value="MedicationDispense.eventHistory" />
      <short value="A list of relevant lifecycle events" />
      <definition value="A summary of the events of interest that have occurred, such as when the dispense was verified." />
      <comment value="This might not include provenances for all versions of the request – only those deemed “relevant” or important. This SHALL NOT include the Provenance associated with this current version of the resource. (If that provenance is deemed to be a “relevant” change, it will need to be added as part of a later update. Until then, it can be queried directly as the Provenance that points to this version using _revinclude All Provenances should have some historical version of this Request as their subject.)." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Provenance" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship(typeCode=SUBJ].source[classCode=CACT, moodCode=EVN]" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>