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

<MedicationRequest xmlns="http://hl7.org/fhir">
  <id value="medrx0321"/>
  <contained>
    <Medication>
      <id value="med0307"/>
      <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>
  <identifier>
    <use value="official"/>
    <system value="http://www.bmc.nl/portal/prescriptions"/>
    <value value="12345689"/>
  </identifier>
  <status value="active"/>
  <intent value="order"/>
  <medication>
    <reference>
      <reference value="#med0307"/>
      <display value="NOVOLOG, 1 VIAL, GLASS in 1 CARTON (0169-7501-11) &gt; 10 mL in 1 VIAL, GLASS (package)"/>
    </reference>
  </medication>
  <subject>
    <!--  Linked to the resource patient who needs the medication  -->
    <reference value="Patient/pat1"/>
    <display value="Donald Duck"/>
  </subject>
  <authoredOn value="2015-01-15"/>
  <requester>
    <reference value="Practitioner/f007"/>
    <display value="Patrick Pump"/>
  </requester>
  <reason>
    <concept>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="44054006"/>
        <display value="Diabetes mellitus type 2 (disorder)"/>
      </coding>
    </concept>
  </reason>
  <note>
    <text value="Check blood sugar levels before taking insulin"/>
  </note>
  <dosageInstruction>
    <renderedInstruction value="Inject 10 units subcut 10 minutes before breakfast, 15 units before lunch, 20 units before dinner. Check blood sugar levels before taking insulin."/>
    <step>
      <component>
        <text value="inject 10 units subcut 10 minutes before breakfast"/>
        <timing>
          <repeat>
            <frequency value="1"/>
            <period value="1"/>
            <periodUnit value="d"/>
            <when value="ACM"/>
            <offset value="10"/>
          </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="Before Lunch"/>
        </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="Before Dinner"/>
        </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>
  <dispenseRequest>
    <validityPeriod>
      <start value="2015-01-15"/>
      <end value="2016-01-15"/>
    </validityPeriod>
    <numberOfRepeatsAllowed value="3"/>
    <quantity>
      <value value="10"/>
      <unit value="ml"/>
      <system value="http://unitsofmeasure.org"/>
      <code value="ml"/>
    </quantity>
    <expectedSupplyDuration>
      <value value="30"/>
      <unit value="days"/>
      <system value="http://unitsofmeasure.org"/>
      <code value="d"/>
    </expectedSupplyDuration>
  </dispenseRequest>
</MedicationRequest>