<?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="DiagnosticReport" type="DiagnosticReport">
    <xs:annotation>
      <xs:documentation>The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DiagnosticReport">
    <xs:annotation>
      <xs:documentation>The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports.</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="name" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code or name that describes this diagnostic report.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DiagnosticReportStatus">
            <xs:annotation>
              <xs:documentation>The status of the diagnostic report as a whole.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and/or time that this version of the report was released from the source diagnostic service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The diagnostic service that is responsible for issuing the report.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestDetail" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Details concerning a test requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>
            </xs:annotation>
            <xs:element name="diagnosticDateTime" type="dateTime"/>
            <xs:element name="diagnosticPeriod" type="Period"/>
          </xs:choice>
          <xs:element name="specimen" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Details about the specimens on which this Disagnostic report is based.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="result" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. &quot;atomic&quot; results), or they can be grouping observations that include references to other members of the group (e.g. &quot;panels&quot;).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="imagingStudy" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="image" type="DiagnosticReport.Image" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="conclusion" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Concise and clinically contextualized narrative interpretation of the diagnostic report.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="codedDiagnosis" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Codes for the conclusion.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="presentedForm" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DiagnosticReport.Image">
    <xs:annotation>
      <xs:documentation>The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="link" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Reference to the image source.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DiagnosticReportStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="registered">
        <xs:annotation>
          <xs:documentation>The existence of the report is registered, but there is nothing yet available.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="partial">
        <xs:annotation>
          <xs:documentation>This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation>The report is complete and verified by an authorized person.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="corrected">
        <xs:annotation>
          <xs:documentation>The report has been modified subsequent to being Final, and is complete and verified by an authorized person.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation>The report has been modified subsequent to being Final, and is complete and verified by an authorized person, and data has been changed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appended">
        <xs:annotation>
          <xs:documentation>The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The report is unavailable because the measurement was not started or not completed (also sometimes called &quot;aborted&quot;).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered in error">
        <xs:annotation>
          <xs:documentation>The report has been withdrawn following previous Final release.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DiagnosticReportStatus">
    <xs:annotation>
      <xs:documentation>The status of the diagnostic report as a whole</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="DiagnosticReportStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
