<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ext-medicationorder-total-quantity" />
  <url value="http://telus.com/fhir/patientChart/StructureDefinition/ext-medicationorder-total-quantity" />
  <name value="ExtTotalPrescribedQuantity" />
  <title value="Ext-Total Prescribed Quantity" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <kind value="complex-type" />
  <abstract value="false" />
  <context>
    <type value="element" />
    <expression value="MedicationRequest.dispenseRequest" />
  </context>
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="http://telus.com/fhir/patientChart/StructureDefinition/ext-medicationorder-total-quantity" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <type>
        <code value="Quantity" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Extension.value[x].value">
      <path value="Extension.value[x].value" />
      <mustSupport value="true" />
    </element>
    <element id="Extension.value[x].unit">
      <path value="Extension.value[x].unit" />
      <mustSupport value="true" />
    </element>
    <element id="Extension.value[x].system">
      <path value="Extension.value[x].system" />
      <mustSupport value="true" />
    </element>
    <element id="Extension.value[x].code">
      <path value="Extension.value[x].code" />
      <comment value="Conformance Rule: A Code must be supplied if one is available from the PrescribedQuantityUnit subset. If the user picks a prescribed quantity unit that does not have a code in the PrescribedQuantityUnit subset, only then can unit be supplied without a code. If a receiving system receives a code that it doesn't recognize, the system must just display the unit.&#xD;&#xA;&#xD;&#xA;The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescribedquantityunit" />
      </binding>
    </element>
  </differential>
</StructureDefinition>