<?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="Profile" type="Profile">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Profile">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</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 profile 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 profile 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 identifying the Profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Details of the individual or organization who accepts responsibility for publishing the profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="Contact">
            <xs:annotation>
              <xs:documentation>Contact details 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 profile and its use.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A set of terms from external terminologies that may be used to assist with indexing and searching of templates.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ResourceProfileStatus">
            <xs:annotation>
              <xs:documentation>The status of the profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>This profile 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 this version of the profile was published.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requirements" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The Scope and Usage that this profile was created to meet.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fhirVersion" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>The version of the FHIR specification on which this profile is based.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="Profile.Mapping" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An external specification that the content is mapped to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="structure" type="Profile.Structure" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A constraint statement about what contents a resource or data type may have.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="extensionDefn" type="Profile.ExtensionDefn" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An extension defined as part of the profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="query" type="Profile.Query" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Definition of a named query and its parameters and their meaning.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Mapping">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identity" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>An Internal id that is used to identify this mapping set when specific mappings are made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A URI that identifies the specification that this mapping is expressed to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A name for the specification that is being mapped to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comments" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Structure">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The Resource or Data type being described.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="publish" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>This definition of a profile on a structure is published as a formal statement. Some structural definitions might be defined purely for internal use within the profile, and not intended to be used outside that context.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human summary: why describe this resource?.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="element" type="Profile.Element" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Captures constraints on each element within the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="searchParam" type="Profile.SearchParam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Additional search parameters for implementations to support and/or make use of.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Element">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="path" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The path identifies the element and is expressed as a &quot;.&quot;-separated list of ancestor elements, beginning with the name of the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="representation" minOccurs="0" maxOccurs="unbounded" type="PropertyRepresentation">
            <xs:annotation>
              <xs:documentation>Codes that define how this element is represented in instances, when the deviation varies from the normal case.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of this element definition (to refer to it from other element definitions using Profile.structure.element.definition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="slicing" type="Profile.Slicing" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="definition" type="Profile.Definition" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Slicing">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="discriminator" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>Designates which child element is used to discriminate between the slices when processing an instance. The value of the child element in the instance SHALL completely distinguish which slice the element in the resource matches based on the allowed values for that element in each of the slices.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ordered" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If the matching elements have to occur in the same order as defined in the profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rules" minOccurs="1" maxOccurs="1" type="SlicingRules">
            <xs:annotation>
              <xs:documentation>Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Definition">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="short" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A concise definition that  is shown in the generated XML format that summarizes profiles (used throughout the specification).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="formal" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comments" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requirements" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Explains why this element is needed and why it's been constrained as it has.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="synonym" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Identifies additional names by which this element might also be known.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="min" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The minimum number of times this element SHALL appear in the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="max" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The maximum number of times this element is permitted to appear in the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" type="Profile.Type" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The data type or resource that the value of this element is permitted to be.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="nameReference" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Specifies a primitive value that SHALL hold for this element in the instance.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBoolean" type="boolean"/>
            <xs:element name="valueInteger" type="integer"/>
            <xs:element name="valueDecimal" type="decimal"/>
            <xs:element name="valueBase64Binary" type="base64Binary"/>
            <xs:element name="valueInstant" type="instant"/>
            <xs:element name="valueString" type="string"/>
            <xs:element name="valueUri" type="uri"/>
            <xs:element name="valueDate" type="date"/>
            <xs:element name="valueDateTime" type="dateTime"/>
            <xs:element name="valueCode" type="code"/>
            <xs:element name="valueOid" type="oid"/>
            <xs:element name="valueUuid" type="uuid"/>
            <xs:element name="valueId" type="id"/>
            <xs:element name="valueAttachment" type="Attachment"/>
            <xs:element name="valueIdentifier" type="Identifier"/>
            <xs:element name="valueCodeableConcept" type="CodeableConcept"/>
            <xs:element name="valueCoding" type="Coding"/>
            <xs:element name="valueQuantity" type="Quantity"/>
            <xs:element name="valueRange" type="Range"/>
            <xs:element name="valuePeriod" type="Period"/>
            <xs:element name="valueRatio" type="Ratio"/>
            <xs:element name="valueResource" type="ResourceReference"/>
            <xs:element name="valueSampledData" type="SampledData"/>
            <xs:element name="valueHumanName" type="HumanName"/>
            <xs:element name="valueAddress" type="Address"/>
            <xs:element name="valueContact" type="Contact"/>
            <xs:element name="valueSchedule" type="Schedule"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>An example value for this element.</xs:documentation>
            </xs:annotation>
            <xs:element name="exampleBoolean" type="boolean"/>
            <xs:element name="exampleInteger" type="integer"/>
            <xs:element name="exampleDecimal" type="decimal"/>
            <xs:element name="exampleBase64Binary" type="base64Binary"/>
            <xs:element name="exampleInstant" type="instant"/>
            <xs:element name="exampleString" type="string"/>
            <xs:element name="exampleUri" type="uri"/>
            <xs:element name="exampleDate" type="date"/>
            <xs:element name="exampleDateTime" type="dateTime"/>
            <xs:element name="exampleCode" type="code"/>
            <xs:element name="exampleOid" type="oid"/>
            <xs:element name="exampleUuid" type="uuid"/>
            <xs:element name="exampleId" type="id"/>
            <xs:element name="exampleAttachment" type="Attachment"/>
            <xs:element name="exampleIdentifier" type="Identifier"/>
            <xs:element name="exampleCodeableConcept" type="CodeableConcept"/>
            <xs:element name="exampleCoding" type="Coding"/>
            <xs:element name="exampleQuantity" type="Quantity"/>
            <xs:element name="exampleRange" type="Range"/>
            <xs:element name="examplePeriod" type="Period"/>
            <xs:element name="exampleRatio" type="Ratio"/>
            <xs:element name="exampleResource" type="ResourceReference"/>
            <xs:element name="exampleSampledData" type="SampledData"/>
            <xs:element name="exampleHumanName" type="HumanName"/>
            <xs:element name="exampleAddress" type="Address"/>
            <xs:element name="exampleContact" type="Contact"/>
            <xs:element name="exampleSchedule" type="Schedule"/>
          </xs:choice>
          <xs:element name="maxLength" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Indicates the shortest length that SHALL be supported by conformant instances without truncation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="id">
            <xs:annotation>
              <xs:documentation>A reference to an invariant that may make additional statements about the cardinality or value in the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="constraint" type="Profile.Constraint" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mustSupport" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element.  If false, the element may be ignored and not supported.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="isModifier" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="binding" type="Profile.Binding" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Binds to a value set if this element is coded (code, Coding, CodeableConcept).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="Profile.Mapping1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies a concept from an external specification that roughly corresponds to this element.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Type">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Name of Data type or Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Identifies a profile that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="aggregation" minOccurs="0" maxOccurs="unbounded" type="AggregationMode">
            <xs:annotation>
              <xs:documentation>If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Constraint">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="key" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Used to label the constraint in OCL or in short displays incapable of displaying the full human description.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="1" maxOccurs="1" type="ConstraintSeverity">
            <xs:annotation>
              <xs:documentation>Identifies the impact constraint violation has on the conformance of the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="human" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text that can be used to describe the constraint in messages identifying that the constraint has been violated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="xpath" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>XPath expression of constraint.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Binding">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A descriptive name for this - can be useful for generating implementation artifacts.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="isExtensible" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding.  If false, then conformant systems are constrained to the provided codes alone.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="conformance" minOccurs="0" maxOccurs="1" type="BindingConformance">
            <xs:annotation>
              <xs:documentation>Indicates the degree of conformance expectations associated with this binding.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Describes the intended use of this particular set of codes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Points to the value set or external definition that identifies the set of codes to be used.</xs:documentation>
            </xs:annotation>
            <xs:element name="referenceUri" type="uri"/>
            <xs:element name="referenceResource" type="ResourceReference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Mapping1">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identity" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>An internal reference to the definition of a mapping.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="map" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Expresses what part of the target specification corresponds to this element.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.SearchParam">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of the standard or custom search parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="SearchParamType">
            <xs:annotation>
              <xs:documentation>The type of value a search parameter refers to, and how the content is interpreted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A specification for search parameters. For standard parameters, provides additional information on how the parameter is used in this solution.  For custom parameters, provides a description of what the parameter does.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="xpath" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An XPath expression that returns a set of elements for the search parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="unbounded" type="code">
            <xs:annotation>
              <xs:documentation>Types of resource (if a resource is referenced).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.ExtensionDefn">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>A unique code (within the profile) used to identify the extension.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Defined so that applications can use this name when displaying the value of the extension to the user.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contextType" minOccurs="1" maxOccurs="1" type="ExtensionContext">
            <xs:annotation>
              <xs:documentation>Identifies the type of context to which the extension applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="1" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Identifies the types of resource or data type elements to which the extension can be applied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="definition" type="Profile.Definition" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Definition of the extension and its content.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Profile.Query">
    <xs:annotation>
      <xs:documentation>A Resource Profile - a statement of use of one or more FHIR Resources.  It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of a query, which is used in the URI from Conformance statements declaring use of the query.  Typically this will also be the name for the _query parameter when the query is called, though in some cases it may be aliased by a server to avoid collisions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Description of the query - the functionality it offers, and considerations about how it functions and to use it.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="parameter" type="Profile.SearchParam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A parameter of a named query.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="BindingConformance-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="required">
        <xs:annotation>
          <xs:documentation>Only codes in the specified set are allowed.  If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="preferred">
        <xs:annotation>
          <xs:documentation>For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="example">
        <xs:annotation>
          <xs:documentation>The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="BindingConformance">
    <xs:annotation>
      <xs:documentation>Binding conformance for applications</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="BindingConformance-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConstraintSeverity-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>If the constraint is violated, the resource is not conformant.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="warning">
        <xs:annotation>
          <xs:documentation>If the constraint is violated, the resource is conformant, but it is not necessarily following best practice.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConstraintSeverity">
    <xs:annotation>
      <xs:documentation>SHALL applications comply with this constraint?</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="ConstraintSeverity-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceProfileStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>This profile is still under development.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>This profile is ready for normal use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation>This profile has been deprecated, withdrawn or superseded and should no longer be used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResourceProfileStatus">
    <xs:annotation>
      <xs:documentation>The lifecycle status of a Resource Profile</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="ResourceProfileStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="PropertyRepresentation-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="xmlAttr">
        <xs:annotation>
          <xs:documentation>In XML, this property is represented as an attribute not an element.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="PropertyRepresentation">
    <xs:annotation>
      <xs:documentation>How a property is represented on the wire</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="PropertyRepresentation-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AggregationMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="contained">
        <xs:annotation>
          <xs:documentation>The reference is a local reference to a contained resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="referenced">
        <xs:annotation>
          <xs:documentation>The reference to to a resource that has to be resolved externally to the resource that includes the reference.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="bundled">
        <xs:annotation>
          <xs:documentation>The resource the reference points to will be found in the same bundle as the resource that includes the reference.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AggregationMode">
    <xs:annotation>
      <xs:documentation>How resource references can be aggregated</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="AggregationMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ExtensionContext-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="resource">
        <xs:annotation>
          <xs:documentation>The context is all elements matching a particular resource element path.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="datatype">
        <xs:annotation>
          <xs:documentation>The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mapping">
        <xs:annotation>
          <xs:documentation>The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure.  The context identifies the mapping target. The mapping should clearly identify where such an extension could be used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extension">
        <xs:annotation>
          <xs:documentation>The context is a particular extension from a particular profile.  Expressed as uri#name, where uri identifies the profile and #name identifies the extension code.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ExtensionContext">
    <xs:annotation>
      <xs:documentation>How an extension context is interpreted</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="ExtensionContext-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SlicingRules-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="closed">
        <xs:annotation>
          <xs:documentation>No additional content is allowed other than that described by the slices in this profile.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="open">
        <xs:annotation>
          <xs:documentation>Additional content is allowed anywhere in the list.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="openAtEnd">
        <xs:annotation>
          <xs:documentation>Additional content is allowed, but only at the end of the list.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SlicingRules">
    <xs:annotation>
      <xs:documentation>How slices are interpreted when evaluating an instance</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="SlicingRules-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
