<?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="Media" type="Media">
    <xs:annotation>
      <xs:documentation>A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Media">
    <xs:annotation>
      <xs:documentation>A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</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="type" minOccurs="1" maxOccurs="1" type="MediaType">
            <xs:annotation>
              <xs:documentation>Whether the media is a photo (still image), an audio recording, or a video recording.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subtype" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Who/What this Media is a record of.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="operator" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The person who administered the collection of the image.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="view" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The name of the imaging view e.g Lateral or Antero-posterior (AP).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="deviceName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of the device / manufacturer of the device  that was used to make the recording.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="height" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Height of the image in pixels(photo/video).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="width" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Width of the image in pixels (photo/video).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="frames" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="length" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The length of the recording in seconds - for audio and video.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation>The actual content of the media - inline or by direct reference to the media source file.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MediaType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="photo">
        <xs:annotation>
          <xs:documentation>The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="video">
        <xs:annotation>
          <xs:documentation>The media consists of a series of frames that capture a moving image.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="audio">
        <xs:annotation>
          <xs:documentation>The media consists of a sound recording.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MediaType">
    <xs:annotation>
      <xs:documentation>Whether the Media is a photo, video, or audio</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="MediaType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
