<?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="List" type="List">
    <xs:annotation>
      <xs:documentation>A set of information summarized from a list of other resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="List">
    <xs:annotation>
      <xs:documentation>A set of information summarized from a list of other resources.</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="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier for the List assigned for business purposes outside the context of FHIR.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This code defines the purpose of the list - why it was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The common subject (or patient) of the resources that are in the list, if there is one.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The entity responsible for deciding what the contents of the list were.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date that the list was prepared.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ordered" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether items in the list have a meaningful order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="ListMode">
            <xs:annotation>
              <xs:documentation>How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="entry" type="List.Entry" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Entries in this list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="emptyReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>If the list is empty, why the list is empty.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="List.Entry">
    <xs:annotation>
      <xs:documentation>A set of information summarized from a list of other resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="flag" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="deleted" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>True if this item is marked as deleted in the list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this item was added to the list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>A reference to the actual resource from which data was derived.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ListMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="working">
        <xs:annotation>
          <xs:documentation>This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="snapshot">
        <xs:annotation>
          <xs:documentation>This list was prepared as a snapshot. It should not be assumed to be current.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="changes">
        <xs:annotation>
          <xs:documentation>The list is prepared as a statement of changes that have been made or recommended.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ListMode">
    <xs:annotation>
      <xs:documentation>The processing mode that applies to this list</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="ListMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
