<?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="Profile" type="Profile">
    <xs:annotation>
      <xs:documentation>todo</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Profile">
    <xs:sequence>
      <xs:element name="id" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Globally unique Profile Id (Must be a UUID)</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="name" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>A free text natural language name identifying the Template.</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="author" type="Profile.Author" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Details of the author who accepts responsibility for publishing the profile</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="intention" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>A free text natural language description of the intent and scope of the Template. The purpose is to provide the author’s initial intent for the Template in the language specified below.</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="code" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A set of terms from a controlled reference terminology that may be used to assist with indexing and searching of templates</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="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>A free text natural language description of the Template. Generally, this field should be used for things such as goals, variable lists, instructions for clinical use and interpretation, literature, examples from paper world, mapping from natural language to HL7 and the model itself, etc</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="evidence" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A description, reference or link to a published medical knowledge that was used in the definition of this Template</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="uri">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="comments" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>A statement regarding when this Template should not be used, or may be used erroneously. To define roles where the Template should not be used, or should be used with care. This field is used to expand in detail on the iIntention</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="status" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>draft | testing | production | withdrawn | superceded</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="ResourceProfileStatus">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="date" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The date that the current value for publicationStatus was applied to the Template</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="endorser" type="Profile.Endorser" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A list of bodies who have reviewed the Template for clinical accuracy and relevance, and endorsed it for use.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="changes" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>A free text description describing the changes in this version of the profile as compared to the previous version. </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="supercedes" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A template that is supercded by this template (maybe a  previous version)</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="uri">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="profile" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Additional other profiles that apply to this conformance statement.</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="uri">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="resource" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Resource Type with constraints</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="Constraint">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="binding" type="Profile.Binding" minOccurs="0" maxOccurs="unbounded">
      </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 resource profile for human interpretation</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Profile.Binding">
    <xs:sequence>
      <xs:element name="name" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The name of the concept domain that this profile is declaring a constraint on</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="type" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The form of the binding</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="ConceptBindingType">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="details" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>extra details - see notes</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="reference" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>source of binding content</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="uri">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
      <xs:element name="code" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>enumerated codes that are the binding</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:sequence>
  </xs:complexType>
  <xs:complexType name="Profile.Endorser">
    <xs:sequence>
      <xs:element name="name" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The name of the endorsing body</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="reference" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>Reference to the author to assist a user in finding and communicating with the endorsing body</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="uri">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Profile.Author">
    <xs:sequence>
      <xs:element name="name" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>The name of the author</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="reference" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Reference to the author to assist a user in finding and communicating with the author</xs:documentation>
        </xs:annotation>
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="uri">
               <xs:attributeGroup ref="dataAbsentReason"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ConceptBindingType">
    <xs:simpleContent>
      <xs:restriction base="code">
        <xs:enumeration value="Unbound">
          <xs:annotation>
            <xs:documentation>The concept domain is not bound to anything</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="CodeList">
          <xs:annotation>
            <xs:documentation>The concept domain is bound to a list of supplied codes - only those codes are allowed</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="Reference">
          <xs:annotation>
            <xs:documentation>The concept domain references some external definition by a provided reference</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="Preferred">
          <xs:annotation>
            <xs:documentation>The concept domain references a set of preferred terms</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="Suggestion">
          <xs:annotation>
            <xs:documentation>This profile was superceded by a more recent version</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="External">
          <xs:annotation>
            <xs:documentation>The concept domain is defined by an external authority identified in the reference</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="ResourceProfileStatus">
    <xs:simpleContent>
      <xs:restriction base="code">
        <xs:enumeration value="draft">
          <xs:annotation>
            <xs:documentation>This profile is still under development</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="testing">
          <xs:annotation>
            <xs:documentation>this profile was authored for testing purposes (or education/evaluation/evangelisation)</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="production">
          <xs:annotation>
            <xs:documentation>This profile is ready for use in production systems</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="withdrawn">
          <xs:annotation>
            <xs:documentation>This profile has been withdrawn</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="superceded">
          <xs:annotation>
            <xs:documentation>This profile was superceded by a more recent version</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
</xs:schema>
