<?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="ConceptMap" type="ConceptMap">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concept systems.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ConceptMap">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concept systems.</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="1" type="string">
            <xs:annotation>
              <xs:documentation>The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A free text natural language name describing the concept map.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of the individual or organization that published the concept map.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="Contact">
            <xs:annotation>
              <xs:documentation>Contacts of the publisher to assist a user in finding and communicating with the publisher.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A copyright statement relating to the concept map and/or its contents.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ValueSetStatus">
            <xs:annotation>
              <xs:documentation>The status of the concept map.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date that the concept map status was last changed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The source value set that specifies the concepts that are being mapped.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="ConceptMap.Concept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Mappings for a concept from the source valueset.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Concept">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concept systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="system" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>System that defines the concept being mapped.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Identifies concept being mapped.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dependsOn" type="ConceptMap.DependsOn" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="map" type="ConceptMap.Map" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A concept from the target value set that this concept maps to.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.DependsOn">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concept systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="concept" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="system" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>System for a concept in the referenced concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Code for a concept in the referenced concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Map">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concept systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="system" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>System of the target.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Code that identifies the target concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="equivalence" minOccurs="1" maxOccurs="1" type="ConceptMapEquivalence">
            <xs:annotation>
              <xs:documentation>equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comments" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Description of status/issues in mapping.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="product" type="ConceptMap.DependsOn" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A set of additional outcomes from this mapping to other value sets. To properly execute this mapping, the specified value set must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConceptMapEquivalence-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="equal">
        <xs:annotation>
          <xs:documentation>The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="equivalent">
        <xs:annotation>
          <xs:documentation>The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="wider">
        <xs:annotation>
          <xs:documentation>The target mapping is wider in meaning than the source concept.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="subsumes">
        <xs:annotation>
          <xs:documentation>The target mapping subsumes the meaning of the source concept (e.g. the source is-a target).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="narrower">
        <xs:annotation>
          <xs:documentation>The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="specialises">
        <xs:annotation>
          <xs:documentation>The target mapping specialises the meaning of the source concept (e.g. the target is-a source).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inexact">
        <xs:annotation>
          <xs:documentation>The target mapping overlaps with the source concept, but both source and target cover additional meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unmatched">
        <xs:annotation>
          <xs:documentation>There is no match for this concept in the destination concept system.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="disjoint">
        <xs:annotation>
          <xs:documentation>This is an explicit assertion that there is no mapping between the source and target concept.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConceptMapEquivalence">
    <xs:annotation>
      <xs:documentation>The degree of equivalence between concepts</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="ConceptMapEquivalence-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
