<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  Copyright (c) 2011-2013, HL7, Inc.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without modification, 
  are permitted provided that the following conditions are met:
  
   * Redistributions of source code must retain the above copyright notice, this 
     list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice, 
     this list of conditions and the following disclaimer in the documentation 
     and/or other materials provided with the distribution.
   * Neither the name of HL7 nor the names of its contributors may be used to 
     endorse or promote products derived from this software without specific 
     prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
  POSSIBILITY OF SUCH DAMAGE.
  

  Generated on Tue, Sep 30, 2014 18:08+1000 for FHIR v0.0.82 
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="0.0.82">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="Composition" type="Composition">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Composition">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Resource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The composition editing time, when the composition was last logically changed by the author.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Official human-readable label for the composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CompositionStatus">
            <xs:annotation>
              <xs:documentation>The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="confidentiality" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The code specifying the level of confidentiality of the Composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="1" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies who is responsible for the information in the composition.  (Not necessarily who typed it in.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="attester" type="Composition.Attester" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A participant who has attested to the accuracy of the composition/document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="custodian" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="Composition.Event" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The main event/act/item, such as a colonoscopy or an appendectomy, being documented.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Describes the clinical encounter or type of care this documentation is associated with.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="section" type="Composition.Section" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The root of the sections that make up the composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Attester">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="unbounded" type="CompositionAttestationMode">
            <xs:annotation>
              <xs:documentation>The type of attestation the authenticator offers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="time" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When composition was attested by the party.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Who attested the composition in the specified way.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Event">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Full details for the event(s) the composition/documentation consents.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Section">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The heading for this particular section.  This will be part of the rendered content for the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code identifying the kind of content contained within the section.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the primary subject of the section.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the discrete data that provides the content for the section.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="section" type="Composition.Section" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A nested sub-section within this section.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompositionStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="preliminary">
        <xs:annotation>
          <xs:documentation>This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation>The composition or document is complete and verified by an appropriate person, and no further work is planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appended">
        <xs:annotation>
          <xs:documentation>The composition or document has been modified subsequent to being released as &quot;final&quot;, and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation>The composition or document has been modified subsequent to being released as &quot;final&quot;, and is complete and verified by an authorized person.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered in error">
        <xs:annotation>
          <xs:documentation>The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CompositionStatus">
    <xs:annotation>
      <xs:documentation>The workflow/clinical status of the composition</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="CompositionStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompositionAttestationMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="personal">
        <xs:annotation>
          <xs:documentation>The person authenticated the content in their personal capacity.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="professional">
        <xs:annotation>
          <xs:documentation>The person authenticated the content in their professional capacity.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="legal">
        <xs:annotation>
          <xs:documentation>The person authenticated the content and accepted legal responsibility for its content.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation>The organization authenticated the content as consistent with their policies and procedures.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CompositionAttestationMode">
    <xs:annotation>
      <xs:documentation>The way in which a person authenticated a composition</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="CompositionAttestationMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
