<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-DwMedicationRequest" />
  <url value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwMedicationRequest" />
  <version value="2.0.0" />
  <name value="DwMedicationRequest" />
  <status value="draft" />
  <date value="2026-05-29" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationRequest.id">
      <path value="MedicationRequest.id" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.meta">
      <path value="MedicationRequest.meta" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.meta.lastUpdated">
      <path value="MedicationRequest.meta.lastUpdated" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.meta.source">
      <path value="MedicationRequest.meta.source" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.meta.profile">
      <path value="MedicationRequest.meta.profile" />
      <comment value="Usage:  Each implementation project will determine if this will be supported.   It may be useful for validating message instances against this specific profile.&#xD;&#xA;&#xD;&#xA;It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set." />
    </element>
    <element id="MedicationRequest.meta.security">
      <path value="MedicationRequest.meta.security" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.text">
      <path value="MedicationRequest.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.contained">
      <path value="MedicationRequest.contained" />
      <max value="0" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.extension">
      <path value="MedicationRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.extension:DispenserInstructions">
      <path value="MedicationRequest.extension" />
      <sliceName value="DispenserInstructions" />
      <comment value="Alignment:  MedicationOrder.extension:pharmacyInstructions&#xD;&#xA;Usage Note:   If available, this should be included" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-DispenserInstructions" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.extension:NoRenewalsFlag">
      <path value="MedicationRequest.extension" />
      <sliceName value="NoRenewalsFlag" />
      <comment value="Alignment:  PrescribeIT:   MedicationOrder.extension:noRenewals" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-NoRenewalsFlag" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.extension:StatusChanged">
      <path value="MedicationRequest.extension" />
      <sliceName value="StatusChanged" />
      <definition value="The date (and perhaps time) when the status was changed." />
      <comment value="Usage Note:   This is a pre-adoption of an R5 data element,  and reflects the dateTime that the status was changed&#xD;&#xA;https://build.fhir.org/medicationrequest-definitions.html#MedicationRequest.statusChanged" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-MedicationRequest.statusChanged" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.extension:RenderedDosageInstruction">
      <path value="MedicationRequest.extension" />
      <sliceName value="RenderedDosageInstruction" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://prescribeit.ca/fhir/StructureDefinition/ext-rendered-dosage-instruction" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.identifier">
      <path value="MedicationRequest.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.identifier.system">
      <path value="MedicationRequest.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.identifier.value">
      <path value="MedicationRequest.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.status">
      <path value="MedicationRequest.status" />
      <comment value="Conformance Rule:   Sending systems should set all orders should be set to completed.  Rationale:   The status of an order should not change and therefore all internal prescriptions may be set to completed.&#xA;&#xA;This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.statusReason">
      <path value="MedicationRequest.statusReason" />
      <comment value="Usage Note:   When radio buttons are used, the status reason is be captured discretely." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.intent">
      <path value="MedicationRequest.intent" />
      <fixedCode value="order" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.category">
      <path value="MedicationRequest.category" />
      <comment value="Conformance Rule:   This should be populated if known" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptiontype" />
      </binding>
    </element>
    <element id="MedicationRequest.category.coding">
      <path value="MedicationRequest.category.coding" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptiontype" />
      </binding>
    </element>
    <element id="MedicationRequest.category.coding.system">
      <path value="MedicationRequest.category.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.category.coding.code">
      <path value="MedicationRequest.category.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.category.text">
      <path value="MedicationRequest.category.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.reported[x]">
      <path value="MedicationRequest.reported[x]" />
      <comment value="Conformance Rule:  The boolean is mandatory where known, the source resource must be included in the extension:InformationSource. In EMR's this may be derived from the &quot;external&quot; prescription indicator — consider it reported and set value = true." />
      <type>
        <code value="boolean" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.medication[x]">
      <path value="MedicationRequest.medication[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <comment value="Usage Note:  In cases where the medication Resource is not available, medication will be provided as a codeableConcept." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.medication[x]:medicationReference">
      <path value="MedicationRequest.medication[x]" />
      <sliceName value="medicationReference" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwMedication" />
      </type>
    </element>
    <element id="MedicationRequest.subject">
      <path value="MedicationRequest.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.subject.display">
      <path value="MedicationRequest.subject.display" />
      <comment value="Usage Note:   This should contain the name of the Patient, which can then be used in narrative" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.encounter">
      <path value="MedicationRequest.encounter" />
      <comment value="Usage Note:   This should be included if there is a definitive link to an encounter in the EMR." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwEncounter" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.supportingInformation">
      <path value="MedicationRequest.supportingInformation" />
      <comment value="Usage Rules:   This will be used to support the observations for weight, height, creatinine, eGFR." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwObservationVitals" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwObservation" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwObservationResults" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.supportingInformation.reference">
      <path value="MedicationRequest.supportingInformation.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.supportingInformation.display">
      <path value="MedicationRequest.supportingInformation.display" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.authoredOn">
      <path value="MedicationRequest.authoredOn" />
      <comment value="Conformance Rule:   In the context of &quot;order&quot; this is often the date when the prescription was originally written.  If this is an external prescription the date may not be known." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.requester">
      <path value="MedicationRequest.requester" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitioner" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitionerRole" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwOrganization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.requester.reference">
      <path value="MedicationRequest.requester.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.requester.display">
      <path value="MedicationRequest.requester.display" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.reasonCode">
      <path value="MedicationRequest.reasonCode" />
      <comment value="Conformance Rule: In the case where the prescriber wants to send an Indication for Use that is not included in the value set the prescriber must be able to send a text value without a code." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptionindicationforuse" />
      </binding>
    </element>
    <element id="MedicationRequest.reasonCode.coding">
      <path value="MedicationRequest.reasonCode.coding" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.reasonCode.coding.system">
      <path value="MedicationRequest.reasonCode.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.reasonCode.coding.code">
      <path value="MedicationRequest.reasonCode.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.reasonCode.text">
      <path value="MedicationRequest.reasonCode.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.basedOn">
      <path value="MedicationRequest.basedOn" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwCarePlan" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwMedicationRequest" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwServiceRequest" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.courseOfTherapyType">
      <path value="MedicationRequest.courseOfTherapyType" />
      <definition value="The description of the overall pattern of the administration of the medication to the patient." />
      <comment value="Usage Note:   This should be included where known&#xD;&#xA;Alignment:  PrescribeIT Mapping - Extension - TreatmentType" />
      <binding>
        <strength value="preferred" />
        <description value="Identifies the overall pattern of medication administration." />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptiontreatmentcategory" />
      </binding>
    </element>
    <element id="MedicationRequest.courseOfTherapyType.coding">
      <path value="MedicationRequest.courseOfTherapyType.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.courseOfTherapyType.coding.system">
      <path value="MedicationRequest.courseOfTherapyType.coding.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.courseOfTherapyType.coding.code">
      <path value="MedicationRequest.courseOfTherapyType.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.courseOfTherapyType.text">
      <path value="MedicationRequest.courseOfTherapyType.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.note">
      <path value="MedicationRequest.note" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.note.author[x]">
      <path value="MedicationRequest.note.author[x]" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.note.time">
      <path value="MedicationRequest.note.time" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction">
      <path value="MedicationRequest.dosageInstruction" />
      <comment value="Conformance Rules: if this is available in discrete form, this should be sent. This represents a single dosage line/instruction." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.extension:effectivePeriod">
      <path value="MedicationRequest.dosageInstruction.extension" />
      <sliceName value="effectivePeriod" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-EffectivePeriod" />
      </type>
    </element>
    <element id="MedicationRequest.dosageInstruction.sequence">
      <path value="MedicationRequest.dosageInstruction.sequence" />
      <comment value="Usage Rule:   This indicates the relationship between instruction lines." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.text">
      <path value="MedicationRequest.dosageInstruction.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.additionalInstruction">
      <path value="MedicationRequest.dosageInstruction.additionalInstruction" />
      <comment value="Usage Note: To convey explicit instructions to the Pharmacist/dispenser related to this medication order." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.additionalInstruction.coding">
      <path value="MedicationRequest.dosageInstruction.additionalInstruction.coding" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.additionalInstruction.coding.system">
      <path value="MedicationRequest.dosageInstruction.additionalInstruction.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.additionalInstruction.coding.code">
      <path value="MedicationRequest.dosageInstruction.additionalInstruction.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.additionalInstruction.text">
      <path value="MedicationRequest.dosageInstruction.additionalInstruction.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing">
      <path value="MedicationRequest.dosageInstruction.timing" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat">
      <path value="MedicationRequest.dosageInstruction.timing.repeat" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.bounds[x]">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.bounds[x]" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.count">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.count" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.countMax">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.countMax" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.duration">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.duration" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.durationMax">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.durationMax" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.durationUnit">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.durationUnit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.frequency">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.frequency" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.frequencyMax">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.frequencyMax" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.period">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.period" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.periodMax">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.periodMax" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.periodUnit">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.periodUnit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.asNeeded[x]">
      <path value="MedicationRequest.dosageInstruction.asNeeded[x]" />
      <comment value="Conformance Rule: This is ONLY populated when the medication is prescribed on an as needed (i.e. PRN) basis." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.site">
      <path value="MedicationRequest.dosageInstruction.site" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptionadministrationsite" />
      </binding>
    </element>
    <element id="MedicationRequest.dosageInstruction.site.coding">
      <path value="MedicationRequest.dosageInstruction.site.coding" />
      <code>
        <system value="http://snomed.info/sct" />
      </code>
      <code>
        <system value="http://terminology.hl7.org/CodeSystem/v3-ActSite" />
      </code>
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.site.coding.system">
      <path value="MedicationRequest.dosageInstruction.site.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.site.coding.code">
      <path value="MedicationRequest.dosageInstruction.site.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.site.text">
      <path value="MedicationRequest.dosageInstruction.site.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route">
      <path value="MedicationRequest.dosageInstruction.route" />
      <comment value="Conformance Rule: Coding should be populated if a code is available. However, text is always required." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/routeofadministration" />
      </binding>
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding">
      <path value="MedicationRequest.dosageInstruction.route.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeSCTCA">
      <path value="MedicationRequest.dosageInstruction.route.coding" />
      <sliceName value="routeSCTCA" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://snomed.info/sct" />
      </binding>
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeSCTCA.system">
      <path value="MedicationRequest.dosageInstruction.route.coding.system" />
      <min value="1" />
      <fixedUri value="http://snomed.info/sct" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeSCTCA.version">
      <path value="MedicationRequest.dosageInstruction.route.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeSCTCA.code">
      <path value="MedicationRequest.dosageInstruction.route.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeSCTCA.display">
      <path value="MedicationRequest.dosageInstruction.route.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeSCTCA.userSelected">
      <path value="MedicationRequest.dosageInstruction.route.coding.userSelected" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeEMRCode">
      <path value="MedicationRequest.dosageInstruction.route.coding" />
      <sliceName value="routeEMRCode" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeEMRCode.system">
      <path value="MedicationRequest.dosageInstruction.route.coding.system" />
      <min value="1" />
      <constraint>
        <key value="dw-medicationrequest-route-emrcode-system" />
        <severity value="warning" />
        <human value="EMR route coding system must follow pattern urn:telus:emr:{emrType}:{instanceId}:medication-route or urn:telus:emr:{emrType}:{region}:{instanceId}:medication-route" />
        <expression value="matches('urn:telus:emr:([^:]+:){2,3}medication-route')" />
        <source value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwMedicationRequest" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeEMRCode.code">
      <path value="MedicationRequest.dosageInstruction.route.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeEMRCode.display">
      <path value="MedicationRequest.dosageInstruction.route.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.coding:routeEMRCode.userSelected">
      <path value="MedicationRequest.dosageInstruction.route.coding.userSelected" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.route.text">
      <path value="MedicationRequest.dosageInstruction.route.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.doseAndRate">
      <path value="MedicationRequest.dosageInstruction.doseAndRate" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.doseAndRate.dose[x]">
      <path value="MedicationRequest.dosageInstruction.doseAndRate.dose[x]" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.value">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.value" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.unit">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.unit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.system">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.code">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.numerator.code" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptiondosequantityunit" />
      </binding>
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator.value">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator.value" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator.system">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator.system" />
      <fixedUri value="http://unitsofmeasure.org" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator.code">
      <path value="MedicationRequest.dosageInstruction.maxDosePerPeriod.denominator.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest">
      <path value="MedicationRequest.dispenseRequest" />
      <comment value="Usage Rule:   This will be mandatory for internally created prescriptions (source system is the reported source)." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.extension">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:TotalQuantity">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="TotalQuantity" />
      <comment value="Alignment Note:   PrescribeIT - MedicationOrder.dispenseRequest.extension:totalPrescribedQuantity" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-TotalQuantity" />
      </type>
    </element>
    <element id="MedicationRequest.dispenseRequest.extension:DispenseTrial">
      <path value="MedicationRequest.dispenseRequest.extension" />
      <sliceName value="DispenseTrial" />
      <comment value="Alignment:  PrescribeIT:   Maps to extension MedicationOrder.dispenseRequest.extension:trialEligibility" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/ext-DispenseTrial" />
      </type>
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill">
      <path value="MedicationRequest.dispenseRequest.initialFill" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescribedquantityunit" />
      </binding>
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.value">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.unit">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.unit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.system">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.quantity.code">
      <path value="MedicationRequest.dispenseRequest.initialFill.quantity.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.duration">
      <path value="MedicationRequest.dispenseRequest.initialFill.duration" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.duration.value">
      <path value="MedicationRequest.dispenseRequest.initialFill.duration.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.duration.unit">
      <path value="MedicationRequest.dispenseRequest.initialFill.duration.unit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.duration.system">
      <path value="MedicationRequest.dispenseRequest.initialFill.duration.system" />
      <fixedUri value="http://unitsofmeasure.org" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.initialFill.duration.code">
      <path value="MedicationRequest.dispenseRequest.initialFill.duration.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.value">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.value" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.system">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.dispenseInterval.code">
      <path value="MedicationRequest.dispenseRequest.dispenseInterval.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod">
      <path value="MedicationRequest.dispenseRequest.validityPeriod" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod.start">
      <path value="MedicationRequest.dispenseRequest.validityPeriod.start" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.validityPeriod.end">
      <path value="MedicationRequest.dispenseRequest.validityPeriod.end" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.numberOfRepeatsAllowed">
      <path value="MedicationRequest.dispenseRequest.numberOfRepeatsAllowed" />
      <comment value="Conformance Rule: This must be populated when the number of repeats is 1 or more. As this field only allows a positive integer, this is not populated if there are no refills allowed." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.quantity">
      <path value="MedicationRequest.dispenseRequest.quantity" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.quantity.value">
      <path value="MedicationRequest.dispenseRequest.quantity.value" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.quantity.unit">
      <path value="MedicationRequest.dispenseRequest.quantity.unit" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.quantity.system">
      <path value="MedicationRequest.dispenseRequest.quantity.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.quantity.code">
      <path value="MedicationRequest.dispenseRequest.quantity.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.expectedSupplyDuration">
      <path value="MedicationRequest.dispenseRequest.expectedSupplyDuration" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.expectedSupplyDuration.value">
      <path value="MedicationRequest.dispenseRequest.expectedSupplyDuration.value" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.expectedSupplyDuration.unit">
      <path value="MedicationRequest.dispenseRequest.expectedSupplyDuration.unit" />
      <fixedString value="days" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.expectedSupplyDuration.system">
      <path value="MedicationRequest.dispenseRequest.expectedSupplyDuration.system" />
      <min value="1" />
      <fixedUri value="http://unitsofmeasure.org" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.expectedSupplyDuration.code">
      <path value="MedicationRequest.dispenseRequest.expectedSupplyDuration.code" />
      <fixedCode value="d" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.performer">
      <path value="MedicationRequest.dispenseRequest.performer" />
      <comment value="Usage Note:  The pharmacy should be included when known." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwOrganization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.dispenseRequest.performer.display">
      <path value="MedicationRequest.dispenseRequest.performer.display" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution">
      <path value="MedicationRequest.substitution" />
      <comment value="Conformance Rule:   This MUST be included when the prescriber specifies &quot;no substitution&quot; (boolean = false)" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.allowed[x]">
      <path value="MedicationRequest.substitution.allowed[x]" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.reason">
      <path value="MedicationRequest.substitution.reason" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.reason.coding">
      <path value="MedicationRequest.substitution.reason.coding" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.reason.coding.system">
      <path value="MedicationRequest.substitution.reason.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.reason.coding.code">
      <path value="MedicationRequest.substitution.reason.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.substitution.reason.text">
      <path value="MedicationRequest.substitution.reason.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.priorPrescription">
      <path value="MedicationRequest.priorPrescription" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwMedicationRequest" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.detectedIssue">
      <path value="MedicationRequest.detectedIssue" />
      <comment value="Conformance Rule:  Detected Issue will be used to convey managed drug interactions.   If available, this must be sent." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationRequest.detectedIssue.display">
      <path value="MedicationRequest.detectedIssue.display" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>