<?xml version="1.0" encoding="UTF-8"?>

<MedicationDispense xmlns="http://hl7.org/fhir">
  <id value="meddisp0302"/>
  <contained>
    <Medication>
      <id value="med0360"/>
      <code>
        <coding>
          <system value="http://hl7.org/fhir/sid/ndc"/>
          <code value="0169-7501-11"/>
          <display value="NOVOLOG, 1 VIAL, GLASS in 1 CARTON (0169-7501-11) &gt; 10 mL in 1 VIAL, GLASS (package)"/>
        </coding>
        <text value="Novolog 100u/ml"/>
      </code>
      <doseForm>
        <coding>
          <system value="http://snomed.info/sct"/>
          <code value="385219001"/>
          <display value="Solution for injection"/>
        </coding>
      </doseForm>
      <ingredient>
        <item>
          <concept>
            <coding>
              <system value="http://snomed.info/sct"/>
              <code value="325072002"/>
              <display value="Insulin Aspart (substance)"/>
            </coding>
          </concept>
        </item>
        <strengthRatio>
          <numerator>
            <value value="100"/>
            <system value="http://unitsofmeasure.org"/>
            <code value="U"/>
          </numerator>
          <denominator>
            <value value="1"/>
            <system value="http://unitsofmeasure.org"/>
            <code value="mL"/>
          </denominator>
        </strengthRatio>
      </ingredient>
    </Medication>
  </contained>
  <status value="in-progress"/>
  <medication>
    <reference>
      <reference value="#med0360"/>
      <display value="NOVOLOG, 1 VIAL, GLASS in 1 CARTON (0169-7501-11) &gt; 10 mL in 1 VIAL, GLASS (package)"/>
    </reference>
  </medication>
  <subject>
    <reference value="Patient/pat1"/>
    <display value="Donald Duck"/>
  </subject>
  <performer>
    <function>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/medicationdispense-performer-function"/>
        <code value="finalchecker"/>
        <display value="Final Checker"/>
      </coding>
    </function>
    <actor>
      <reference value="Practitioner/f006"/>
    </actor>
  </performer>
  <authorizingPrescription>
    <reference value="MedicationRequest/medrx0321"/>
  </authorizingPrescription>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
      <code value="RFP"/>
      <display value="Refill - Part Fill"/>
    </coding>
  </type>
  <quantity>
    <value value="10"/>
    <system value="http://unitsofmeasure.org"/>
    <code value="ml"/>
  </quantity>
  <daysSupply>
    <value value="30"/>
    <unit value="Day"/>
    <system value="http://unitsofmeasure.org"/>
    <code value="d"/>
  </daysSupply>
  <whenPrepared value="2015-01-15T10:20:00Z"/>
  <whenHandedOver value="2015-01-15T16:20:00Z"/>
  <dosageInstruction>
    <renderedInstruction value="Inject 10 units subcut 10 minutes before breakfast, 15 units before lunch, 20 units before dinner. Check sugar level before taking Novolog."/>
    <step>
      <component>
        <text value="Before Breakfast"/>
        <additionalInstruction>
          <text value="Check sugar level before taking Novolog"/>
        </additionalInstruction>
        <timing>
          <repeat>
            <frequency value="1"/>
            <period value="1"/>
            <periodUnit value="d"/>
          </repeat>
        </timing>
        <doseAndRate>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
              <code value="ordered"/>
              <display value="Ordered"/>
            </coding>
          </type>
          <doseQuantity>
            <value value="10"/>
            <unit value="U"/>
            <system value="http://unitsofmeasure.org"/>
            <code value="U"/>
          </doseQuantity>
        </doseAndRate>
      </component>
      <component>
        <text value="15 units before lunch"/>
        <additionalInstruction>
          <text value="Check sugar level before taking Novolog"/>
        </additionalInstruction>
        <timing>
          <repeat>
            <frequency value="1"/>
            <period value="1"/>
            <periodUnit value="d"/>
          </repeat>
        </timing>
        <doseAndRate>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
              <code value="ordered"/>
              <display value="Ordered"/>
            </coding>
          </type>
          <doseQuantity>
            <value value="15"/>
            <unit value="U"/>
            <system value="http://unitsofmeasure.org"/>
            <code value="U"/>
          </doseQuantity>
        </doseAndRate>
      </component>
      <component>
        <text value="20 units before dinner"/>
        <additionalInstruction>
          <text value="Check sugar level before taking Novolog"/>
        </additionalInstruction>
        <timing>
          <repeat>
            <frequency value="1"/>
            <period value="1"/>
            <periodUnit value="d"/>
          </repeat>
        </timing>
        <doseAndRate>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/dose-rate-type"/>
              <code value="ordered"/>
              <display value="Ordered"/>
            </coding>
          </type>
          <doseQuantity>
            <value value="20"/>
            <unit value="U"/>
            <system value="http://unitsofmeasure.org"/>
            <code value="U"/>
          </doseQuantity>
        </doseAndRate>
      </component>
    </step>
  </dosageInstruction>
</MedicationDispense>