<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  © HL7 (http://www.hl7.org)
  Generated on Mon, May 14, 2012 09:48+1000 for FHIR v0.01 
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://www.hl7.org/fhir" elementFormDefault="qualified">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="Prescription" type="Prescription">
    <xs:annotation>
      <xs:documentation>todo</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Prescription">
    <xs:sequence>
      <xs:element name="id" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Master Resource Id, always first in all resources</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="id">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A identifier used in an external system and associated with this medication</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="HumanId">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="status" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Actual status of the prescription</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="PrescriptionStatus">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="patient" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The patient the prescription is prescribing medicine for</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="ResourceReference">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="prescriber" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The clinician or doctor prescribing the medication</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="ResourceReference">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="prescribed" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Date/time on which the prescription was written</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="dateTime">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="dispense" type="Prescription.Dispense" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Details of the dispense as requested by the prescriber</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="medicine" type="Prescription.Medicine" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The one single medicatine, vaccine or therapeutic good prescribed in this prescription.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="administrationRequest" type="Prescription.AdministrationRequest" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Instructions for the use of the medication. Includes details about the timing schedule, dosis amounts and additional usage instructions.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="reason" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Diagnosis which is the reason for prescribing this medicine</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="CodeableConcept">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="extensions" type="Extensions" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>See Extensions</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="text" type="Narrative" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Text summary of the prescription, for human interpretation</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Prescription.Dispense">
    <xs:sequence>
      <xs:element name="repeats" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Requested number of repeats</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="integer">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="quantity" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Requested quantity per repeat</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Quantity">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="dispenser" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Person to fullfil the requested dispense</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="ResourceReference">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Prescription.AdministrationRequest">
    <xs:sequence>
      <xs:element name="description" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Textual description of the use of the medication.</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="string">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="totalPeriodicDosis" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Total dose per day/week or other period when more specific information is missing or cannot be expressed using the timing specifications.</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Ratio">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="start" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>First moment on which medication should be taken</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="dateTime">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="end" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Last moment on which medication should be taken</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="dateTime">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="duration" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Total duration of administration</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Quantity">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="numberOfAdministrations" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Maximum number of separate administrations before the instruction ends.</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="integer">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="dosageInstruction" type="Prescription.DosageInstruction" minOccurs="1" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Specification of dose and schedule for administration</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Prescription.DosageInstruction">
    <xs:sequence>
      <xs:element name="precondition" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Precondition for starting the administration specified in this instruction</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="CodeableConcept">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="prn" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Pro re nate, &quot;If necessary&quot;: Specifies whether administration depens on the state and symptoms of the patient</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="BooleanYesNo">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="additionalInstruction" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Additional details to guide administration. Especially relevant for medicine administered by patient</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="CodeableConcept">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="route" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Route of administration (oral, nasal, intravenous)</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="CodeableConcept">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:choice minOccurs="1" maxOccurs="1" >
        <xs:annotation>
          <xs:documentation>Dose per administration, expressed in units of the (prepared) product</xs:documentation>
        </xs:annotation>
        <xs:element name="doseQuantity" >
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="Quantity">
                <xs:attributeGroup ref="dataAbsentReason"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="doseInterval" >
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="Interval_Quantity">
                <xs:attributeGroup ref="dataAbsentReason"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
      </xs:choice>
      <xs:element name="rate" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Flow-rate for IV</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Quantity">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="schedule" minOccurs="1" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Schedule for administration. If multiple are given, they are considered to be active in parrallel</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Schedule">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Prescription.Medicine">
    <xs:sequence>
      <xs:element name="productCode" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Coded representation of medicine</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Coding">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="description" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Textual description of medicine, including strength and ingredients</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="string">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="activeIngredient" type="Prescription.ActiveIngredient" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>The substance in the medication formulation that is pharmaceutically active and is responsible for the medication's therapeutic effect</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="inactiveIngredient" type="Prescription.InactiveIngredient" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Ingredients in the medication that are not active</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Prescription.InactiveIngredient">
    <xs:sequence>
      <xs:element name="productCode" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Coded representation of the inactive ingredient</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Coding">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="quantity" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Quantity of inactive ingredient expressed in relation to the whole of the prepared medicine</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Ratio">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Prescription.ActiveIngredient">
    <xs:sequence>
      <xs:element name="productCode" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Coded representation of active ingredient</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Coding">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="quantity" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Quantity of active ingredient expressed in relation to the whole of the prepared medicine</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Ratio">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PrescriptionStatus">
    <xs:simpleContent>
      <xs:restriction base="code">
        <xs:enumeration value="active">
          <xs:annotation>
            <xs:documentation>Patient is using the prescribed medicin</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="completed">
          <xs:annotation>
            <xs:documentation>Prescription is no longer current</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="BooleanYesNo">
    <xs:simpleContent>
      <xs:restriction base="code">
        <xs:enumeration value="yes">
          <xs:annotation>
            <xs:documentation>TRUE</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="no">
          <xs:annotation>
            <xs:documentation>FALSE</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
</xs:schema>
