<!-- 
  Copyright (c) 2011+, 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 Wed, Apr 19, 2017 07:44+1000 for FHIR v3.0.1 

  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources
  valid. Implementers will still need to be familiar with the content of the specification and with
  any profiles that apply to the resources in order to make a conformant implementation.

-->
<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="1.0">
  <xs:include schemaLocation="fhir-base.xsd" />
  <xs:element name="Condition" type="Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">This records identifiers associated with this condition that are defined by business processes 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="clinicalStatus" minOccurs="0" maxOccurs="1" type="ConditionClinicalStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The clinical status of the condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="verificationStatus" minOccurs="0" maxOccurs="1" type="ConditionVerificationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The verification status to support the clinical status of the condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A category assigned to the condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A subjective assessment of the severity of the condition as evaluated by the clinician.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the condition, problem or diagnosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The anatomical location where this condition manifests itself.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the patient or group who the condition record is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Encounter during which the condition was first asserted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Estimated or actual date or date-time  the condition began, in the opinion of the clinician.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetDateTime" type="dateTime" />
            <xs:element name="onsetAge" type="Age" />
            <xs:element name="onsetPeriod" type="Period" />
            <xs:element name="onsetRange" type="Range" />
            <xs:element name="onsetString" type="string" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.</xs:documentation>
            </xs:annotation>
            <xs:element name="abatementDateTime" type="dateTime" />
            <xs:element name="abatementAge" type="Age" />
            <xs:element name="abatementBoolean" type="boolean" />
            <xs:element name="abatementPeriod" type="Period" />
            <xs:element name="abatementRange" type="Range" />
            <xs:element name="abatementString" type="string" />
          </xs:choice>
          <xs:element name="assertedDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the existance of the Condition was first asserted or acknowledged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="asserter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Individual who is making the condition statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stage" type="Condition.Stage" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</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 xml:lang="en">A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assessment" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</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 xml:lang="en">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="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links to other relevant information, including pathology reports.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionVerificationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="provisional">
        <xs:annotation>
          <xs:documentation xml:lang="en">Provisional</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="differential">
        <xs:annotation>
          <xs:documentation xml:lang="en">Differential</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Confirmed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Refuted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered In Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionVerificationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The verification status to support or decline the clinical status of the condition or diagnosis.</xs:documentation>
      <xs:documentation xml:lang="en">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="ConditionVerificationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionClinicalStatusCodes-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="recurrence">
        <xs:annotation>
          <xs:documentation xml:lang="en">Recurrence</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="remission">
        <xs:annotation>
          <xs:documentation xml:lang="en">Remission</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolved">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resolved</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionClinicalStatusCodes">
    <xs:annotation>
      <xs:documentation xml:lang="en">The clinical status of the condition or diagnosis.</xs:documentation>
      <xs:documentation xml:lang="en">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="ConditionClinicalStatusCodes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>