<?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="Condition" type="Condition">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Condition">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</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>This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Indicates the patient who the condition record is associated with.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Encounter during which the condition was first asserted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="asserter" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Person who takes responsibility for asserting the existence of the condition as part of the electronic record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateAsserted" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Estimated or actual date the condition/problem/diagnosis was first detected/suspected.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identification of the condition, problem or diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ConditionStatus">
            <xs:annotation>
              <xs:documentation>The clinical status of the condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="certainty" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The degree of confidence that this condition is correct.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A subjective assessment of the severity of the condition as evaluated by the clinician.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Estimated or actual date the condition began, in the opinion of the clinician.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetDate" type="date"/>
            <xs:element name="onsetAge" type="Age"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The date or estimated date that the condition resolved or went into remission. This is called &quot;abatement&quot; because of the many overloaded connotations associated with &quot;remission&quot; or &quot;resolution&quot; - Conditions are never really resolved, but they can abate.</xs:documentation>
            </xs:annotation>
            <xs:element name="abatementDate" type="date"/>
            <xs:element name="abatementAge" type="Age"/>
            <xs:element name="abatementBoolean" type="boolean"/>
          </xs:choice>
          <xs:element name="stage" type="Condition.Stage" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Clinical stage or grade of a condition. May include formal severity assessments.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="evidence" type="Condition.Evidence" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" type="Condition.Location" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The anatomical location where this condition manifests itself.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relatedItem" type="Condition.RelatedItem" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Stage">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="summary" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A simple summary of the stage such as &quot;Stage 3&quot;. The determination of the stage is disease-specific.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="assessment" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Reference to a formal record of the evidence on which the staging assessment is based.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Evidence">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A manifestation or symptom that led to the recording of this condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Links to other relevant information, including pathology reports.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Location">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code that identifies the structural location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Detailed anatomical location information.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.RelatedItem">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ConditionRelationshipType">
            <xs:annotation>
              <xs:documentation>The type of relationship that this condition has to the related item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code that identifies the target of this relationship. The code takes the place of a detailed instance target.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Target of the relationship.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="provisional">
        <xs:annotation>
          <xs:documentation>This is a tentative diagnosis - still a candidate that is under consideration.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="working">
        <xs:annotation>
          <xs:documentation>The patient is being treated on the basis that this is the condition, but it is still not confirmed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation>There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation>This condition has been ruled out by diagnostic and clinical evidence.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionStatus">
    <xs:annotation>
      <xs:documentation>The clinical status of the Condition or diagnosis</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="ConditionStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionRelationshipType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="due-to">
        <xs:annotation>
          <xs:documentation>this condition follows the identified condition/procedure/substance and is a consequence of it.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="following">
        <xs:annotation>
          <xs:documentation>this condition follows the identified condition/procedure/substance, but it is not known whether they are causually linked.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionRelationshipType">
    <xs:annotation>
      <xs:documentation>The type of relationship between a condition and its related item</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="ConditionRelationshipType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
