<?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="Procedure" type="Procedure">
    <xs:annotation>
      <xs:documentation>An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Procedure">
    <xs:annotation>
      <xs:documentation>An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy.</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 procedure 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>The person on whom the procedure was performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" type="Procedure.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Limited to 'real' people rather than equipment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The dates over which the procedure was performed. Allows a period to support complex procedures that span more that one date, and also allows for the length of the procedure to be captured.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The encounter during which the procedure was performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="report" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="complication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="followUp" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relatedItem" type="Procedure.RelatedItem" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Any other notes about the procedure - e.g. the operative notes.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Procedure.Performer">
    <xs:annotation>
      <xs:documentation>An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The practitioner who was involved in the procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>E.g. surgeon, anaethetist, endoscopist.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Procedure.RelatedItem">
    <xs:annotation>
      <xs:documentation>An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="ProcedureRelationshipType">
            <xs:annotation>
              <xs:documentation>The nature of the relationship.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The related item - e.g. a procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ProcedureRelationshipType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="caused-by">
        <xs:annotation>
          <xs:documentation>This procedure had to be performed because of the related one.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="because-of">
        <xs:annotation>
          <xs:documentation>This procedure caused the related one to be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ProcedureRelationshipType">
    <xs:annotation>
      <xs:documentation>The nature of the relationship with this procedure</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="ProcedureRelationshipType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
