<?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="CarePlan" type="CarePlan">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CarePlan">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</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 care plan 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="patient" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the patient/subject whose intended care is described by the plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CarePlanStatus">
            <xs:annotation>
              <xs:documentation>Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Indicates when the plan did (or is intended to) come into effect and end.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Identifies the most recent date on which the plan has been revised.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concern" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="CarePlan.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="goal" type="CarePlan.Goal" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Describes the intended objective(s) of carrying out the Care Plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="activity" type="CarePlan.Activity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>General notes about the care plan not covered elsewhere.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Participant">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates specific responsibility of an individual within the care plan.  E.g. &quot;Primary physician&quot;, &quot;Team coordinator&quot;, &quot;Caregiver&quot;, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="member" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The specific person or organization who is participating/expected to participate in the care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Goal">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of a specific desired objective of the care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CarePlanGoalStatus">
            <xs:annotation>
              <xs:documentation>Indicates whether the goal has been reached and is still considered relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Any comments related to the goal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concern" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Activity">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="goal" type="xmlIdRef" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Internal reference that identifies the goals that this activity is intended to contribute towards meeting.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CarePlanActivityStatus">
            <xs:annotation>
              <xs:documentation>Identifies what progress is being made for the specific activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prohibited" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates that the described activity is one that must NOT be engaged in when following the plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actionResulting" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Notes about the execution of the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The details of the proposed activity represented in a specific resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="simple" type="CarePlan.Simple" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Simple">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CarePlanActivityCategory">
            <xs:annotation>
              <xs:documentation>High-level categorization of the type of activity in a care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Detailed description of the type of activity.  E.g. What lab test, what procedure, what kind of encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The period, timing or frequency upon which the described activity is to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingSchedule" type="Schedule"/>
            <xs:element name="timingPeriod" type="Period"/>
            <xs:element name="timingString" type="string"/>
          </xs:choice>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the facility where the activity will occur.  E.g. home, hospital, specific clinic, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies who's expected to be involved in the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="product" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Identifies the food, drug or other product being consumed or supplied in the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dailyAmount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>Identifies the quantity expected to be consumed in a given day.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>Identifies the quantity expected to be supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="details" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>This provides a textual description of constraints on the activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The plan is in development or awaiting use but is not yet intended to be acted upon.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The plan is intended to be followed and used as part of patient care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The plan is no longer in use and is not expected to be followed or used in patient care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.</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="CarePlanStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanActivityCategory-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="diet">
        <xs:annotation>
          <xs:documentation>Plan for the patient to consume food of a specified nature.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="drug">
        <xs:annotation>
          <xs:documentation>Plan for the patient to consume/receive a drug, vaccine or other product.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="encounter">
        <xs:annotation>
          <xs:documentation>Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="observation">
        <xs:annotation>
          <xs:documentation>Plan to capture information about a patient (vitals, labs, diagnostic images, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="procedure">
        <xs:annotation>
          <xs:documentation>Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="supply">
        <xs:annotation>
          <xs:documentation>Plan to provide something to the patient (medication, medical supply, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>Some other form of action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanActivityCategory">
    <xs:annotation>
      <xs:documentation>High-level categorization of the type of activity in a care plan.</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="CarePlanActivityCategory-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanGoalStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in progress">
        <xs:annotation>
          <xs:documentation>The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="achieved">
        <xs:annotation>
          <xs:documentation>The goal has been met and no further action is needed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sustaining">
        <xs:annotation>
          <xs:documentation>The goal has been met, but ongoing activity is needed to sustain the goal objective.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The goal is no longer being sought.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanGoalStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the goal has been met and is still being targeted</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="CarePlanGoalStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanActivityStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="not started">
        <xs:annotation>
          <xs:documentation>Activity is planned but no action has yet been taken.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="scheduled">
        <xs:annotation>
          <xs:documentation>Appointment or other booking has occurred but activity has not yet begun.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in progress">
        <xs:annotation>
          <xs:documentation>Activity has been started but is not yet complete.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on hold">
        <xs:annotation>
          <xs:documentation>Activity was started but has temporarily ceased with an expectation of resumption at a future time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The activities have been completed (more or less) as planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The activities have been ended prior to completion (perhaps even before they were started).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanActivityStatus">
    <xs:annotation>
      <xs:documentation>Indicates where the activity is at in its overall life cycle</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="CarePlanActivityStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
