<?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="Patient" type="Patient">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Patient">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</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>An identifier that applies to this person as a patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="Contact">
            <xs:annotation>
              <xs:documentation>A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and time of birth for the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Indicates if the individual is deceased or not.</xs:documentation>
            </xs:annotation>
            <xs:element name="deceasedBoolean" type="boolean"/>
            <xs:element name="deceasedDateTime" type="dateTime"/>
          </xs:choice>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation>Addresses for the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maritalStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This field contains a patient's most recent marital (civil) status.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Indicates whether the patient is part of a multiple or indicates the actual birth order.</xs:documentation>
            </xs:annotation>
            <xs:element name="multipleBirthBoolean" type="boolean"/>
            <xs:element name="multipleBirthInteger" type="integer"/>
          </xs:choice>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Image of the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="Patient.Contact" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A contact party (e.g. guardian, partner, friend) for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="animal" type="Patient.Animal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>This element has a value if the patient is an animal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="communication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Languages which may be used to communicate with the patient about his or her health.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careProvider" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Patient's nominated care provider.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Organization that is the custodian of the patient record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Patient.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Link to another patient resource that concerns the same actual person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether this patient record is in active use.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Contact">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="relationship" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The nature of the relationship between the patient and the contact person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="Contact">
            <xs:annotation>
              <xs:documentation>A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation>Address for the contact person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Organization on behalf of which the contact is acting or for which the contact is working.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Animal">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="species" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the high level categorization of the kind of animal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="breed" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the detailed categorization of the kind of animal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="genderStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the current state of the animal's reproductive organs.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Link">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="other" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The other patient resource that the link refers to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="LinkType">
            <xs:annotation>
              <xs:documentation>The type of link between this patient resource and another patient resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LinkType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="replace">
        <xs:annotation>
          <xs:documentation>The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refer">
        <xs:annotation>
          <xs:documentation>The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="seealso">
        <xs:annotation>
          <xs:documentation>The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LinkType">
    <xs:annotation>
      <xs:documentation>The type of link between this patient resource and another patient resource.</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="LinkType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
