<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  Copyright (c) 2011+, 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 Sat, Feb 14, 2015 16:12-0500 for FHIR v0.4.0 
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="0.4.0">
  <!-- Note: When using this schema with some tools, it may also be necessary to declare xmlns:xml="http://www.w3.org/XML/1998/namespace", however this causes performance issues with other tools and thus is not in the base schemas. -->
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
  <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="fhir-xhtml.xsd"/>

  <xs:simpleType name="integer-primitive">
    <xs:restriction base="xs:int"/>
  </xs:simpleType>
  <xs:complexType name="integer">
    <xs:annotation>
      <xs:documentation>A whole number</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="integer-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="dateTime-primitive">
    <xs:restriction>
      <xs:simpleType>
        <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date xs:dateTime"/>
      </xs:simpleType>
      <xs:pattern value="-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)?)?)?"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="dateTime">
    <xs:annotation>
      <xs:documentation>A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds may be provided but may also be ignored.  Dates SHALL be valid dates.</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="dateTime-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="code-primitive">
    <xs:restriction base="xs:token">
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="code">
    <xs:annotation>
      <xs:documentation>A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="code-primitive"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="date-primitive">
    <xs:restriction>
      <xs:simpleType>
        <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date"/>
      </xs:simpleType>
      <xs:pattern value="-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="date">
    <xs:annotation>
      <xs:documentation>A date, or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.</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="date-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="decimal-primitive">
    <xs:restriction base="xs:decimal"/>
  </xs:simpleType>
  <xs:complexType name="decimal">
    <xs:annotation>
      <xs:documentation>A rational number with implicit precision</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="decimal-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="uri-primitive">
    <xs:restriction base="xs:anyURI"/>
  </xs:simpleType>
  <xs:complexType name="uri">
    <xs:annotation>
      <xs:documentation>String of characters used to identify a name or a resource</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="uri-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="id-primitive">
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Za-z0-9\-\.]{1,64}"/>
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="id">
    <xs:annotation>
      <xs:documentation>Any combination of lowercase letters, numerals, &quot;-&quot; and &quot;.&quot;, with a length limit of 36 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Systems SHALL send ids as lower-case but SHOULD interpret them case-insensitively.</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="id-primitive"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="base64Binary-primitive">
    <xs:restriction base="xs:base64Binary"/>
  </xs:simpleType>
  <xs:complexType name="base64Binary">
    <xs:annotation>
      <xs:documentation>A stream of bytes</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="base64Binary-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="time-primitive">
    <xs:restriction base="xs:time">
      <xs:pattern value="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="time">
    <xs:annotation>
      <xs:documentation>A time during the day, with no date specified</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="time-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="oid-primitive">
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="urn:oid:(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*"/>
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="oid">
    <xs:annotation>
      <xs:documentation>An oid represented as a URI</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="oid-primitive"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="string-primitive">
    <xs:restriction base="xs:string">
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="string">
    <xs:annotation>
      <xs:documentation>A sequence of Unicode characters</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="string-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="boolean-primitive">
    <xs:restriction base="xs:boolean"/>
  </xs:simpleType>
  <xs:complexType name="boolean">
    <xs:annotation>
      <xs:documentation>Value of &quot;true&quot; or &quot;false&quot;</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="boolean-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="uuid-primitive">
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"/>
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="uuid">
    <xs:annotation>
      <xs:documentation>A UUID, represented as a URI</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="uuid-primitive"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="instant-primitive">
    <xs:restriction base="xs:dateTime"/>
  </xs:simpleType>
  <xs:complexType name="instant">
    <xs:annotation>
      <xs:documentation>An instant in time - known at least to the second</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="instant-primitive" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ResourceContainer">
    <xs:choice>
      <xs:element ref="Alert"/>
      <xs:element ref="AllergyIntolerance"/>
      <xs:element ref="Appointment"/>
      <xs:element ref="AppointmentResponse"/>
      <xs:element ref="Basic"/>
      <xs:element ref="Binary"/>
      <xs:element ref="BodySite"/>
      <xs:element ref="Bundle"/>
      <xs:element ref="CarePlan"/>
      <xs:element ref="CarePlan2"/>
      <xs:element ref="ClaimResponse"/>
      <xs:element ref="ClinicalAssessment"/>
      <xs:element ref="Communication"/>
      <xs:element ref="CommunicationRequest"/>
      <xs:element ref="Composition"/>
      <xs:element ref="ConceptMap"/>
      <xs:element ref="Condition"/>
      <xs:element ref="Conformance"/>
      <xs:element ref="Contract"/>
      <xs:element ref="Contraindication"/>
      <xs:element ref="Coverage"/>
      <xs:element ref="DataElement"/>
      <xs:element ref="Device"/>
      <xs:element ref="DeviceComponent"/>
      <xs:element ref="DeviceMetric"/>
      <xs:element ref="DeviceUseRequest"/>
      <xs:element ref="DeviceUseStatement"/>
      <xs:element ref="DiagnosticOrder"/>
      <xs:element ref="DiagnosticReport"/>
      <xs:element ref="DocumentManifest"/>
      <xs:element ref="DocumentReference"/>
      <xs:element ref="EligibilityRequest"/>
      <xs:element ref="EligibilityResponse"/>
      <xs:element ref="Encounter"/>
      <xs:element ref="EnrollmentRequest"/>
      <xs:element ref="EnrollmentResponse"/>
      <xs:element ref="EpisodeOfCare"/>
      <xs:element ref="ExplanationOfBenefit"/>
      <xs:element ref="ExtensionDefinition"/>
      <xs:element ref="FamilyHistory"/>
      <xs:element ref="Goal"/>
      <xs:element ref="Group"/>
      <xs:element ref="HealthcareService"/>
      <xs:element ref="ImagingObjectSelection"/>
      <xs:element ref="ImagingStudy"/>
      <xs:element ref="Immunization"/>
      <xs:element ref="ImmunizationRecommendation"/>
      <xs:element ref="InstitutionalClaim"/>
      <xs:element ref="List"/>
      <xs:element ref="Location"/>
      <xs:element ref="Media"/>
      <xs:element ref="Medication"/>
      <xs:element ref="MedicationAdministration"/>
      <xs:element ref="MedicationDispense"/>
      <xs:element ref="MedicationPrescription"/>
      <xs:element ref="MedicationStatement"/>
      <xs:element ref="MessageHeader"/>
      <xs:element ref="NamingSystem"/>
      <xs:element ref="NutritionOrder"/>
      <xs:element ref="Observation"/>
      <xs:element ref="OperationDefinition"/>
      <xs:element ref="OperationOutcome"/>
      <xs:element ref="OralHealthClaim"/>
      <xs:element ref="Order"/>
      <xs:element ref="OrderResponse"/>
      <xs:element ref="Organization"/>
      <xs:element ref="Other"/>
      <xs:element ref="Patient"/>
      <xs:element ref="PaymentNotice"/>
      <xs:element ref="PaymentReconciliation"/>
      <xs:element ref="PendedRequest"/>
      <xs:element ref="Person"/>
      <xs:element ref="PharmacyClaim"/>
      <xs:element ref="Practitioner"/>
      <xs:element ref="Procedure"/>
      <xs:element ref="ProcedureRequest"/>
      <xs:element ref="ProfessionalClaim"/>
      <xs:element ref="Profile"/>
      <xs:element ref="Provenance"/>
      <xs:element ref="Questionnaire"/>
      <xs:element ref="QuestionnaireAnswers"/>
      <xs:element ref="Readjudicate"/>
      <xs:element ref="ReferralRequest"/>
      <xs:element ref="RelatedPerson"/>
      <xs:element ref="Reversal"/>
      <xs:element ref="RiskAssessment"/>
      <xs:element ref="Schedule"/>
      <xs:element ref="SearchParameter"/>
      <xs:element ref="SecurityEvent"/>
      <xs:element ref="Slot"/>
      <xs:element ref="Specimen"/>
      <xs:element ref="StatusRequest"/>
      <xs:element ref="StatusResponse"/>
      <xs:element ref="StructureDefinition"/>
      <xs:element ref="Subscription"/>
      <xs:element ref="Substance"/>
      <xs:element ref="Supply"/>
      <xs:element ref="SupportingDocumentation"/>
      <xs:element ref="ValueSet"/>
      <xs:element ref="VisionClaim"/>
      <xs:element ref="VisionPrescription"/>
      <xs:element ref="Parameters"/>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="Extension">
    <xs:annotation>
      <xs:documentation>Optional Extensions Element - found in all resources.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="1">
           <xs:annotation>
             <xs:documentation>Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).</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="valueTime" type="time"/>
           <xs:element name="valueCode" type="code"/>
           <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="valueReference" type="Reference"/>
           <xs:element name="valueSampledData" type="SampledData"/>
           <xs:element name="valueHumanName" type="HumanName"/>
           <xs:element name="valueAddress" type="Address"/>
           <xs:element name="valueContactPoint" type="ContactPoint"/>
           <xs:element name="valueTiming" type="Timing"/>
           <xs:element name="valueMeta" type="Meta"/>
          </xs:choice>
        </xs:sequence>
        <xs:attribute name="url" type="uri-primitive" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="BackboneElement">
    <xs:annotation>
      <xs:documentation>Base definition for all elements that are defined inside a resource - but not those in a data type.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="modifierExtension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Element">
    <xs:annotation>
      <xs:documentation>Base definition for all elements in a resource.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
        <xs:sequence>
          <xs:element name="extension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="id-primitive" use="optional"/>
  </xs:complexType>
  <xs:complexType name="Narrative">
    <xs:annotation>
      <xs:documentation>A human-readable formatted text, including images.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="status" type="NarrativeStatus" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element ref="xhtml:div" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The actual narrative content, a stripped down version of XHTML.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NarrativeStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="generated">
        <xs:annotation>
          <xs:documentation>The contents of the narrative are entirely generated from the structured data in the resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extensions">
        <xs:annotation>
          <xs:documentation>The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="additional">
        <xs:annotation>
          <xs:documentation>The contents of the narrative contain additional information not found in the structured data.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="empty">
        <xs:annotation>
          <xs:documentation>the contents of the narrative are some equivalent of &quot;No human-readable text provided for this resource&quot;.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NarrativeStatus">
    <xs:annotation>
      <xs:documentation>The status of a resource narrative</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="NarrativeStatus-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Period">
    <xs:annotation>
      <xs:documentation>A time period defined by a start and end date and optionally time.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="start" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The start of the period. The boundary is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The end of the period. If the end of the period is missing, it means that the period is ongoing.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Coding">
    <xs:annotation>
      <xs:documentation>A reference to a code defined by a terminology system.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the code system that defines the meaning of the symbol in the code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A representation of the meaning of the code in the system, following the rules of the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="primary" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valueSet" type="Reference" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The set of possible coded values this coding was chosen from or constrained by.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Range">
    <xs:annotation>
      <xs:documentation>A set of ordered Quantities defined by a low and high limit.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="low" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The low limit. The boundary is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="high" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The high limit. The boundary is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Quantity">
    <xs:annotation>
      <xs:documentation>A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable form of the units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A computer processable form of the units in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="QuantityComparator-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="&lt;">
        <xs:annotation>
          <xs:documentation>The actual value is less than the given value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="&lt;=">
        <xs:annotation>
          <xs:documentation>The actual value is less than or equal to the given value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="&gt;=">
        <xs:annotation>
          <xs:documentation>The actual value is greater than or equal to the given value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="&gt;">
        <xs:annotation>
          <xs:documentation>The actual value is greater than the given value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="QuantityComparator">
    <xs:annotation>
      <xs:documentation>How the Quantity should be understood and represented</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="QuantityComparator-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Attachment">
    <xs:annotation>
      <xs:documentation>For referring to data content defined in other formats.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="contentType" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The human language of the content. The value can be any valid value according to BCP 47.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="data" type="base64Binary" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The actual data of the attachment - a sequence of bytes. In XML, represented using base64.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>An alternative location where the data can be accessed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="size" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The number of bytes of data that make up this attachment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hash" type="base64Binary" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The calculated hash of the data using SHA-1. Represented using base64.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A label or set of text to display in place of the data.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Ratio">
    <xs:annotation>
      <xs:documentation>A relationship of two Quantity values - expressed as a numerator and a denominator.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="numerator" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the numerator.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="denominator" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the denominator.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SampledData">
    <xs:annotation>
      <xs:documentation>A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="origin" type="Quantity" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="decimal" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The length of time between sampling times, measured in milliseconds.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A correction factor that is applied to the sampled data points before they are added to the origin.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lowerLimit" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The lower limit of detection of the measured points. This is needed if any of the data points have the value &quot;L&quot; (lower than detection limit).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="upperLimit" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The upper limit of detection of the measured points. This is needed if any of the data points have the value &quot;U&quot; (higher than detection limit).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dimensions" type="integer" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="data" type="SampledDataDataType" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A series of data points which are decimal values separated by a single space (character u20). The special values &quot;E&quot; (error), &quot;L&quot; (below detection limit) and &quot;U&quot; (above detection limit) can also be used in place of a decimal value.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SampledDataDataType-primitive">
     <xs:restriction base="xs:string">
      <xs:pattern value="((-{0,1}\d*\.{0,1}\d+)|[EUL])( ((-{0,1}\d*\.{0,1}\d+)|[EUL]))*"/>
    </xs:restriction>
  </xs:simpleType>
    <xs:complexType name="SampledDataDataType">
      <xs:complexContent>
        <xs:extension base="Element">
          <xs:attribute name="value" type="SampledDataDataType-primitive" use="optional"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>

  <xs:complexType name="Reference">
    <xs:annotation>
      <xs:documentation>A reference from one resource to another.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="reference" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Plain text narrative that identifies the resource in addition to the resource reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeableConcept">
    <xs:annotation>
      <xs:documentation>A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="coding" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A reference to a code defined by a terminology system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Identifier">
    <xs:annotation>
      <xs:documentation>A technical identifier - identifies some entity uniquely and unambiguously.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="use" type="IdentifierUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The purpose of this identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="label" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A text string for the identifier that can be displayed to a human so they can recognize the identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Establishes the namespace in which set of possible id values is unique.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The portion of the identifier typically displayed to the user and which is unique within the context of the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Time period during which identifier is/was valid for use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assigner" type="Reference" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Organization that issued/manages the identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IdentifierUse-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="usual">
        <xs:annotation>
          <xs:documentation>the identifier recommended for display and use in real-world interactions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation>the identifier considered to be most trusted for the identification of this item.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation>A temporary identifier.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="secondary">
        <xs:annotation>
          <xs:documentation>An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IdentifierUse">
    <xs:annotation>
      <xs:documentation>Identifies the purpose for this identifier, if known</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="IdentifierUse-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Age">
    <xs:complexContent>
      <xs:restriction base="Quantity">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable form of the units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A computer processable form of the units in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="id-primitive"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Count">
    <xs:complexContent>
      <xs:restriction base="Quantity">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable form of the units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A computer processable form of the units in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="id-primitive"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Money">
    <xs:complexContent>
      <xs:restriction base="Quantity">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable form of the units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A computer processable form of the units in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="id-primitive"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Distance">
    <xs:complexContent>
      <xs:restriction base="Quantity">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable form of the units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A computer processable form of the units in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="id-primitive"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Duration">
    <xs:complexContent>
      <xs:restriction base="Quantity">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable form of the units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A computer processable form of the units in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="id-primitive"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition">
    <xs:annotation>
      <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="path" type="string" minOccurs="1" maxOccurs="1">
            <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 or extension.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="representation" type="PropertyRepresentation" minOccurs="0" maxOccurs="unbounded">
            <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" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The name of this element definition (to refer to it from other element definitions using ElementDefinition.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="ElementDefinition.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="short" type="string" minOccurs="0" maxOccurs="1">
            <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" type="string" minOccurs="0" maxOccurs="1">
            <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" type="string" minOccurs="0" maxOccurs="1">
            <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" type="string" minOccurs="0" maxOccurs="1">
            <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" type="string" minOccurs="0" maxOccurs="unbounded">
            <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" type="integer" minOccurs="0" maxOccurs="1">
            <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" type="string" minOccurs="0" maxOccurs="1">
            <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="ElementDefinition.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" type="string" minOccurs="0" maxOccurs="1">
            <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>The value that should be used if there is no value stated in the instance.</xs:documentation>
           </xs:annotation>
           <xs:element name="defaultValueBoolean" type="boolean"/>
           <xs:element name="defaultValueInteger" type="integer"/>
           <xs:element name="defaultValueDecimal" type="decimal"/>
           <xs:element name="defaultValueBase64Binary" type="base64Binary"/>
           <xs:element name="defaultValueInstant" type="instant"/>
           <xs:element name="defaultValueString" type="string"/>
           <xs:element name="defaultValueUri" type="uri"/>
           <xs:element name="defaultValueDate" type="date"/>
           <xs:element name="defaultValueDateTime" type="dateTime"/>
           <xs:element name="defaultValueTime" type="time"/>
           <xs:element name="defaultValueCode" type="code"/>
           <xs:element name="defaultValueAttachment" type="Attachment"/>
           <xs:element name="defaultValueIdentifier" type="Identifier"/>
           <xs:element name="defaultValueCodeableConcept" type="CodeableConcept"/>
           <xs:element name="defaultValueCoding" type="Coding"/>
           <xs:element name="defaultValueQuantity" type="Quantity"/>
           <xs:element name="defaultValueRange" type="Range"/>
           <xs:element name="defaultValuePeriod" type="Period"/>
           <xs:element name="defaultValueRatio" type="Ratio"/>
           <xs:element name="defaultValueReference" type="Reference"/>
           <xs:element name="defaultValueSampledData" type="SampledData"/>
           <xs:element name="defaultValueHumanName" type="HumanName"/>
           <xs:element name="defaultValueAddress" type="Address"/>
           <xs:element name="defaultValueContactPoint" type="ContactPoint"/>
           <xs:element name="defaultValueTiming" type="Timing"/>
           <xs:element name="defaultValueMeta" type="Meta"/>
          </xs:choice>
          <xs:element name="meaningWhenMissing" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The Implicit meaning that is to be understood when this element is missing.</xs:documentation>
            </xs:annotation>
          </xs:element>
        <xs:choice minOccurs="0" maxOccurs="1">
           <xs:annotation>
             <xs:documentation>Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.</xs:documentation>
           </xs:annotation>
           <xs:element name="fixedBoolean" type="boolean"/>
           <xs:element name="fixedInteger" type="integer"/>
           <xs:element name="fixedDecimal" type="decimal"/>
           <xs:element name="fixedBase64Binary" type="base64Binary"/>
           <xs:element name="fixedInstant" type="instant"/>
           <xs:element name="fixedString" type="string"/>
           <xs:element name="fixedUri" type="uri"/>
           <xs:element name="fixedDate" type="date"/>
           <xs:element name="fixedDateTime" type="dateTime"/>
           <xs:element name="fixedTime" type="time"/>
           <xs:element name="fixedCode" type="code"/>
           <xs:element name="fixedAttachment" type="Attachment"/>
           <xs:element name="fixedIdentifier" type="Identifier"/>
           <xs:element name="fixedCodeableConcept" type="CodeableConcept"/>
           <xs:element name="fixedCoding" type="Coding"/>
           <xs:element name="fixedQuantity" type="Quantity"/>
           <xs:element name="fixedRange" type="Range"/>
           <xs:element name="fixedPeriod" type="Period"/>
           <xs:element name="fixedRatio" type="Ratio"/>
           <xs:element name="fixedReference" type="Reference"/>
           <xs:element name="fixedSampledData" type="SampledData"/>
           <xs:element name="fixedHumanName" type="HumanName"/>
           <xs:element name="fixedAddress" type="Address"/>
           <xs:element name="fixedContactPoint" type="ContactPoint"/>
           <xs:element name="fixedTiming" type="Timing"/>
           <xs:element name="fixedMeta" type="Meta"/>
          </xs:choice>
        <xs:choice minOccurs="0" maxOccurs="1">
           <xs:annotation>
             <xs:documentation>Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).</xs:documentation>
           </xs:annotation>
           <xs:element name="patternBoolean" type="boolean"/>
           <xs:element name="patternInteger" type="integer"/>
           <xs:element name="patternDecimal" type="decimal"/>
           <xs:element name="patternBase64Binary" type="base64Binary"/>
           <xs:element name="patternInstant" type="instant"/>
           <xs:element name="patternString" type="string"/>
           <xs:element name="patternUri" type="uri"/>
           <xs:element name="patternDate" type="date"/>
           <xs:element name="patternDateTime" type="dateTime"/>
           <xs:element name="patternTime" type="time"/>
           <xs:element name="patternCode" type="code"/>
           <xs:element name="patternAttachment" type="Attachment"/>
           <xs:element name="patternIdentifier" type="Identifier"/>
           <xs:element name="patternCodeableConcept" type="CodeableConcept"/>
           <xs:element name="patternCoding" type="Coding"/>
           <xs:element name="patternQuantity" type="Quantity"/>
           <xs:element name="patternRange" type="Range"/>
           <xs:element name="patternPeriod" type="Period"/>
           <xs:element name="patternRatio" type="Ratio"/>
           <xs:element name="patternReference" type="Reference"/>
           <xs:element name="patternSampledData" type="SampledData"/>
           <xs:element name="patternHumanName" type="HumanName"/>
           <xs:element name="patternAddress" type="Address"/>
           <xs:element name="patternContactPoint" type="ContactPoint"/>
           <xs:element name="patternTiming" type="Timing"/>
           <xs:element name="patternMeta" type="Meta"/>
          </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="exampleTime" type="time"/>
           <xs:element name="exampleCode" type="code"/>
           <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="exampleReference" type="Reference"/>
           <xs:element name="exampleSampledData" type="SampledData"/>
           <xs:element name="exampleHumanName" type="HumanName"/>
           <xs:element name="exampleAddress" type="Address"/>
           <xs:element name="exampleContactPoint" type="ContactPoint"/>
           <xs:element name="exampleTiming" type="Timing"/>
           <xs:element name="exampleMeta" type="Meta"/>
          </xs:choice>
          <xs:element name="maxLength" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="condition" type="id" minOccurs="0" maxOccurs="unbounded">
            <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="ElementDefinition.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" type="boolean" minOccurs="0" maxOccurs="1">
            <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" type="boolean" minOccurs="0" maxOccurs="1">
            <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="isSummary" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Whether the element should be included if a client requests a search with the parameter _summary=true.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="binding" type="ElementDefinition.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="ElementDefinition.Mapping" 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="ElementDefinition.Mapping">
    <xs:annotation>
      <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="identity" type="id" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>An internal reference to the definition of a mapping.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="map" type="string" minOccurs="1" maxOccurs="1">
            <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="ElementDefinition.Slicing">
    <xs:annotation>
      <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="discriminator" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ordered" type="boolean" minOccurs="0" maxOccurs="1">
            <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" type="SlicingRules" minOccurs="1" maxOccurs="1">
            <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="ElementDefinition.Binding">
    <xs:annotation>
      <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="name" type="string" minOccurs="1" maxOccurs="1">
            <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" type="boolean" minOccurs="1" maxOccurs="1">
            <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" type="BindingConformance" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates the degree of conformance expectations associated with this binding.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" type="string" minOccurs="0" maxOccurs="1">
            <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="referenceBoolean" type="boolean"/>
           <xs:element name="referenceInteger" type="integer"/>
           <xs:element name="referenceDecimal" type="decimal"/>
           <xs:element name="referenceBase64Binary" type="base64Binary"/>
           <xs:element name="referenceInstant" type="instant"/>
           <xs:element name="referenceString" type="string"/>
           <xs:element name="referenceUri" type="uri"/>
           <xs:element name="referenceDate" type="date"/>
           <xs:element name="referenceDateTime" type="dateTime"/>
           <xs:element name="referenceTime" type="time"/>
           <xs:element name="referenceCode" type="code"/>
           <xs:element name="referenceAttachment" type="Attachment"/>
           <xs:element name="referenceIdentifier" type="Identifier"/>
           <xs:element name="referenceCodeableConcept" type="CodeableConcept"/>
           <xs:element name="referenceCoding" type="Coding"/>
           <xs:element name="referenceQuantity" type="Quantity"/>
           <xs:element name="referenceRange" type="Range"/>
           <xs:element name="referencePeriod" type="Period"/>
           <xs:element name="referenceRatio" type="Ratio"/>
           <xs:element name="referenceReference" type="Reference"/>
           <xs:element name="referenceSampledData" type="SampledData"/>
           <xs:element name="referenceHumanName" type="HumanName"/>
           <xs:element name="referenceAddress" type="Address"/>
           <xs:element name="referenceContactPoint" type="ContactPoint"/>
           <xs:element name="referenceTiming" type="Timing"/>
           <xs:element name="referenceMeta" type="Meta"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Type">
    <xs:annotation>
      <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="code" type="code" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Name of Data type or Resource that is a(or the) type used for this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies a profile structure 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" type="AggregationMode" minOccurs="0" maxOccurs="unbounded">
            <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="ElementDefinition.Constraint">
    <xs:annotation>
      <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="key" type="id" minOccurs="1" maxOccurs="1">
            <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" type="string" minOccurs="0" maxOccurs="1">
            <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" type="ConstraintSeverity" minOccurs="1" maxOccurs="1">
            <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" type="string" minOccurs="1" maxOccurs="1">
            <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" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>An XPath expression of constraint that can be executed to see if this constraint is met.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </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="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: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="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 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="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:complexType name="Timing">
    <xs:annotation>
      <xs:documentation>Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="event" type="Period" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies specific time periods when the event should occur.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="repeat" type="Timing.Repeat" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies a repeating pattern to the intended time periods.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Timing.Repeat">
    <xs:annotation>
      <xs:documentation>Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="frequency" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates how often the event should occur.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="when" type="EventTiming" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies the occurrence of daily life that determines timing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="duration" type="decimal" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>How long each repetition should last.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="units" type="UnitsOfTime" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The units of time for the duration.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="count" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A total count of the desired number of repetitions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>When to stop repeating the timing schedule.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EventTiming-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="HS">
        <xs:annotation>
          <xs:documentation>event occurs [duration] before the hour of sleep (or trying to).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="WAKE">
        <xs:annotation>
          <xs:documentation>event occurs [duration] after waking.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AC">
        <xs:annotation>
          <xs:documentation>event occurs [duration] before a meal (from the Latin ante cibus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ACM">
        <xs:annotation>
          <xs:documentation>event occurs [duration] before breakfast (from the Latin ante cibus matutinus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ACD">
        <xs:annotation>
          <xs:documentation>event occurs [duration] before lunch (from the Latin ante cibus diurnus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ACV">
        <xs:annotation>
          <xs:documentation>event occurs [duration] before dinner (from the Latin ante cibus vespertinus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PC">
        <xs:annotation>
          <xs:documentation>event occurs [duration] after a meal (from the Latin post cibus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PCM">
        <xs:annotation>
          <xs:documentation>event occurs [duration] after breakfast (from the Latin post cibus matutinus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PCD">
        <xs:annotation>
          <xs:documentation>event occurs [duration] after lunch (from the Latin post cibus diurnus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PCV">
        <xs:annotation>
          <xs:documentation>event occurs [duration] after dinner (from the Latin post cibus vespertinus).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EventTiming">
    <xs:annotation>
      <xs:documentation>Real world event that the schedule relates to</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="EventTiming-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="UnitsOfTime-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="s">
        <xs:annotation>
          <xs:documentation>second.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="min">
        <xs:annotation>
          <xs:documentation>minute.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="h">
        <xs:annotation>
          <xs:documentation>hour.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="d">
        <xs:annotation>
          <xs:documentation>day.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="wk">
        <xs:annotation>
          <xs:documentation>week.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mo">
        <xs:annotation>
          <xs:documentation>month.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="a">
        <xs:annotation>
          <xs:documentation>year.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="UnitsOfTime">
    <xs:annotation>
      <xs:documentation>A unit of time (units from UCUM)</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="UnitsOfTime-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Address">
    <xs:annotation>
      <xs:documentation>There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="use" type="AddressUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The purpose of this address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A full text representation of the address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="line" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>This component contains the house number, apartment number, street name, street direction, 
P.O. Box number, delivery hints, and similar address information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="city" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The name of the city, town, village or other community or delivery center.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="state" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="postalCode" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A postal code designating a region defined by the postal service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="country" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Country - a nation as commonly understood or generally accepted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Time period when address was/is in use.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AddressUse-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="home">
        <xs:annotation>
          <xs:documentation>A communication address at a home.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="work">
        <xs:annotation>
          <xs:documentation>An office address. First choice for business related contacts during business hours.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation>A temporary address. The period can provide more detailed information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="old">
        <xs:annotation>
          <xs:documentation>This address is no longer in use (or was never correct, but retained for records).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AddressUse">
    <xs:annotation>
      <xs:documentation>The use of an address</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="AddressUse-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HumanName">
    <xs:annotation>
      <xs:documentation>A human's name with the ability to identify parts and usage.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="use" type="NameUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies the purpose for this name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A full text representation of the name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="family" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="given" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Given name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prefix" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="suffix" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates the period of time when this name was valid for the named person.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NameUse-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="usual">
        <xs:annotation>
          <xs:documentation>Known as/conventional/the one you normally use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation>The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called &quot;legal name&quot;.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation>A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="nickname">
        <xs:annotation>
          <xs:documentation>A name that is used to address the person in an informal manner, but is not part of their formal or usual name.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="anonymous">
        <xs:annotation>
          <xs:documentation>Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="old">
        <xs:annotation>
          <xs:documentation>This name is no longer in use (or was never correct, but retained for records).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="maiden">
        <xs:annotation>
          <xs:documentation>A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store &quot;maiden&quot; names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NameUse">
    <xs:annotation>
      <xs:documentation>The use of a human name</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="NameUse-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Meta">
    <xs:annotation>
      <xs:documentation>The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="versionId" type="id" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastUpdated" type="instant" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>When the resource last changed - e.g. when the version changed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="deleted" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Set to 'true' if the resource is deleted. Deleted resources can not be fetched via the RESTful API, but may appear in bundles for various reasons.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" type="uri" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="security" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="tag" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ContactPoint">
    <xs:annotation>
      <xs:documentation>Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="system" type="ContactPointSystem" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Telecommunications form for contact point - what communications system is required to make use of the contact.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" type="ContactPointUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies the purpose for the contact point.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Time period when the contact point was/is in use.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContactPointSystem-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="phone">
        <xs:annotation>
          <xs:documentation>The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fax">
        <xs:annotation>
          <xs:documentation>The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="email">
        <xs:annotation>
          <xs:documentation>The value is an email address.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="url">
        <xs:annotation>
          <xs:documentation>The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContactPointSystem">
    <xs:annotation>
      <xs:documentation>Telecommunications form for contact point</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="ContactPointSystem-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContactPointUse-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="home">
        <xs:annotation>
          <xs:documentation>A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="work">
        <xs:annotation>
          <xs:documentation>An office contact point. First choice for business related contacts during business hours.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation>A temporary contact point. The period can provide more detailed information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="old">
        <xs:annotation>
          <xs:documentation>This contact point is no longer in use (or was never correct, but retained for records).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mobile">
        <xs:annotation>
          <xs:documentation>A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContactPointUse">
    <xs:annotation>
      <xs:documentation>Use of contact point</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="ContactPointUse-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Parameters">
    <xs:annotation>
      <xs:documentation>This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Resource">
        <xs:sequence>
          <xs:element name="parameter" type="Parameters.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A parameter passed to or received from the operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Parameters.Parameter">
    <xs:annotation>
      <xs:documentation>This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="name" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The name of the parameter (reference to the operation definition).</xs:documentation>
            </xs:annotation>
          </xs:element>
        <xs:choice minOccurs="0" maxOccurs="1">
           <xs:annotation>
             <xs:documentation>If the parameter is a data type.</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="valueTime" type="time"/>
           <xs:element name="valueCode" type="code"/>
           <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="valueReference" type="Reference"/>
           <xs:element name="valueSampledData" type="SampledData"/>
           <xs:element name="valueHumanName" type="HumanName"/>
           <xs:element name="valueAddress" type="Address"/>
           <xs:element name="valueContactPoint" type="ContactPoint"/>
           <xs:element name="valueTiming" type="Timing"/>
           <xs:element name="valueMeta" type="Meta"/>
          </xs:choice>
          <xs:element name="resource" type="ResourceContainer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>If the parameter is a whole resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="part" type="Parameters.Part" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A named part of a parameter. In many implementation context, a set of named parts is known as a &quot;Tuple&quot;.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Parameters.Part">
    <xs:annotation>
      <xs:documentation>This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it.</xs:documentation>
      <xs:documentation>If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="name" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The name of the parameter (reference to the operation definition).</xs:documentation>
            </xs:annotation>
          </xs:element>
        <xs:choice minOccurs="1" maxOccurs="1">
           <xs:annotation>
             <xs:documentation>The value of the parameter.</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="valueTime" type="time"/>
           <xs:element name="valueCode" type="code"/>
           <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="valueReference" type="Reference"/>
           <xs:element name="valueSampledData" type="SampledData"/>
           <xs:element name="valueHumanName" type="HumanName"/>
           <xs:element name="valueAddress" type="Address"/>
           <xs:element name="valueContactPoint" type="ContactPoint"/>
           <xs:element name="valueTiming" type="Timing"/>
           <xs:element name="valueMeta" type="Meta"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Parameters" type="Parameters">
    <xs:annotation>
      <xs:documentation>This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Resource">
    <xs:annotation>
      <xs:documentation>Base Resource for everything.</xs:documentation>
    </xs:annotation>
        <xs:sequence>
          <xs:element name="id" type="id" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="meta" type="Meta" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="implicitRules" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The base language in which the resource is written.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
  </xs:complexType>
  <xs:complexType name="DomainResource">
    <xs:annotation>
      <xs:documentation>A resource that includes narrative, extensions, and contained resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Resource">
        <xs:sequence>
          <xs:element name="text" type="Narrative" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contained" type="ResourceContainer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="extension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="modifierExtension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </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></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="DataAbsentReason-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation>The value is not known</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="asked">
        <xs:annotation>
          <xs:documentation>The source human does not know the value</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation>There is reason to expect (from the workflow) that the value may become known</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notasked">
        <xs:annotation>
          <xs:documentation>The workflow didn't lead to this value being known</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="masked">
        <xs:annotation>
          <xs:documentation>The information is not available due to security, privacy or related reasons</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unsupported">
        <xs:annotation>
          <xs:documentation>The source system wasn't capable of supporting this element</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="astext">
        <xs:annotation>
          <xs:documentation>The content of the data is represented in the resource narrative</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>Some system or workflow process error means that the information is not available</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DataAbsentReason">
    <xs:annotation>
      <xs:documentation></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="DataAbsentReason-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AdministrativeGender-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="male">
        <xs:annotation>
          <xs:documentation>Male</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="female">
        <xs:annotation>
          <xs:documentation>Female</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation>Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AdministrativeGender">
    <xs:annotation>
      <xs:documentation></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="AdministrativeGender-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SpecialValues-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="true">
        <xs:annotation>
          <xs:documentation>Boolean true</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="false">
        <xs:annotation>
          <xs:documentation>Boolean false</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="trace">
        <xs:annotation>
          <xs:documentation>The content is greater than zero, but too small to be quantified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sufficient">
        <xs:annotation>
          <xs:documentation>The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="withdrawn">
        <xs:annotation>
          <xs:documentation>The value is no longer available</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="nil-known">
        <xs:annotation>
          <xs:documentation>The are no known applicable values in this context</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SpecialValues">
    <xs:annotation>
      <xs:documentation></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="SpecialValues-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></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="DataType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Address">
        <xs:annotation>
          <xs:documentation>There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Age">
        <xs:annotation>
          <xs:documentation>A duration (length of time) with a UCUM code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Attachment">
        <xs:annotation>
          <xs:documentation>For referring to data content defined in other formats.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BackboneElement">
        <xs:annotation>
          <xs:documentation>Base definition for all elements that are defined inside a resource - but not those in a data type.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeableConcept">
        <xs:annotation>
          <xs:documentation>A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coding">
        <xs:annotation>
          <xs:documentation>A reference to a code defined by a terminology system.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ContactPoint">
        <xs:annotation>
          <xs:documentation>Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Count">
        <xs:annotation>
          <xs:documentation>A count of a discrete element (no unit)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Distance">
        <xs:annotation>
          <xs:documentation>A measure of distance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Duration">
        <xs:annotation>
          <xs:documentation>A length of time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Element">
        <xs:annotation>
          <xs:documentation>Base definition for all elements in a resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ElementDefinition">
        <xs:annotation>
          <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Extension">
        <xs:annotation>
          <xs:documentation>Optional Extensions Element - found in all resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HumanName">
        <xs:annotation>
          <xs:documentation>A human's name with the ability to identify parts and usage.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Identifier">
        <xs:annotation>
          <xs:documentation>A technical identifier - identifies some entity uniquely and unambiguously.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Meta">
        <xs:annotation>
          <xs:documentation>The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Money">
        <xs:annotation>
          <xs:documentation>An amount of money. With regard to precision, see [[X]]</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Narrative">
        <xs:annotation>
          <xs:documentation>A human-readable formatted text, including images.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Period">
        <xs:annotation>
          <xs:documentation>A time period defined by a start and end date and optionally time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Quantity">
        <xs:annotation>
          <xs:documentation>A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Range">
        <xs:annotation>
          <xs:documentation>A set of ordered Quantities defined by a low and high limit.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Ratio">
        <xs:annotation>
          <xs:documentation>A relationship of two Quantity values - expressed as a numerator and a denominator.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reference">
        <xs:annotation>
          <xs:documentation>A reference from one resource to another.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SampledData">
        <xs:annotation>
          <xs:documentation>A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Timing">
        <xs:annotation>
          <xs:documentation>Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="base64Binary">
        <xs:annotation>
          <xs:documentation>A stream of bytes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation>Value of &quot;true&quot; or &quot;false&quot;</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="code">
        <xs:annotation>
          <xs:documentation>A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation>A date, or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation>A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds may be provided but may also be ignored.  Dates SHALL be valid dates.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="decimal">
        <xs:annotation>
          <xs:documentation>A rational number with implicit precision</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="id">
        <xs:annotation>
          <xs:documentation>Any combination of lowercase letters, numerals, &quot;-&quot; and &quot;.&quot;, with a length limit of 36 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Systems SHALL send ids as lower-case but SHOULD interpret them case-insensitively.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instant">
        <xs:annotation>
          <xs:documentation>An instant in time - known at least to the second</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation>A whole number</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="oid">
        <xs:annotation>
          <xs:documentation>An oid represented as a URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation>A sequence of Unicode characters</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time">
        <xs:annotation>
          <xs:documentation>A time during the day, with no date specified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation>String of characters used to identify a name or a resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation>A UUID, represented as a URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DataType">
    <xs:annotation>
      <xs:documentation></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="DataType-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EncounterState-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The Encounter has not yet started.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="arrived">
        <xs:annotation>
          <xs:documentation>The Patient is present for the encounter, however is not currently meeting with a practitioner.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The Encounter has begun and the patient is present / the practitioner and the patient are meeting.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="onleave">
        <xs:annotation>
          <xs:documentation>The Encounter has begun, but the patient is temporarily on leave.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="finished">
        <xs:annotation>
          <xs:documentation>The Encounter has ended.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The Encounter has ended before it has begun.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EncounterState">
    <xs:annotation>
      <xs:documentation></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="EncounterState-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MessageEvent-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="MedicationAdministration-Complete">
        <xs:annotation>
          <xs:documentation>Change the status of a Medication Administration to show that it is complete.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration-Nullification">
        <xs:annotation>
          <xs:documentation>Someone wishes to record that the record of administration of a medication is in error and should be ignored.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration-Recording">
        <xs:annotation>
          <xs:documentation>Indicates that a medication has been recorded against the patient's record.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration-Update">
        <xs:annotation>
          <xs:documentation>Update a Medication Administration record.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="admin-notify">
        <xs:annotation>
          <xs:documentation>Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="conceptmap-translate">
        <xs:annotation>
          <xs:documentation>Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server. The coded value is carried as an extension in the message header.  The outcome is an operationOutcome with hints, warnings, or errors, or the translated code in an extension.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="diagnosticreport-provide">
        <xs:annotation>
          <xs:documentation>Provide a diagnostic report, or update a previously provided diagnostic report.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="observation-provide">
        <xs:annotation>
          <xs:documentation>Provide a simple observation or update a previously provided simple observation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="patient-link">
        <xs:annotation>
          <xs:documentation>Notification that two patient records actually identify the same patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="patient-unlink">
        <xs:annotation>
          <xs:documentation>Notification that previous advice that two patient records concern the same patient is now considered incorrect.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="valueset-expand">
        <xs:annotation>
          <xs:documentation>The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="valueset-validate">
        <xs:annotation>
          <xs:documentation>Validate that a coded value is in the set of codes allowed by a value set. The coded value is carried as an extension in the message header. The outcome is an OperationOutcome with hints, warnings, or errors.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MessageEvent">
    <xs:annotation>
      <xs:documentation></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="MessageEvent-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ValueSetStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>This valueset is still under development.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>This valueset is ready for normal use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation>This valueset has been withdrawn or superceded and should no longer be used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ValueSetStatus">
    <xs:annotation>
      <xs:documentation></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="ValueSetStatus-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="QuestionnaireStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>This Questionnaire is not ready for official use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="published">
        <xs:annotation>
          <xs:documentation>This Questionnaire is ready for use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation>This Questionnaire should no longer be used to gather data.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="QuestionnaireStatus">
    <xs:annotation>
      <xs:documentation></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="QuestionnaireStatus-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FilterOperator-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="=">
        <xs:annotation>
          <xs:documentation>The specified property of the code equals the provided value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="is-a">
        <xs:annotation>
          <xs:documentation>The specified property of the code has an is-a relationship with the provided value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="is-not-a">
        <xs:annotation>
          <xs:documentation>The specified property of the code does not have an is-a relationship with the provided value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="regex">
        <xs:annotation>
          <xs:documentation>The specified property of the code  matches the regex specified in the provided value.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation>The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-in">
        <xs:annotation>
          <xs:documentation>The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FilterOperator">
    <xs:annotation>
      <xs:documentation></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="FilterOperator-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DocumentReferenceStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="current">
        <xs:annotation>
          <xs:documentation>This is the current reference for this document.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="superceded">
        <xs:annotation>
          <xs:documentation>This reference has been superseded by another reference.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>This reference was created in error.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DocumentReferenceStatus">
    <xs:annotation>
      <xs:documentation></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="DocumentReferenceStatus-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RemittanceOutcome-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation>The processing completed without errors.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>The processing identified with errors.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RemittanceOutcome">
    <xs:annotation>
      <xs:documentation></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="RemittanceOutcome-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NoteType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="display">
        <xs:annotation>
          <xs:documentation>Display the note.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="print">
        <xs:annotation>
          <xs:documentation>Print the note on the form.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="printoper">
        <xs:annotation>
          <xs:documentation>Print the note for the operator.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NoteType">
    <xs:annotation>
      <xs:documentation></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="NoteType-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchParamType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="number">
        <xs:annotation>
          <xs:documentation>Search parameter SHALL be a number (a whole number, or a decimal).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation>Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation>Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="token">
        <xs:annotation>
          <xs:documentation>Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a &quot;|&quot;, depending on the modifier used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reference">
        <xs:annotation>
          <xs:documentation>A reference to another resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="composite">
        <xs:annotation>
          <xs:documentation>A composite search parameter that combines a search on two values together.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="quantity">
        <xs:annotation>
          <xs:documentation>A search parameter that searches on a quantity.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchParamType">
    <xs:annotation>
      <xs:documentation></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="SearchParamType-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FHIRDefinedType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Address">
        <xs:annotation>
          <xs:documentation>There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Age">
        <xs:annotation>
          <xs:documentation>A duration (length of time) with a UCUM code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Attachment">
        <xs:annotation>
          <xs:documentation>For referring to data content defined in other formats.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BackboneElement">
        <xs:annotation>
          <xs:documentation>Base definition for all elements that are defined inside a resource - but not those in a data type.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeableConcept">
        <xs:annotation>
          <xs:documentation>A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coding">
        <xs:annotation>
          <xs:documentation>A reference to a code defined by a terminology system.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ContactPoint">
        <xs:annotation>
          <xs:documentation>Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Count">
        <xs:annotation>
          <xs:documentation>A count of a discrete element (no unit)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Distance">
        <xs:annotation>
          <xs:documentation>A measure of distance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Duration">
        <xs:annotation>
          <xs:documentation>A length of time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Element">
        <xs:annotation>
          <xs:documentation>Base definition for all elements in a resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ElementDefinition">
        <xs:annotation>
          <xs:documentation>Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Extension">
        <xs:annotation>
          <xs:documentation>Optional Extensions Element - found in all resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HumanName">
        <xs:annotation>
          <xs:documentation>A human's name with the ability to identify parts and usage.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Identifier">
        <xs:annotation>
          <xs:documentation>A technical identifier - identifies some entity uniquely and unambiguously.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Meta">
        <xs:annotation>
          <xs:documentation>The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Money">
        <xs:annotation>
          <xs:documentation>An amount of money. With regard to precision, see [[X]]</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Narrative">
        <xs:annotation>
          <xs:documentation>A human-readable formatted text, including images.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Period">
        <xs:annotation>
          <xs:documentation>A time period defined by a start and end date and optionally time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Quantity">
        <xs:annotation>
          <xs:documentation>A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Range">
        <xs:annotation>
          <xs:documentation>A set of ordered Quantities defined by a low and high limit.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Ratio">
        <xs:annotation>
          <xs:documentation>A relationship of two Quantity values - expressed as a numerator and a denominator.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reference">
        <xs:annotation>
          <xs:documentation>A reference from one resource to another.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SampledData">
        <xs:annotation>
          <xs:documentation>A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Timing">
        <xs:annotation>
          <xs:documentation>Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="base64Binary">
        <xs:annotation>
          <xs:documentation>A stream of bytes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation>Value of &quot;true&quot; or &quot;false&quot;</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="code">
        <xs:annotation>
          <xs:documentation>A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation>A date, or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation>A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds may be provided but may also be ignored.  Dates SHALL be valid dates.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="decimal">
        <xs:annotation>
          <xs:documentation>A rational number with implicit precision</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="id">
        <xs:annotation>
          <xs:documentation>Any combination of lowercase letters, numerals, &quot;-&quot; and &quot;.&quot;, with a length limit of 36 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Systems SHALL send ids as lower-case but SHOULD interpret them case-insensitively.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instant">
        <xs:annotation>
          <xs:documentation>An instant in time - known at least to the second</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation>A whole number</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="oid">
        <xs:annotation>
          <xs:documentation>An oid represented as a URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation>A sequence of Unicode characters</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time">
        <xs:annotation>
          <xs:documentation>A time during the day, with no date specified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation>String of characters used to identify a name or a resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation>A UUID, represented as a URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Alert">
        <xs:annotation>
          <xs:documentation>Prospective warnings of potential issues when providing care to the patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AllergyIntolerance">
        <xs:annotation>
          <xs:documentation>Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Appointment">
        <xs:annotation>
          <xs:documentation>A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AppointmentResponse">
        <xs:annotation>
          <xs:documentation>A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Basic">
        <xs:annotation>
          <xs:documentation>Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Binary">
        <xs:annotation>
          <xs:documentation>A binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BodySite">
        <xs:annotation>
          <xs:documentation>Record details about the anatomical location of a specimen or body part, including precise localisation information.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Bundle">
        <xs:annotation>
          <xs:documentation>A container for a group of resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan">
        <xs:annotation>
          <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan2">
        <xs:annotation>
          <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClaimResponse">
        <xs:annotation>
          <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClinicalAssessment">
        <xs:annotation>
          <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Communication">
        <xs:annotation>
          <xs:documentation>An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CommunicationRequest">
        <xs:annotation>
          <xs:documentation>A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Composition">
        <xs:annotation>
          <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ConceptMap">
        <xs:annotation>
          <xs:documentation>A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Condition">
        <xs:annotation>
          <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Conformance">
        <xs:annotation>
          <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contract">
        <xs:annotation>
          <xs:documentation>A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contraindication">
        <xs:annotation>
          <xs:documentation>Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient.  E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coverage">
        <xs:annotation>
          <xs:documentation>Financial instrument which may be used to pay for or reimburse for health care products and services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataElement">
        <xs:annotation>
          <xs:documentation>The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Device">
        <xs:annotation>
          <xs:documentation>This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceComponent">
        <xs:annotation>
          <xs:documentation>Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceMetric">
        <xs:annotation>
          <xs:documentation>Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseRequest">
        <xs:annotation>
          <xs:documentation>Represents a request for the use of a device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseStatement">
        <xs:annotation>
          <xs:documentation>A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DiagnosticOrder">
        <xs:annotation>
          <xs:documentation>A request for a diagnostic investigation service to be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="DocumentManifest">
        <xs:annotation>
          <xs:documentation>A manifest that defines a set of documents.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentReference">
        <xs:annotation>
          <xs:documentation>A reference to a document.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityResponse">
        <xs:annotation>
          <xs:documentation>This resource provides eligibility and plan details from the processing of an Eligibility resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Encounter">
        <xs:annotation>
          <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the insurance Enrollment details to the insurer regarding a specified coverage.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentResponse">
        <xs:annotation>
          <xs:documentation>This resource provides Enrollment and plan details from the processing of an Enrollment resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EpisodeOfCare">
        <xs:annotation>
          <xs:documentation>An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExplanationOfBenefit">
        <xs:annotation>
          <xs:documentation>This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExtensionDefinition">
        <xs:annotation>
          <xs:documentation>Defines an extension that can be used in resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FamilyHistory">
        <xs:annotation>
          <xs:documentation>Significant health events and conditions for people related to the subject relevant in the context of care for the subject.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Goal">
        <xs:annotation>
          <xs:documentation>Describes the intended objective(s) of the care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Group">
        <xs:annotation>
          <xs:documentation>Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized.  I.e. A collection of entities that isn't an Organization.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HealthcareService">
        <xs:annotation>
          <xs:documentation>The details of a Healthcare Service available at a location.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingObjectSelection">
        <xs:annotation>
          <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingStudy">
        <xs:annotation>
          <xs:documentation>Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Immunization">
        <xs:annotation>
          <xs:documentation>Immunization event information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImmunizationRecommendation">
        <xs:annotation>
          <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="InstitutionalClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="List">
        <xs:annotation>
          <xs:documentation>A set of information summarized from a list of other resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Location">
        <xs:annotation>
          <xs:documentation>Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="Medication">
        <xs:annotation>
          <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration">
        <xs:annotation>
          <xs:documentation>Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.

Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationDispense">
        <xs:annotation>
          <xs:documentation>Dispensing a medication to a named patient.  This includes a description of the supply provided and the instructions for administering the medication.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationPrescription">
        <xs:annotation>
          <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationStatement">
        <xs:annotation>
          <xs:documentation>A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageHeader">
        <xs:annotation>
          <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NamingSystem">
        <xs:annotation>
          <xs:documentation>A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NutritionOrder">
        <xs:annotation>
          <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Observation">
        <xs:annotation>
          <xs:documentation>Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationDefinition">
        <xs:annotation>
          <xs:documentation>A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationOutcome">
        <xs:annotation>
          <xs:documentation>A collection of error, warning or information messages that result from a system action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OralHealthClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Order">
        <xs:annotation>
          <xs:documentation>A request to perform an action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OrderResponse">
        <xs:annotation>
          <xs:documentation>A response to an order.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Organization">
        <xs:annotation>
          <xs:documentation>A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Other">
        <xs:annotation>
          <xs:documentation>Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Patient">
        <xs:annotation>
          <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentNotice">
        <xs:annotation>
          <xs:documentation>This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentReconciliation">
        <xs:annotation>
          <xs:documentation>This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PendedRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the request and response details for the resource for which the status is to be checked.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Person">
        <xs:annotation>
          <xs:documentation>Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PharmacyClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Practitioner">
        <xs:annotation>
          <xs:documentation>A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="ProcedureRequest">
        <xs:annotation>
          <xs:documentation>A request for a procedure to be performed. May be a proposal or an order.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProfessionalClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="Provenance">
        <xs:annotation>
          <xs:documentation>Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Questionnaire">
        <xs:annotation>
          <xs:documentation>A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="QuestionnaireAnswers">
        <xs:annotation>
          <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Readjudicate">
        <xs:annotation>
          <xs:documentation>This resource provides the request and line items details for the claim which is to be re-adjudicated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ReferralRequest">
        <xs:annotation>
          <xs:documentation>Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedPerson">
        <xs:annotation>
          <xs:documentation>Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reversal">
        <xs:annotation>
          <xs:documentation>This resource provides the request and response details for the request for which all actions are to be reversed or terminated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RiskAssessment">
        <xs:annotation>
          <xs:documentation>An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Schedule">
        <xs:annotation>
          <xs:documentation>A container for slot(s) of time that may be available for booking appointments.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SearchParameter">
        <xs:annotation>
          <xs:documentation>A Search Parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SecurityEvent">
        <xs:annotation>
          <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Slot">
        <xs:annotation>
          <xs:documentation>A slot of time on a schedule that may be available for booking appointments.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Specimen">
        <xs:annotation>
          <xs:documentation>Sample for analysis.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StatusRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the request and response details for the resource for which the processing status is to be checked.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StatusResponse">
        <xs:annotation>
          <xs:documentation>This resource provides processing status, errors and notes from the processing of a resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureDefinition">
        <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:enumeration>
      <xs:enumeration value="Subscription">
        <xs:annotation>
          <xs:documentation>Todo.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Substance">
        <xs:annotation>
          <xs:documentation>A homogeneous material with a definite composition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Supply">
        <xs:annotation>
          <xs:documentation>A supply - a  request for something, and provision of what is supplied.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupportingDocumentation">
        <xs:annotation>
          <xs:documentation>This resource provides the supporting information for a process, for example clinical or financial  information related to a claim or pre-authorization.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ValueSet">
        <xs:annotation>
          <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionPrescription">
        <xs:annotation>
          <xs:documentation>An authorization for the supply of glasses and/or contact lenses to a patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FHIRDefinedType">
    <xs:annotation>
      <xs:documentation></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="FHIRDefinedType-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EncounterClass-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="inpatient">
        <xs:annotation>
          <xs:documentation>An encounter during which the patient is hospitalized and stays overnight.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="outpatient">
        <xs:annotation>
          <xs:documentation>An encounter during which the patient is not hospitalized overnight.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ambulatory">
        <xs:annotation>
          <xs:documentation>An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="emergency">
        <xs:annotation>
          <xs:documentation>An encounter where the patient needs urgent care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="home">
        <xs:annotation>
          <xs:documentation>An encounter where the practitioner visits the patient at his/her home.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="field">
        <xs:annotation>
          <xs:documentation>An encounter taking place outside the regular environment for giving care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="daytime">
        <xs:annotation>
          <xs:documentation>An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="virtual">
        <xs:annotation>
          <xs:documentation>An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EncounterClass">
    <xs:annotation>
      <xs:documentation></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="EncounterClass-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompositionAttestationMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="personal">
        <xs:annotation>
          <xs:documentation>The person authenticated the content in their personal capacity.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="professional">
        <xs:annotation>
          <xs:documentation>The person authenticated the content in their professional capacity.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="legal">
        <xs:annotation>
          <xs:documentation>The person authenticated the content and accepted legal responsibility for its content.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation>The organization authenticated the content as consistent with their policies and procedures.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CompositionAttestationMode">
    <xs:annotation>
      <xs:documentation></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="CompositionAttestationMode-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="Use-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation>The treatment is complete and this represents a Claim for the services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation>The treatment is proposed and this represents a Pre-authorization for the services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exploratory">
        <xs:annotation>
          <xs:documentation>The treatment is proposed and this represents a Pre-determination for the services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>A locally defined or otherwise resolved status.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Use">
    <xs:annotation>
      <xs:documentation></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="Use-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Alert">
        <xs:annotation>
          <xs:documentation>Prospective warnings of potential issues when providing care to the patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AllergyIntolerance">
        <xs:annotation>
          <xs:documentation>Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Appointment">
        <xs:annotation>
          <xs:documentation>A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AppointmentResponse">
        <xs:annotation>
          <xs:documentation>A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Basic">
        <xs:annotation>
          <xs:documentation>Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Binary">
        <xs:annotation>
          <xs:documentation>A binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BodySite">
        <xs:annotation>
          <xs:documentation>Record details about the anatomical location of a specimen or body part, including precise localisation information.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Bundle">
        <xs:annotation>
          <xs:documentation>A container for a group of resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan">
        <xs:annotation>
          <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan2">
        <xs:annotation>
          <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClaimResponse">
        <xs:annotation>
          <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClinicalAssessment">
        <xs:annotation>
          <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Communication">
        <xs:annotation>
          <xs:documentation>An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CommunicationRequest">
        <xs:annotation>
          <xs:documentation>A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Composition">
        <xs:annotation>
          <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ConceptMap">
        <xs:annotation>
          <xs:documentation>A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Condition">
        <xs:annotation>
          <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Conformance">
        <xs:annotation>
          <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contract">
        <xs:annotation>
          <xs:documentation>A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contraindication">
        <xs:annotation>
          <xs:documentation>Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient.  E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coverage">
        <xs:annotation>
          <xs:documentation>Financial instrument which may be used to pay for or reimburse for health care products and services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataElement">
        <xs:annotation>
          <xs:documentation>The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Device">
        <xs:annotation>
          <xs:documentation>This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceComponent">
        <xs:annotation>
          <xs:documentation>Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceMetric">
        <xs:annotation>
          <xs:documentation>Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseRequest">
        <xs:annotation>
          <xs:documentation>Represents a request for the use of a device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseStatement">
        <xs:annotation>
          <xs:documentation>A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DiagnosticOrder">
        <xs:annotation>
          <xs:documentation>A request for a diagnostic investigation service to be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="DocumentManifest">
        <xs:annotation>
          <xs:documentation>A manifest that defines a set of documents.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentReference">
        <xs:annotation>
          <xs:documentation>A reference to a document.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityResponse">
        <xs:annotation>
          <xs:documentation>This resource provides eligibility and plan details from the processing of an Eligibility resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Encounter">
        <xs:annotation>
          <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the insurance Enrollment details to the insurer regarding a specified coverage.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentResponse">
        <xs:annotation>
          <xs:documentation>This resource provides Enrollment and plan details from the processing of an Enrollment resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EpisodeOfCare">
        <xs:annotation>
          <xs:documentation>An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExplanationOfBenefit">
        <xs:annotation>
          <xs:documentation>This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExtensionDefinition">
        <xs:annotation>
          <xs:documentation>Defines an extension that can be used in resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FamilyHistory">
        <xs:annotation>
          <xs:documentation>Significant health events and conditions for people related to the subject relevant in the context of care for the subject.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Goal">
        <xs:annotation>
          <xs:documentation>Describes the intended objective(s) of the care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Group">
        <xs:annotation>
          <xs:documentation>Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized.  I.e. A collection of entities that isn't an Organization.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HealthcareService">
        <xs:annotation>
          <xs:documentation>The details of a Healthcare Service available at a location.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingObjectSelection">
        <xs:annotation>
          <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingStudy">
        <xs:annotation>
          <xs:documentation>Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Immunization">
        <xs:annotation>
          <xs:documentation>Immunization event information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImmunizationRecommendation">
        <xs:annotation>
          <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="InstitutionalClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="List">
        <xs:annotation>
          <xs:documentation>A set of information summarized from a list of other resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Location">
        <xs:annotation>
          <xs:documentation>Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="Medication">
        <xs:annotation>
          <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration">
        <xs:annotation>
          <xs:documentation>Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.

Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationDispense">
        <xs:annotation>
          <xs:documentation>Dispensing a medication to a named patient.  This includes a description of the supply provided and the instructions for administering the medication.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationPrescription">
        <xs:annotation>
          <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationStatement">
        <xs:annotation>
          <xs:documentation>A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageHeader">
        <xs:annotation>
          <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NamingSystem">
        <xs:annotation>
          <xs:documentation>A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NutritionOrder">
        <xs:annotation>
          <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Observation">
        <xs:annotation>
          <xs:documentation>Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationDefinition">
        <xs:annotation>
          <xs:documentation>A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationOutcome">
        <xs:annotation>
          <xs:documentation>A collection of error, warning or information messages that result from a system action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OralHealthClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Order">
        <xs:annotation>
          <xs:documentation>A request to perform an action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OrderResponse">
        <xs:annotation>
          <xs:documentation>A response to an order.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Organization">
        <xs:annotation>
          <xs:documentation>A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Other">
        <xs:annotation>
          <xs:documentation>Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Patient">
        <xs:annotation>
          <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentNotice">
        <xs:annotation>
          <xs:documentation>This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentReconciliation">
        <xs:annotation>
          <xs:documentation>This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PendedRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the request and response details for the resource for which the status is to be checked.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Person">
        <xs:annotation>
          <xs:documentation>Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PharmacyClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Practitioner">
        <xs:annotation>
          <xs:documentation>A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="ProcedureRequest">
        <xs:annotation>
          <xs:documentation>A request for a procedure to be performed. May be a proposal or an order.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProfessionalClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="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:enumeration>
      <xs:enumeration value="Provenance">
        <xs:annotation>
          <xs:documentation>Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Questionnaire">
        <xs:annotation>
          <xs:documentation>A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="QuestionnaireAnswers">
        <xs:annotation>
          <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Readjudicate">
        <xs:annotation>
          <xs:documentation>This resource provides the request and line items details for the claim which is to be re-adjudicated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ReferralRequest">
        <xs:annotation>
          <xs:documentation>Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedPerson">
        <xs:annotation>
          <xs:documentation>Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reversal">
        <xs:annotation>
          <xs:documentation>This resource provides the request and response details for the request for which all actions are to be reversed or terminated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RiskAssessment">
        <xs:annotation>
          <xs:documentation>An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Schedule">
        <xs:annotation>
          <xs:documentation>A container for slot(s) of time that may be available for booking appointments.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SearchParameter">
        <xs:annotation>
          <xs:documentation>A Search Parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SecurityEvent">
        <xs:annotation>
          <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Slot">
        <xs:annotation>
          <xs:documentation>A slot of time on a schedule that may be available for booking appointments.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Specimen">
        <xs:annotation>
          <xs:documentation>Sample for analysis.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StatusRequest">
        <xs:annotation>
          <xs:documentation>This resource provides the request and response details for the resource for which the processing status is to be checked.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StatusResponse">
        <xs:annotation>
          <xs:documentation>This resource provides processing status, errors and notes from the processing of a resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureDefinition">
        <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:enumeration>
      <xs:enumeration value="Subscription">
        <xs:annotation>
          <xs:documentation>Todo.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Substance">
        <xs:annotation>
          <xs:documentation>A homogeneous material with a definite composition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Supply">
        <xs:annotation>
          <xs:documentation>A supply - a  request for something, and provision of what is supplied.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupportingDocumentation">
        <xs:annotation>
          <xs:documentation>This resource provides the supporting information for a process, for example clinical or financial  information related to a claim or pre-authorization.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ValueSet">
        <xs:annotation>
          <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionClaim">
        <xs:annotation>
          <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionPrescription">
        <xs:annotation>
          <xs:documentation>An authorization for the supply of glasses and/or contact lenses to a patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResourceType">
    <xs:annotation>
      <xs:documentation></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="ResourceType-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompositionStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="preliminary">
        <xs:annotation>
          <xs:documentation>This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation>The composition or document is complete and verified by an appropriate person, and no further work is planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appended">
        <xs:annotation>
          <xs:documentation>The composition or document has been modified subsequent to being released as &quot;final&quot;, and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation>The composition or document has been modified subsequent to being released as &quot;final&quot;, and is complete and verified by an authorized person.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CompositionStatus">
    <xs:annotation>
      <xs:documentation></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="CompositionStatus-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MaritalStatus-list">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MaritalStatus">
    <xs:annotation>
      <xs:documentation></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="MaritalStatus-list" use="optional"/>
       </xs:extension>
     </xs:complexContent>
  </xs:complexType>
  <xs:element name="Alert" type="Alert">
    <xs:annotation>
      <xs:documentation>Prospective warnings of potential issues when providing care to the patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Alert">
    <xs:annotation>
      <xs:documentation>Prospective warnings of potential issues when providing care to the patient.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier assigned to the alert for external use (outside the FHIR environment).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Allows an alert to be divided into different categories like clinical, administrative etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="AlertStatus">
            <xs:annotation>
              <xs:documentation>Supports basic workflow.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person who this alert concerns.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person or device that created the alert.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The textual component of the alert to display to the user.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AlertStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation>The alert does not need to be displayed any more.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>The alert was added in error, and should no longer be displayed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AlertStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether this alert is active and needs to be displayed to a user, or whether it is no longer needed or entered in error</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="AlertStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AllergyIntolerance" type="AllergyIntolerance">
    <xs:annotation>
      <xs:documentation>Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AllergyIntolerance">
    <xs:annotation>
      <xs:documentation>Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this allergy/intolerance concern 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="recordedDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date when the sensitivity was recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recorder" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates who has responsibility for the record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who has the allergy or intolerance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="substance" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceStatus">
            <xs:annotation>
              <xs:documentation>Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="criticality" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceCriticality">
            <xs:annotation>
              <xs:documentation>Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceType">
            <xs:annotation>
              <xs:documentation>Identification of the underlying physiological mechanism for the Reaction Risk.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceCategory">
            <xs:annotation>
              <xs:documentation>Category of the identified Substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastOccurence" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Represents the date and/or time of the last known occurence of a reaction event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="AllergyIntolerance.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Details about each Adverse Reaction Event linked to exposure to the identified Substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AllergyIntolerance.Event">
    <xs:annotation>
      <xs:documentation>Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="substance" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="certainty" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceCertainty">
            <xs:annotation>
              <xs:documentation>Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manifestation" minOccurs="1" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text description about the Reaction as a whole, including details of the manifestation if required.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="onset" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Record of the date and/or time of the onset of the Reaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="duration" minOccurs="0" maxOccurs="1" type="Duration">
            <xs:annotation>
              <xs:documentation>The amount of time that the Adverse Reaction persisted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceSeverity">
            <xs:annotation>
              <xs:documentation>Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exposureRoute" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identification of the route by which the subject was exposed to the substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional text about the Adverse Reaction event not captured in other fields.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceCertainty-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="unlikely">
        <xs:annotation>
          <xs:documentation>There is a low level of clinical certainty that the reaction was caused by the identified Substance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="likely">
        <xs:annotation>
          <xs:documentation>There is a high level of clinical certainty that the reaction was caused by the identified Substance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation>There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceCertainty">
    <xs:annotation>
      <xs:documentation>Statement about the degree of clinical certainty that a Specific Substance was the cause of the Manifestation in an reaction event</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="AllergyIntoleranceCertainty-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="immune">
        <xs:annotation>
          <xs:documentation>Immune mediated reaction, including allergic reactions and hypersensitivities.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="non-immune">
        <xs:annotation>
          <xs:documentation>A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceType">
    <xs:annotation>
      <xs:documentation>Identification of the underlying physiological mechanism for a Reaction Risk</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="AllergyIntoleranceType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceSeverity-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="mild">
        <xs:annotation>
          <xs:documentation>Causes mild physiological effects.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="moderate">
        <xs:annotation>
          <xs:documentation>Causes moderate physiological effects.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="severe">
        <xs:annotation>
          <xs:documentation>Causes severe physiological effects.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceSeverity">
    <xs:annotation>
      <xs:documentation>Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations</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="AllergyIntoleranceSeverity-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceCriticality-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="low">
        <xs:annotation>
          <xs:documentation>The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="high">
        <xs:annotation>
          <xs:documentation>The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unassessible">
        <xs:annotation>
          <xs:documentation>Unable to assess the potential clinical impact with the information available.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceCriticality">
    <xs:annotation>
      <xs:documentation>Estimate of the potential clinical harm, or seriousness, of a reaction to an identified Substance</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="AllergyIntoleranceCriticality-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceCategory-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="food">
        <xs:annotation>
          <xs:documentation>Any substance consumed to provide nutritional support for the body.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="medication">
        <xs:annotation>
          <xs:documentation>Substances administered to achieve a physiological effect.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="environment">
        <xs:annotation>
          <xs:documentation>Substances that are encountered in the environment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceCategory">
    <xs:annotation>
      <xs:documentation>Category of an identified Substance</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="AllergyIntoleranceCategory-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="unconfirmed">
        <xs:annotation>
          <xs:documentation>A low level of certainty about the propensity for a reaction to the identified Substance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation>A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolved">
        <xs:annotation>
          <xs:documentation>A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation>A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceStatus">
    <xs:annotation>
      <xs:documentation>Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified Substance</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="AllergyIntoleranceStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Appointment" type="Appointment">
    <xs:annotation>
      <xs:documentation>A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Appointment">
    <xs:annotation>
      <xs:documentation>A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this appointment concern 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="priority" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="AppointmentStatus">
            <xs:annotation>
              <xs:documentation>The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The reason that this appointment is being scheduled, this is more clinical than administrative.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Date/Time that the appointment is to take place.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Date/Time that the appointment is to conclude.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="slot" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The primary location that this appointment is to take place.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional comments about the appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="order" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>An Order that lead to the creation of this appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="Appointment.Participant" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>List of participants involved in the appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastModifiedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who recorded the appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastModified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date when the appointment was recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Appointment.Participant">
    <xs:annotation>
      <xs:documentation>A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Role of participant in the appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="required" minOccurs="0" maxOccurs="1" type="ParticipantRequired">
            <xs:annotation>
              <xs:documentation>Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ParticipationStatus">
            <xs:annotation>
              <xs:documentation>Participation status of the Patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ParticipantRequired-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="required">
        <xs:annotation>
          <xs:documentation>The participant is required to attend the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="optional">
        <xs:annotation>
          <xs:documentation>The participant may optionally attend the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="information-only">
        <xs:annotation>
          <xs:documentation>The participant is not required to attend the appointment (appointment is about them, not for them).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ParticipantRequired">
    <xs:annotation>
      <xs:documentation>Is the Participant required to attend the appointment</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="ParticipantRequired-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AppointmentStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="pending">
        <xs:annotation>
          <xs:documentation>Some or all of the participant(s) have not finalized their acceptance of the appointment request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="booked">
        <xs:annotation>
          <xs:documentation>All participant(s) have been considered and the appointment is condirmed to go ahead at the date/times specified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="arrived">
        <xs:annotation>
          <xs:documentation>Some of the patients have arrived.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fulfilled">
        <xs:annotation>
          <xs:documentation>This appointment has completed and may have resulted in an encounter.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The appointment has been cancelled.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="noshow">
        <xs:annotation>
          <xs:documentation>Some or all of the participant(s) have not/did not appear for the appointment (usually the patient).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AppointmentStatus">
    <xs:annotation>
      <xs:documentation>The free/busy status of an appointment</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="AppointmentStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ParticipationStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The participant has accepted the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="declined">
        <xs:annotation>
          <xs:documentation>The participant has declined the appointment and will not participate in the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="tentative">
        <xs:annotation>
          <xs:documentation>The participant has  tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-process">
        <xs:annotation>
          <xs:documentation>The participant has started the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The participant's involvement in the appointment has been completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="needs-action">
        <xs:annotation>
          <xs:documentation>The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ParticipationStatus">
    <xs:annotation>
      <xs:documentation>The Participation status of an appointment</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="ParticipationStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AppointmentResponse" type="AppointmentResponse">
    <xs:annotation>
      <xs:documentation>A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AppointmentResponse">
    <xs:annotation>
      <xs:documentation>A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this appointment concern 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="appointment" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Parent appointment that this response is replying to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participantType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Role of participant in the appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="individual" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participantStatus" minOccurs="1" maxOccurs="1" type="ParticipantStatus">
            <xs:annotation>
              <xs:documentation>Participation status of the Patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional comments about the appointment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Date/Time that the appointment is to take place.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Date/Time that the appointment is to conclude.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastModifiedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who recorded the appointment response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastModified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date when the response was recorded or last updated.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ParticipantStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="declined">
        <xs:annotation>
          <xs:documentation>The appointment participant has declined the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="tentative">
        <xs:annotation>
          <xs:documentation>The appointment participant has tentatively accepted the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-process">
        <xs:annotation>
          <xs:documentation>The participant has in-process the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The participant has completed the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="needs-action">
        <xs:annotation>
          <xs:documentation>This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ParticipantStatus">
    <xs:annotation>
      <xs:documentation>The Participation status of an appointment</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="ParticipantStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Basic" type="Basic">
    <xs:annotation>
      <xs:documentation>Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Basic">
    <xs:annotation>
      <xs:documentation>Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier assigned to the resource for business purposes, outside the context of FHIR.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the 'type' of resource - equivalent to the resource name for other resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the patient, practitioner, device or any other resource that is the &quot;focus&quot; of this resoruce.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates who was responsible for creating the resource instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Identifies when the resource was first created.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Binary" type="Binary">
    <xs:annotation>
      <xs:documentation>A binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Binary">
    <xs:annotation>
      <xs:documentation>A binary resource can contain any content, whether text, image, pdf, zip archive, etc.</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="contentType" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>MimeType of the binary content represented as a standard MimeType (BCP 13).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation>The actual content, base64 encoded.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="BodySite" type="BodySite">
    <xs:annotation>
      <xs:documentation>Record details about the anatomical location of a specimen or body part, including precise localisation information.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="BodySite">
    <xs:annotation>
      <xs:documentation>Record details about the anatomical location of a specimen or body part, including precise localisation information.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier for this instance of the anatomical location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specificLocation" type="BodySite.SpecificLocation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The Specific and identified anatomical location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relativeLocation" type="BodySite.RelativeLocation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Qualifiers to identify non-specific location eg 5cm (distance) inferior (aspect) to the tibial tuberosity (landmark). There may be more than one relative location required to provide a cross reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Description of anatomical location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="image" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Image or images used to identify a location.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="BodySite.SpecificLocation">
    <xs:annotation>
      <xs:documentation>Record details about the anatomical location of a specimen or body part, including precise localisation information.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Named anatomical location - ideally would be coded where possible.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="side" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specify lateraility of the anatomical location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Identify the specific anatomical site out of multiple eg tenth rib; fourth vertebra; second toe.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="anatomicalPlane" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Line describing the position of a vertical anatomical plane in the body.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="BodySite.RelativeLocation">
    <xs:annotation>
      <xs:documentation>Record details about the anatomical location of a specimen or body part, including precise localisation information.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="landmark" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identified anatomical landmark from which to specify relative anatomical location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="aspect" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Qualifier to identify which direction the anatomical location is in relation to the identified landmark.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="distance" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>Distance of location from the identified landmark.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Bundle" type="Bundle">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Bundle">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</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="BundleType">
            <xs:annotation>
              <xs:documentation>Indicates the purpose of this bundle- how it was intended to be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="total" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Bundle.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A series of links that provide context to this bundle.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="entry" type="Bundle.Entry" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="signature" minOccurs="0" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation>XML Digital Signature - base64 encoded.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Link">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="relation" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The reference details for the link.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Entry">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The Base URL for the resource, if different to the base URL specified for the bundle as a whole.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="ResourceContainer">
            <xs:annotation>
              <xs:documentation>The Resources for the entry.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="search" type="Bundle.Search" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Information about the search process that lead to the creation of this entry.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="transaction" type="Bundle.Transaction" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Additional information about how this entry should be processed as part of a transaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="transactionResponse" type="Bundle.TransactionResponse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Additional information about how this entry should be processed as part of a transaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Search">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="0" maxOccurs="1" type="SearchEntryMode">
            <xs:annotation>
              <xs:documentation>Why this entry is in the result set - whether it's included as a match or because of an _include requirement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="score" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>When searching, the server's search ranking score for the entry.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Transaction">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="method" minOccurs="1" maxOccurs="1" type="HTTPVerb">
            <xs:annotation>
              <xs:documentation>The HTTP verb for this entry in either a update history, or a transaction/ transaction response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ifNoneMatch" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ifMatch" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Only perform the operation if the Etag value matches. For more information, see the API section &quot;Managing Resource Contention&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ifModifiedSince" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Only perform the operation if the last updated date matches. For more information, see the API section &quot;Managing Resource Contention&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ifNoneExist" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Instruct the server not to perform the create if a specified resource already exists. For further information, see &quot;Conditional Create&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.TransactionResponse">
    <xs:annotation>
      <xs:documentation>A container for a group of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The status code returned by processing this entry.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The location header created by processing this operation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="etag" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>The etag for the resource, it the operation for the entry produced a versioned resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="HTTPVerb-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="GET">
        <xs:annotation>
          <xs:documentation>HTTP GET.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="POST">
        <xs:annotation>
          <xs:documentation>HTTP POST.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PUT">
        <xs:annotation>
          <xs:documentation>HTTP PUT.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DELETE">
        <xs:annotation>
          <xs:documentation>HTTP DELETE.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="HTTPVerb">
    <xs:annotation>
      <xs:documentation>HTTP verbs (in the HTTP command line)</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="HTTPVerb-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchEntryMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="match">
        <xs:annotation>
          <xs:documentation>This resource matched the search specification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="include">
        <xs:annotation>
          <xs:documentation>This resource is returned because it is referred to from another resource in the search set.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchEntryMode">
    <xs:annotation>
      <xs:documentation>Why an entry is in the result set - whether it's included as a match or because of an _include requirement</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="SearchEntryMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="BundleType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="document">
        <xs:annotation>
          <xs:documentation>The bundle is a document. The first resource is a Composition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="message">
        <xs:annotation>
          <xs:documentation>The bundle is a message. The first resource is a MessageHeader.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transaction">
        <xs:annotation>
          <xs:documentation>The bundle is a transaction - intended to be processed by a server as an atomic commit.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transaction-response">
        <xs:annotation>
          <xs:documentation>The bundle is a transaction response.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history">
        <xs:annotation>
          <xs:documentation>The bundle is a list of resources from a _history interaction on a server.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="searchset">
        <xs:annotation>
          <xs:documentation>The bundle is a list of resources returned as a result of a search/query interaction, operation, or message.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="collection">
        <xs:annotation>
          <xs:documentation>The bundle is a set of resources collected into a single document for ease of distribution.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="BundleType">
    <xs:annotation>
      <xs:documentation>Indicates the purpose of a bundle- how it was intended to be used</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="BundleType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CarePlan" type="CarePlan">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CarePlan">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this care plan 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="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the patient/subject whose intended care is described by the plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CarePlanStatus">
            <xs:annotation>
              <xs:documentation>Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Indicates when the plan did (or is intended to) come into effect and end.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Identifies the most recent date on which the plan has been revised.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concern" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="CarePlan.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="goal" type="CarePlan.Goal" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Describes the intended objective(s) of carrying out the Care Plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="activity" type="CarePlan.Activity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>General notes about the care plan not covered elsewhere.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Participant">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates specific responsibility of an individual within the care plan.  E.g. &quot;Primary physician&quot;, &quot;Team coordinator&quot;, &quot;Caregiver&quot;, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="member" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The specific person or organization who is participating/expected to participate in the care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Goal">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of a specific desired objective of the care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CarePlanGoalStatus">
            <xs:annotation>
              <xs:documentation>Indicates whether the goal has been reached and is still considered relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Any comments related to the goal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concern" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Activity">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation>Internal reference that identifies the goals that this activity is intended to contribute towards meeting.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CarePlanActivityStatus">
            <xs:annotation>
              <xs:documentation>Identifies what progress is being made for the specific activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prohibited" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates that the described activity is one that must NOT be engaged in when following the plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actionResulting" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Notes about the execution of the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The details of the proposed activity represented in a specific resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="simple" type="CarePlan.Simple" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Simple">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CarePlanActivityCategory">
            <xs:annotation>
              <xs:documentation>High-level categorization of the type of activity in a care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Detailed description of the type of activity.  E.g. What lab test, what procedure, what kind of encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The period, timing or frequency upon which the described activity is to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="scheduledTiming" type="Timing"/>
            <xs:element name="scheduledPeriod" type="Period"/>
            <xs:element name="scheduledString" type="string"/>
          </xs:choice>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the facility where the activity will occur.  E.g. home, hospital, specific clinic, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies who's expected to be involved in the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="product" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the food, drug or other product being consumed or supplied in the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dailyAmount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>Identifies the quantity expected to be consumed in a given day.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>Identifies the quantity expected to be supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="details" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>This provides a textual description of constraints on the activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The plan is in development or awaiting use but is not yet intended to be acted upon.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The plan is intended to be followed and used as part of patient care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The plan is no longer in use and is not expected to be followed or used in patient care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.</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="CarePlanStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanActivityCategory-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="diet">
        <xs:annotation>
          <xs:documentation>Plan for the patient to consume food of a specified nature.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="drug">
        <xs:annotation>
          <xs:documentation>Plan for the patient to consume/receive a drug, vaccine or other product.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="encounter">
        <xs:annotation>
          <xs:documentation>Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="observation">
        <xs:annotation>
          <xs:documentation>Plan to capture information about a patient (vitals, labs, diagnostic images, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="procedure">
        <xs:annotation>
          <xs:documentation>Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="supply">
        <xs:annotation>
          <xs:documentation>Plan to provide something to the patient (medication, medical supply, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>Some other form of action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanActivityCategory">
    <xs:annotation>
      <xs:documentation>High-level categorization of the type of activity in a care plan.</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="CarePlanActivityCategory-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanGoalStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="achieved">
        <xs:annotation>
          <xs:documentation>The goal has been met and no further action is needed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sustaining">
        <xs:annotation>
          <xs:documentation>The goal has been met, but ongoing activity is needed to sustain the goal objective.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The goal is no longer being sought.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanGoalStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the goal has been met and is still being targeted</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="CarePlanGoalStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanActivityStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="not-started">
        <xs:annotation>
          <xs:documentation>Activity is planned but no action has yet been taken.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="scheduled">
        <xs:annotation>
          <xs:documentation>Appointment or other booking has occurred but activity has not yet begun.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>Activity has been started but is not yet complete.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation>Activity was started but has temporarily ceased with an expectation of resumption at a future time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The activities have been completed (more or less) as planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The activities have been ended prior to completion (perhaps even before they were started).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanActivityStatus">
    <xs:annotation>
      <xs:documentation>Indicates where the activity is at in its overall life cycle</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="CarePlanActivityStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CarePlan2" type="CarePlan2">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CarePlan2">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this care plan 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="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the patient/subject whose intended care is described by the plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CarePlan2Status">
            <xs:annotation>
              <xs:documentation>Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Indicates when the plan did (or is intended to) come into effect and end.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Identifies the most recent date on which the plan has been revised.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concern" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="CarePlan2.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>General notes about the care plan not covered elsewhere.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the intended objective(s) of carrying out the Care Plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="activity" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies an action that is planned to happen as part of the careplan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan2.Participant">
    <xs:annotation>
      <xs:documentation>Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates specific responsibility of an individual within the care plan.  E.g. &quot;Primary physician&quot;, &quot;Team coordinator&quot;, &quot;Caregiver&quot;, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="member" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The specific person or organization who is participating/expected to participate in the care plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlan2Status-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The plan is in development or awaiting use but is not yet intended to be acted upon.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The plan is intended to be followed and used as part of patient care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The plan is no longer in use and is not expected to be followed or used in patient care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlan2Status">
    <xs:annotation>
      <xs:documentation>Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.</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="CarePlan2Status-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ClaimResponse" type="ClaimResponse">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ClaimResponse">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request resource referrence.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who produced this adjudicated response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="RemittanceOutcome">
            <xs:annotation>
              <xs:documentation>Transaction status: error, complete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the status of the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payeeType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="ClaimResponse.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The first tier service adjudications for submitted services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additem" type="ClaimResponse.Additem" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The first tier service adjudications for payor added services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="error" type="ClaimResponse.Error" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Mutually exclusive with Services Provided (Item).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="totalCost" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The total cost of the services reported.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unallocDeductable" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The amount of deductable applied which was not allocated to any particular service line.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="totalBenefit" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentAdjustment" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Adjustment to the payment of this transaction which is not related to adjudication of this transaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentAdjustmentReason" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Reason for the payment adjustment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Estimated payment data.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentAmount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Payable less any payment adjustment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentRef" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Payment identifer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reserved" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Status of funds reservation (For provider, for Patient, None).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The form to be used for printing the content.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" type="ClaimResponse.Note" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Note text.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Item">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>A list of note references to the notes provided below.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The adjudications results.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ClaimResponse.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The second tier service adjudications for submitted services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Adjudication">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Monitory amount associated with the code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A non-monitary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Detail">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The adjudications results.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subdetail" type="ClaimResponse.Subdetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The third tier service adjudications for submitted services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Adjudication1">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Monitory amount associated with the code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A non-monitary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Subdetail">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication2" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The adjudications results.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Adjudication2">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Monitory amount associated with the code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A non-monitary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Additem">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>List of input service items which this service line is intended to replace.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>A code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee charged for the professional service or product..</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumberLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>A list of note references to the notes provided below.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication3" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The adjudications results.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ClaimResponse.Detail1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The second tier service adjudications for payor added services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Adjudication3">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Monitory amount associated with the code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A non-monitary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Detail1">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>A code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee charged for the professional service or product..</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication4" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The adjudications results.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Adjudication4">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Monitory amount associated with the code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A non-monitary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Error">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detailSequenceLinkId" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subdetailSequenceLinkId" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>An error code,froma specified code system, which details why the claim could not be adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Note">
    <xs:annotation>
      <xs:documentation>This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>An integer associated with each note which may be referred to from each service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The note purpose: Print/Display.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The note text.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ClinicalAssessment" type="ClinicalAssessment">
    <xs:annotation>
      <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ClinicalAssessment">
    <xs:annotation>
      <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</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="DomainResource">
        <xs:sequence>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient being asssesed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="assessor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The clinicial performing the assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The point in time at which the assessment was concluded (not when it was recorded).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="previous" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="problem" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>This a list of the general problems/conditions for a patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careplan" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="investigations" type="ClinicalAssessment.Investigations" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="protocol" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="summary" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A text summary of the investigations and the diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="ClinicalAssessment.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An specific diagnosis that was considered likely or relevant to ongoing treatment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="resolved" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Diagnoses/conditions resolved since the last assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruledOut" type="ClinicalAssessment.RuledOut" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Diagnosis considered not possible.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prognosis" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Estimate of likely outcome.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="plan" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Plan of action after assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Actions taken during assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClinicalAssessment.Investigations">
    <xs:annotation>
      <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A name/code for the group (&quot;set&quot;) of investigations. Typically, this will be something like &quot;signs&quot;, &quot;symptoms&quot;, &quot;clinical&quot;, &quot;diagnostic&quot;, but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A record of a specific investigation that was undertaken.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClinicalAssessment.Diagnosis">
    <xs:annotation>
      <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specific text of code for diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="cause" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Which investigations support diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClinicalAssessment.RuledOut">
    <xs:annotation>
      <xs:documentation>A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specific text of code for diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Grounds for elimination.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Communication" type="Communication">
    <xs:annotation>
      <xs:documentation>An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Communication">
    <xs:annotation>
      <xs:documentation>An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers associated with this Communication that are defined by business processes 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="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of message such as alert, notification, reminder, instruction, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sender" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payload" type="Communication.Payload" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Text, attachment(s), or resource(s) to be communicated to the recipient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="medium" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The communication medium, e.g., email, fax.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CommunicationStatus">
            <xs:annotation>
              <xs:documentation>The status of the transmission.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The encounter within which the communication was sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sent" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when this communication was sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="received" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when this communication arrived at the destination.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The reason or justification for the communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who is the focus of this communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Communication.Payload">
    <xs:annotation>
      <xs:documentation>An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>An individual message part for multi-part messages.</xs:documentation>
            </xs:annotation>
            <xs:element name="contentString" type="string"/>
            <xs:element name="contentAttachment" type="Attachment"/>
            <xs:element name="contentReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CommunicationStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The communication transmission is ongoing.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The message transmission is complete, i.e., delivered to the recipient's destination.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation>The communication transmission has been held by originating system/user request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>The receiving system has declined to accept the message.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="failed">
        <xs:annotation>
          <xs:documentation>There was a failure in transmitting the message out.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CommunicationStatus">
    <xs:annotation>
      <xs:documentation>The status of the communication</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="CommunicationStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CommunicationRequest" type="CommunicationRequest">
    <xs:annotation>
      <xs:documentation>A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CommunicationRequest">
    <xs:annotation>
      <xs:documentation>A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of message such as alert, notification, reminder, instruction, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sender" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payload" type="CommunicationRequest.Payload" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Text, attachment(s), or resource(s) to be communicated to the recipient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="medium" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The communication medium, e.g., email, fax.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requester" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CommunicationRequestStatus">
            <xs:annotation>
              <xs:documentation>The status of the proposal or order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The encounter within which the communication request was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="scheduledTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when this communication is to occur.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The reason or justification for the communication request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orderedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when the request was made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who is the focus of this communication request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CommunicationRequest.Payload">
    <xs:annotation>
      <xs:documentation>A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>An individual message part for multi-part messages.</xs:documentation>
            </xs:annotation>
            <xs:element name="contentString" type="string"/>
            <xs:element name="contentAttachment" type="Attachment"/>
            <xs:element name="contentReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CommunicationRequestStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation>The request has been proposed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The request has been planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>The request has been placed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="received">
        <xs:annotation>
          <xs:documentation>The receiving system has received the request but not yet decided whether it will be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The receiving system has accepted the order, but work has not yet commenced.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The work to fulfill the order is happening.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The work has been complete, the report(s) released, and no further work is planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation>The request has been held by originating system/user request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>The receiving system has declined to fulfill the request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="failed">
        <xs:annotation>
          <xs:documentation>The communication was attempted, but due to some procedural error, it could not be completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CommunicationRequestStatus">
    <xs:annotation>
      <xs:documentation>The status of the communication</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="CommunicationRequestStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Composition" type="Composition">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Composition">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The composition editing time, when the composition was last logically changed by the author.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Official human-readable label for the composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CompositionStatus">
            <xs:annotation>
              <xs:documentation>The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="confidentiality" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The code specifying the level of confidentiality of the Composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies who is responsible for the information in the composition.  (Not necessarily who typed it in.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="attester" type="Composition.Attester" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A participant who has attested to the accuracy of the composition/document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="custodian" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="Composition.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The clinical service, such as a colonoscopy or an appendectomy, being documented.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the clinical encounter or type of care this documentation is associated with.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="section" type="Composition.Section" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The root of the sections that make up the composition.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Attester">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="unbounded" type="CompositionAttestationMode">
            <xs:annotation>
              <xs:documentation>The type of attestation the authenticator offers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="time" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When composition was attested by the party.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who attested the composition in the specified way.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Event">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Full details for the event(s) the composition/documentation consents.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Section">
    <xs:annotation>
      <xs:documentation>A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code identifying the kind of content contained within the section. This must be consistent with the section title.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="section" type="Composition.Section" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A nested sub-section within this section.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The content (narrative and data) associated with the section.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ConceptMap" type="ConceptMap">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</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 concepts - either code systems or data elements, or classes in class models.</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="DomainResource">
        <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="0" 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="ContactPoint">
            <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:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The source value set that specifies the concepts that are being mapped.</xs:documentation>
            </xs:annotation>
            <xs:element name="sourceUri" type="uri"/>
            <xs:element name="sourceReference" type="Reference"/>
          </xs:choice>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <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 name="targetUri" type="uri"/>
            <xs:element name="targetReference" type="Reference"/>
          </xs:choice>
          <xs:element name="element" type="ConceptMap.Element" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Mappings for an individual concept in the source to one or more concepts in the target.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Element">
    <xs:annotation>
      <xs:documentation>A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="codeSystem" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Code System (if the source is a value value set that crosses more than one code system).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Identity (code or path) or the element/item 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 element 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 concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="element" 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="codeSystem" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The code system of the dependency code (if the source/dependency is a value set that cross code systems).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identity (code or path) or the element/item that the map depends on / refers to.</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 concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="codeSystem" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The code system of the target code (if the target is a value set that cross code systems).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Identity (code or path) or the element/item that the map refers to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="equivalence" minOccurs="1" maxOccurs="1" type="ConceptMapEquivalence">
            <xs:annotation>
              <xs:documentation>The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comments" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of status/issues in mapping that conveys additional information not represented in  the structured data.</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 elements. To properly execute this mapping, the specified element 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="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="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="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, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their 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:element name="Condition" type="Condition">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Condition">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this condition 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="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the patient who the condition record is associated with.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Encounter during which the condition was first asserted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="asserter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who takes responsibility for asserting the existence of the condition as part of the electronic record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateAsserted" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Estimated or actual date the condition/problem/diagnosis was first detected/suspected.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identification of the condition, problem or diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ConditionStatus">
            <xs:annotation>
              <xs:documentation>The clinical status of the condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="certainty" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The degree of confidence that this condition is correct.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A subjective assessment of the severity of the condition as evaluated by the clinician.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Estimated or actual date or date-time  the condition began, in the opinion of the clinician.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetDateTime" type="dateTime"/>
            <xs:element name="onsetAge" type="Age"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The date or estimated date that the condition resolved or went into remission. This is called &quot;abatement&quot; because of the many overloaded connotations associated with &quot;remission&quot; or &quot;resolution&quot; - Conditions are never really resolved, but they can abate.</xs:documentation>
            </xs:annotation>
            <xs:element name="abatementDate" type="date"/>
            <xs:element name="abatementAge" type="Age"/>
            <xs:element name="abatementBoolean" type="boolean"/>
          </xs:choice>
          <xs:element name="stage" type="Condition.Stage" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Clinical stage or grade of a condition. May include formal severity assessments.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="evidence" type="Condition.Evidence" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" type="Condition.Location" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The anatomical location where this condition manifests itself.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dueTo" type="Condition.DueTo" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="occurredFollowing" type="Condition.OccurredFollowing" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Stage">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="summary" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A simple summary of the stage such as &quot;Stage 3&quot;. The determination of the stage is disease-specific.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="assessment" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to a formal record of the evidence on which the staging assessment is based.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Evidence">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A manifestation or symptom that led to the recording of this condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Links to other relevant information, including pathology reports.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Location">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code that identifies the structural location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Detailed anatomical location information.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.DueTo">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="codeableConcept" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code that identifies the target of this relationship. The code takes the place of a detailed instance target.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Target of the relationship.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.OccurredFollowing">
    <xs:annotation>
      <xs:documentation>Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="codeableConcept" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code that identifies the target of this relationship. The code takes the place of a detailed instance target.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Target of the relationship.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="provisional">
        <xs:annotation>
          <xs:documentation>This is a tentative diagnosis - still a candidate that is under consideration.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="working">
        <xs:annotation>
          <xs:documentation>The patient is being treated on the basis that this is the condition, but it is still not confirmed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation>There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation>This condition has been ruled out by diagnostic and clinical evidence.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionStatus">
    <xs:annotation>
      <xs:documentation>The clinical status of the Condition or diagnosis</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="ConditionStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Conformance" type="Conformance">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Conformance">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The identifier that is used to identify this conformance statement 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 conformance statement 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="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A free text natural language name identifying the conformance statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of Organization publishing this conformance statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>Contacts for Organization relevant to this conformance statement.  The contacts may be a website, email, phone numbers, etc.</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 conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="ConformanceStatementStatus">
            <xs:annotation>
              <xs:documentation>The status of this conformance statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag to indicate that this conformance statement is 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="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date  (and optionally time) when the conformance statement was published.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="software" type="Conformance.Software" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Software that is covered by this conformance statement.  It is used when the profile describes the capabilities of a particular software version, independent of an installation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="implementation" type="Conformance.Implementation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fhirVersion" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>The version of the FHIR specification on which this conformance statement is based.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="acceptUnknown" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag that indicates whether the application accepts unknown elements as part of a resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="format" minOccurs="1" maxOccurs="unbounded" type="code">
            <xs:annotation>
              <xs:documentation>A list of the formats supported by this implementation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A list of profiles supported by the system. For a server, &quot;supported by the system&quot; means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rest" type="Conformance.Rest" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A definition of the restful capabilities of the solution, if any.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="messaging" type="Conformance.Messaging" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A description of the messaging capabilities of the solution.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="document" type="Conformance.Document" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A document definition.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Software">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</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>Name software is known by.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The version identifier for the software covered by this statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="releaseDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date this version of the software released.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Implementation">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Information about the specific installation that this conformance statement relates to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Rest">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="RestfulConformanceMode">
            <xs:annotation>
              <xs:documentation>Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Information about the system's restful capabilities that apply across all applications, such as security.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="security" type="Conformance.Security" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Information about security of implementation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="resource" type="Conformance.Resource" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A specification of the restful capabilities of the solution for a specific resource type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interaction" type="Conformance.Interaction1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A specification of restful operations supported by the system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="operation" type="Conformance.Operation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Definition of an operation or a named query and with its parameters and their meaning and type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentMailbox" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation>A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier &quot;http://hl7.org/fhir/documents/mailbox&quot;. Other specifications can declare their own identifier for this purpose.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Security">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="cors" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Server adds CORS headers when responding to requests - this enables javascript applications to use the server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Types of security services are supported/required by the system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>General description of how security works.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="certificate" type="Conformance.Certificate" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Certificates associated with security profiles.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Certificate">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Mime type for certificate.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="blob" minOccurs="0" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation>Actual certificate.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Resource">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</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>A type of resource exposed via the restful interface.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interaction" type="Conformance.Interaction" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies a restful operation supported by the solution.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="versioning" minOccurs="0" maxOccurs="1" type="ResourceVersionPolicy">
            <xs:annotation>
              <xs:documentation>Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="readHistory" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag for whether the server is able to return past versions as part of the vRead operation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="updateCreate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="conditionalCreate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag that indicates that the server supports conditional create.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="conditionalUpdate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag that indicates that the server supports conditional update.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="conditionalDelete" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>A flag that indicates that the server supports conditional delete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="searchInclude" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A list of _include values supported by the server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="searchParam" type="Conformance.SearchParam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Interaction">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="TypeRestfulInteraction">
            <xs:annotation>
              <xs:documentation>Coded identifier of the operation, supported by the system resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.SearchParam">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</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 search parameter used in the interface.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the 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="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.</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:element name="chain" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Chained names supported.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Interaction1">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="SystemRestfulInteraction">
            <xs:annotation>
              <xs:documentation>A coded identifier of the operation, supported by the system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Operation">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</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 _query parameter when the query is called.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Where the formal definition can be found.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Messaging">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>An address to which messages and/or replies are to be sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reliableCache" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement.  For example, process for becoming an authorized messaging exchange partner.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="Conformance.Event" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A description of the solution's support for an event at this end point.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Event">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>A coded identifier of a supported messaging event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="MessageSignificanceCategory">
            <xs:annotation>
              <xs:documentation>The impact of the content of the message.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="ConformanceEventMode">
            <xs:annotation>
              <xs:documentation>The mode of this event declaration - whether application is sender or receiver.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="protocol" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A list of the messaging transport protocol(s) identifiers, supported by this endpoint.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focus" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>A resource associated with the event.  This is the resource that defines the event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Information about the request for this event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Information about the response for this event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Guidance on how this event is handled, such as internal system trigger points, business rules, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Conformance.Document">
    <xs:annotation>
      <xs:documentation>A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="DocumentMode">
            <xs:annotation>
              <xs:documentation>Mode of this document declaration - whether application is producer or consumer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of how the application supports or uses the specified document profile.  For example, when are documents created, what action is taken with consumed documents, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A constraint on a resource used in the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DocumentMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="producer">
        <xs:annotation>
          <xs:documentation>The application produces documents of the specified type.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="consumer">
        <xs:annotation>
          <xs:documentation>The application consumes documents of the specified type.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DocumentMode">
    <xs:annotation>
      <xs:documentation>Whether the application produces or consumes documents</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="DocumentMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SystemRestfulInteraction-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="transaction">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="search-system">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history-system">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SystemRestfulInteraction">
    <xs:annotation>
      <xs:documentation>Operations supported by REST at the system level</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="SystemRestfulInteraction-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceVersionPolicy-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="no-version">
        <xs:annotation>
          <xs:documentation>VersionId meta-property is not suppoerted (server) or used (client).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="versioned">
        <xs:annotation>
          <xs:documentation>VersionId meta-property is suppoerted (server) or used (client).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="versioned-update">
        <xs:annotation>
          <xs:documentation>VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResourceVersionPolicy">
    <xs:annotation>
      <xs:documentation>How the system supports versioning for a resource</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="ResourceVersionPolicy-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RestfulConformanceMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="client">
        <xs:annotation>
          <xs:documentation>The application acts as a server for this resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="server">
        <xs:annotation>
          <xs:documentation>The application acts as a client for this resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RestfulConformanceMode">
    <xs:annotation>
      <xs:documentation>The mode of a RESTful conformance statement</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="RestfulConformanceMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TypeRestfulInteraction-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="read">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="vread">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="update">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="delete">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history-instance">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="validate">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history-type">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="create">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="search-type">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TypeRestfulInteraction">
    <xs:annotation>
      <xs:documentation>Operations supported by REST at the type or instance level</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="TypeRestfulInteraction-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConformanceEventMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="sender">
        <xs:annotation>
          <xs:documentation>The application sends requests and receives responses.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="receiver">
        <xs:annotation>
          <xs:documentation>The application receives requests and sends responses.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConformanceEventMode">
    <xs:annotation>
      <xs:documentation>The mode of a message conformance statement</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="ConformanceEventMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MessageSignificanceCategory-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Consequence">
        <xs:annotation>
          <xs:documentation>The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Currency">
        <xs:annotation>
          <xs:documentation>The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Notification">
        <xs:annotation>
          <xs:documentation>The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MessageSignificanceCategory">
    <xs:annotation>
      <xs:documentation>The impact of the content of a message</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="MessageSignificanceCategory-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConformanceStatementStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>This conformance statement is still under development.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>This conformance statement is ready for use in production systems.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation>This conformance statement has been withdrawn or superceded and should no longer be used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConformanceStatementStatus">
    <xs:annotation>
      <xs:documentation>The status of this conformance statement</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="ConformanceStatementStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Contract" type="Contract">
    <xs:annotation>
      <xs:documentation>A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Contract">
    <xs:annotation>
      <xs:documentation>A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Unique Id for this contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Who and/or what this is about: typically Patient, Organization, property.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authority" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="domain" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Type of contract (Privacy-Security, Agreement, Insurance).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subtype" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this was issued.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="applies" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Relevant time/time-period when applicable.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The unit price product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Contract author or responsible party.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="grantor" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>First Party to the contract, may be the party who confers or delegates the rights defined in the contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="grantee" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="witness" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Who witnesses the contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="executor" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>First Party to the contract, may be the party who confers or delegates the rights defined in the contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notary" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>First Party to the contract, may be the party who confers or delegates the rights defined in the contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="signer" type="Contract.Signer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>List or contract signatures.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="term" type="Contract.Term" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="binding" minOccurs="0" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation>Legally binding contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bindingDateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Relevant time/time-period when applicable.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="friendly" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Friendly Human readable form (might be a reference to the UI used to capture the contract).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="friendlyDateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Relevant time/time-period when applicable.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="legal" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Legal text in Human readable form.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="legalDateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Relevant time/time-period when applicable.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rule" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Computable Policy rules (e.g. XACML, DKAL, SecPal).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleDateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Relevant time/time-period when applicable.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Signer">
    <xs:annotation>
      <xs:documentation>A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Party or role who is signing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="signature" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The DSIG signature contents in Base64.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Term">
    <xs:annotation>
      <xs:documentation>A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Unique Id for this particular term.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of the term.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subtype" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The subtype of the term which is appropriate to the term type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who or what the contract term is about.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human readable form of the term of the contract.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this term was issued.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="applies" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Relevant time/time-period when the term is applicable.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The unit price product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Contraindication" type="Contraindication">
    <xs:annotation>
      <xs:documentation>Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient.  E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Contraindication">
    <xs:annotation>
      <xs:documentation>Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient.  E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</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="DomainResource">
        <xs:sequence>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the patient whose record the contraindication is associated with.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the general type of issue identified.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="implicated" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the resource representing the current activity or proposed activity that.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A textual explanation of the contraindication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date or date-time when the contraindication was initially identified.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the provider or software that identified the.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Business identifier associated with the contraindication record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mitigation" type="Contraindication.Mitigation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting.  Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contraindication.Mitigation">
    <xs:annotation>
      <xs:documentation>Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient.  E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Indicates when the mitigating action was documented.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Coverage" type="Coverage">
    <xs:annotation>
      <xs:documentation>Financial instrument which may be used to pay for or reimburse for health care products and services.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Coverage">
    <xs:annotation>
      <xs:documentation>Financial instrument which may be used to pay for or reimburse for health care products and services.</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="DomainResource">
        <xs:sequence>
          <xs:element name="issuer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The program or plan underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="plan" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subplan" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dependent" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A unique identifier for a dependent under the coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sequence" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>An optional counter for a particular instance of the identified coverage which increments upon each renewal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subscriber" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="network" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>The identifier for a community of providers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contract" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The policy(s) which constitute this insurance coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DataElement" type="DataElement">
    <xs:annotation>
      <xs:documentation>The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DataElement">
    <xs:annotation>
      <xs:documentation>The formal description of a single piece of information that can be gathered and reported.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.</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 data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.</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 data element.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <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="status" minOccurs="1" maxOccurs="1" type="ResourceDataElementStatus">
            <xs:annotation>
              <xs:documentation>The status of the data element.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date that the status for this business version of the data element became effective.  (I.e. Date the draft was created, date element became active or date element became retired).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The term used by humans to refer to the data element.  Should ideally be unique within the context in which the data element is expected to be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="granularity" minOccurs="0" maxOccurs="1" type="DataElementGranularity">
            <xs:annotation>
              <xs:documentation>Identifies how precise the data element is in its definition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A code that provides the meaning for a data element according to a particular terminology.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="question" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The default/suggested phrasing to use when prompting a human to capture the data element in question form (e.g. In a survey).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="label" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Provides a complete explanation of the meaning of the data element for human readability.</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="type" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The FHIR data type that is the type for data that corresponds to this data element.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>A sample value for this element demonstrating the type of information that would typically be captured.</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="exampleTime" type="time"/>
            <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="exampleReference" type="Reference"/>
            <xs:element name="exampleSampledData" type="SampledData"/>
            <xs:element name="exampleHumanName" type="HumanName"/>
            <xs:element name="exampleAddress" type="Address"/>
            <xs:element name="exampleContactPoint" type="ContactPoint"/>
            <xs:element name="exampleTiming" type="Timing"/>
            <xs:element name="exampleMeta" type="Meta"/>
            <xs:element name="exampleElementDefinition" type="ElementDefinition"/>
          </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:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Identifies the units of measure in which the data element should be captured or expressed.</xs:documentation>
            </xs:annotation>
            <xs:element name="unitsCodeableConcept" type="CodeableConcept"/>
            <xs:element name="unitsReference" type="Reference"/>
          </xs:choice>
          <xs:element name="binding" type="DataElement.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="DataElement.Mapping" 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="DataElement.Binding">
    <xs:annotation>
      <xs:documentation>The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <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:element name="valueSet" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Points to the value set that identifies the set of codes to be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DataElement.Mapping">
    <xs:annotation>
      <xs:documentation>The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <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="definitional" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.</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: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:simpleType name="DataElementGranularity-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="comparable">
        <xs:annotation>
          <xs:documentation>The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fully-specified">
        <xs:annotation>
          <xs:documentation>The data element is fully specified down to a single value set, single unit of measure, single data type, etc.  Multiple pieces of data associated with this data element are fully compareable.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="equivalent">
        <xs:annotation>
          <xs:documentation>The data element allows multiple units of measure having equivalent meaning.  E.g. &quot;cc&quot; (cubic centimeter) and &quot;mL&quot;.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="convertable">
        <xs:annotation>
          <xs:documentation>The data element allows multiple units of measure that are convertable between each other (e.g. Inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="scaleable">
        <xs:annotation>
          <xs:documentation>A convertable data element where unit conversions are different only by a power of 10.  E.g. g, mg, kg.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="flexible">
        <xs:annotation>
          <xs:documentation>The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DataElementGranularity">
    <xs:annotation>
      <xs:documentation>Indicates the degree of precision of the data element definition</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="DataElementGranularity-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceDataElementStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>This data element is still under development.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>This data element is ready for normal use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation>This data element 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="ResourceDataElementStatus">
    <xs:annotation>
      <xs:documentation>The lifecycle status of a Resource data element</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="ResourceDataElementStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Device" type="Device">
    <xs:annotation>
      <xs:documentation>This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Device">
    <xs:annotation>
      <xs:documentation>This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Unique instance identifiers assigned to a device by organizations like manufacturers, owners or regulatory agencies.   If the identifier identifies the type of device, Device.type should be used.   An example is the FDA Mandated Unique Device Identifier (UDI) which identifies an instance of a device uniquely if the serial number is present, .  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code or identifier to identify a kind of device   An example is the FDA Mandated Unique Device Identifier (UDI) which identifies a type of a device when the serial number is absent, otherwise it uniquely identifies the device instance and Device.identifier should be used instead of Device.type.  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A name of the manufacturer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="model" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The &quot;model&quot; - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manufactureDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The Date and time when the device was manufactured.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expiry" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and time beyond which this device is no longer valid or should not be used (if applicable).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Lot number assigned by the manufacturer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="owner" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>An organization that is responsible for the provision and ongoing maintenance of the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. &quot;in/with the patient&quot;), or a coded location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient information, if the resource is affixed to a person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>Contact details for an organization or a particular human that is responsible for the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A network address on which the device may be contacted directly.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceComponent" type="DeviceComponent">
    <xs:annotation>
      <xs:documentation>Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceComponent">
    <xs:annotation>
      <xs:documentation>Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.</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="DomainResource">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the specific component type as defined in the object-oriented or metric nomenclature partition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Describes the local assigned unique identification by the software. For example: handle ID.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastSystemChange" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Describes the timestamp for the most recent system change which includes device configuration or setting change.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the link to the parent resource. For example: Channel is linked to its VMD parent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="operationalStatus" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates current operational status of the device. For example: On, Off, Standby, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="parameterGroup" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="measurementPrinciple" minOccurs="0" maxOccurs="1" type="Measmnt-Principle">
            <xs:annotation>
              <xs:documentation>Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productionSpecification" type="DeviceComponent.ProductionSpecification" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Describes the production specification such as component revision, serial number, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="languageCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceComponent.ProductionSpecification">
    <xs:annotation>
      <xs:documentation>Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="specType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="componentId" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productionSpec" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Describes the printable string defining the component.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="Measmnt-Principle-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>Measurement principle isn't in the list.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="chemical">
        <xs:annotation>
          <xs:documentation>Measurement is done using chemical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="electrical">
        <xs:annotation>
          <xs:documentation>Measurement is done using electrical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="impedance">
        <xs:annotation>
          <xs:documentation>Measurement is done using impedance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="nuclear">
        <xs:annotation>
          <xs:documentation>Measurement is done using nuclear.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="optical">
        <xs:annotation>
          <xs:documentation>Measurement is done using optical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="thermal">
        <xs:annotation>
          <xs:documentation>Measurement is done using thermal.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="biological">
        <xs:annotation>
          <xs:documentation>Measurement is done using biological.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mechanical">
        <xs:annotation>
          <xs:documentation>Measurement is done using mechanical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="acoustical">
        <xs:annotation>
          <xs:documentation>Measurement is done using acoustical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="manual">
        <xs:annotation>
          <xs:documentation>Measurement is done using manual.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Measmnt-Principle">
    <xs:annotation>
      <xs:documentation>Different measurement principle supported by the device</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="Measmnt-Principle-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceMetric" type="DeviceMetric">
    <xs:annotation>
      <xs:documentation>Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceMetric">
    <xs:annotation>
      <xs:documentation>Describes a measurement, calculation or setting capability of a medical device.</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="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. 
It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unit" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the link to the  Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the link to the  DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.
An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="operationalState" minOccurs="0" maxOccurs="1" type="DeviceMetricOperationalState">
            <xs:annotation>
              <xs:documentation>Indicates current operational state of the device. For example: On, Off, Standby, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="measurementMode" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="color" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Describes the typical color of the representation of observations that have been generated for this DeviceMetric.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="DeviceMetricCategory">
            <xs:annotation>
              <xs:documentation>Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="measurementPeriod" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation>Describes the measurement repetition time. This is not
necessarily the same as the update
period.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="calibrationInfo" type="DeviceMetric.CalibrationInfo" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Describes the calibrations that have been performed or that are required to be performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceMetric.CalibrationInfo">
    <xs:annotation>
      <xs:documentation>Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="DeviceMetricCalibrationType">
            <xs:annotation>
              <xs:documentation>Describes the type of the calibration method.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="state" minOccurs="0" maxOccurs="1" type="DeviceMetricCalibrationState">
            <xs:annotation>
              <xs:documentation>Describes the state of the calibration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="time" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Describes the time last calibration has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricCalibrationState-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="not-calibrated">
        <xs:annotation>
          <xs:documentation>The metric has not been calibrated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calibration-required">
        <xs:annotation>
          <xs:documentation>The metric needs to be calibrated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calibrated">
        <xs:annotation>
          <xs:documentation>The metric has been calibrated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unspecified">
        <xs:annotation>
          <xs:documentation>The state of calibration of this metric is unspecified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricCalibrationState">
    <xs:annotation>
      <xs:documentation>Describes the state of a metric calibration</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="DeviceMetricCalibrationState-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricCalibrationType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="unspecified">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="offset">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="gain">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="two-point">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricCalibrationType">
    <xs:annotation>
      <xs:documentation>Describes the type of a metric calibration</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="DeviceMetricCalibrationType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricCategory-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="measurement">
        <xs:annotation>
          <xs:documentation>DeviceObservations generated for this DeviceMetric are measured.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="setting">
        <xs:annotation>
          <xs:documentation>DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calculation">
        <xs:annotation>
          <xs:documentation>DeviceObservations generated for this DeviceMetric are calculated.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unspecified">
        <xs:annotation>
          <xs:documentation>The category of this DeviceMetric is unspecified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricCategory">
    <xs:annotation>
      <xs:documentation>Describes the category of the metric</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="DeviceMetricCategory-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricOperationalState-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="on">
        <xs:annotation>
          <xs:documentation>The DeviceMetric is operating and will generate DeviceObservations.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="off">
        <xs:annotation>
          <xs:documentation>The DeviceMetric is not operating.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="standby">
        <xs:annotation>
          <xs:documentation>The DeviceMetric is operating, but will not generate any DeviceObservations.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricOperationalState">
    <xs:annotation>
      <xs:documentation>Describes the operational status of the DeviceMetric</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="DeviceMetricOperationalState-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceUseRequest" type="DeviceUseRequest">
    <xs:annotation>
      <xs:documentation>Represents a request for the use of a device.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceUseRequest">
    <xs:annotation>
      <xs:documentation>Represents a request for the use of a device.</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="DomainResource">
        <xs:sequence>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Body site where the device is to be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="DeviceUseRequestStatus">
            <xs:annotation>
              <xs:documentation>The status of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The details of the device  to be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>An encounter that provides additional context in which this request is made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers assigned to this order by the orderer or by the receiver.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Reason or justification for the use of this device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prnReason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orderedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when the request was made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recordedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time at which the request was made/recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who will use the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. &quot;Every 8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;; &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingTiming" type="Timing"/>
            <xs:element name="timingPeriod" type="Period"/>
            <xs:element name="timingDateTime" type="dateTime"/>
          </xs:choice>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="DeviceUseRequestPriority">
            <xs:annotation>
              <xs:documentation>Characterizes how quickly the  use of device must be initiated. Includes concepts such as stat, urgent, routine.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceUseRequestStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation>The request has been proposed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The request has been planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>The request has been placed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="received">
        <xs:annotation>
          <xs:documentation>The receiving system has received the request but not yet decided whether it will be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The receiving system has accepted the request but work has not yet commenced.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The work to fulfill the order is happening.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The work has been complete, the report(s) released, and no further work is planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation>The request has been held by originating system/user request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>The receiving system has declined to fulfill the request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="aborted">
        <xs:annotation>
          <xs:documentation>The request was attempted, but due to some procedural error, it could not be completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceUseRequestStatus">
    <xs:annotation>
      <xs:documentation>Codes representing the status of the request</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="DeviceUseRequestStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceUseRequestPriority-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="routine">
        <xs:annotation>
          <xs:documentation>The request has a normal priority.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="urgent">
        <xs:annotation>
          <xs:documentation>The request should be done urgently.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stat">
        <xs:annotation>
          <xs:documentation>The request is time-critical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="asap">
        <xs:annotation>
          <xs:documentation>The request should be acted on as soon as possible.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceUseRequestPriority">
    <xs:annotation>
      <xs:documentation>Codes representing the priority of the request</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="DeviceUseRequestPriority-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceUseStatement" type="DeviceUseStatement">
    <xs:annotation>
      <xs:documentation>A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceUseStatement">
    <xs:annotation>
      <xs:documentation>A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</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="DomainResource">
        <xs:sequence>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Body site where the device was used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="whenUsed" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The time period over which the device was used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The details of the device used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>An external identifier for this statement such as an IRI.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Reason or justification for the use of the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recordedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time at which the statement was made/recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who used the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>How often the device was used.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingTiming" type="Timing"/>
            <xs:element name="timingPeriod" type="Period"/>
            <xs:element name="timingDateTime" type="dateTime"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DiagnosticOrder" type="DiagnosticOrder">
    <xs:annotation>
      <xs:documentation>A request for a diagnostic investigation service to be performed.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DiagnosticOrder">
    <xs:annotation>
      <xs:documentation>A request for a diagnostic investigation service to be performed.</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="DomainResource">
        <xs:sequence>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orderer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner that holds legal responsibility for ordering the investigation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers assigned to this order by the order or by the receiver.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="clinicalNotes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An explanation or justification for why this diagnostic investigation is being requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Additional clinical information about the patient or specimen that may influence test interpretations.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>One or more specimens that the diagnostic investigation is about.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="DiagnosticOrderStatus">
            <xs:annotation>
              <xs:documentation>The status of the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="DiagnosticOrderPriority">
            <xs:annotation>
              <xs:documentation>The clinical priority associated with this order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="DiagnosticOrder.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="DiagnosticOrder.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DiagnosticOrder.Event">
    <xs:annotation>
      <xs:documentation>A request for a diagnostic investigation service to be performed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DiagnosticOrderStatus">
            <xs:annotation>
              <xs:documentation>The status for the event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Additional information about the event that occurred - e.g. if the status remained unchanged.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date/time at which the event occurred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person who was responsible for performing or recording the action.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DiagnosticOrder.Item">
    <xs:annotation>
      <xs:documentation>A request for a diagnostic investigation service to be performed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>If the item is related to a specific specimen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Anatomical location where the request test should be performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="bodySiteCodeableConcept" type="CodeableConcept"/>
            <xs:element name="bodySiteReference" type="Reference"/>
          </xs:choice>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="DiagnosticOrderStatus">
            <xs:annotation>
              <xs:documentation>The status of this individual item within the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="DiagnosticOrder.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A summary of the events of interest that have occurred as this item of the request is processed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DiagnosticOrderStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>The request has been placed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="received">
        <xs:annotation>
          <xs:documentation>The receiving system has received the order, but not yet decided whether it will be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The receiving system has accepted the order, but work has not yet commenced.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The work to fulfill the order is happening.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="review">
        <xs:annotation>
          <xs:documentation>The work is complete, and the outcomes are being reviewed for approval.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The work has been complete, the report(s) released, and no further work is planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation>The request has been held by originating system/user request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>The receiving system has declined to fulfill the request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="failed">
        <xs:annotation>
          <xs:documentation>The diagnostic investigation was attempted, but due to some procedural error, it could not be completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DiagnosticOrderStatus">
    <xs:annotation>
      <xs:documentation>The status of a diagnostic order</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="DiagnosticOrderStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DiagnosticOrderPriority-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="routine">
        <xs:annotation>
          <xs:documentation>The order has a normal priority.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="urgent">
        <xs:annotation>
          <xs:documentation>The order should be urgently.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stat">
        <xs:annotation>
          <xs:documentation>The order is time-critical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="asap">
        <xs:annotation>
          <xs:documentation>The order should be acted on as soon as possible.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DiagnosticOrderPriority">
    <xs:annotation>
      <xs:documentation>The clinical priority of a diagnostic order</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="DiagnosticOrderPriority-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <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="DomainResource">
        <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="Reference">
            <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="Reference">
            <xs:annotation>
              <xs:documentation>The diagnostic service that is responsible for issuing the report.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The link to the health care event (encounter) when the order was made.</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="Reference">
            <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="Reference">
            <xs:annotation>
              <xs:documentation>Details about the specimens on which this diagnostic report is based.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="result" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <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="Reference">
            <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="Reference">
            <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:element name="DocumentManifest" type="DocumentManifest">
    <xs:annotation>
      <xs:documentation>A manifest that defines a set of documents.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DocumentManifest">
    <xs:annotation>
      <xs:documentation>A manifest that defines a set of documents.</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="DomainResource">
        <xs:sequence>
          <xs:element name="masterIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Other identifiers associated with the document, including version independent, source record and workflow related identifiers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A patient, practitioner, or organization for which this set of documents is intended.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies who is responsible for adding the information to the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Identifies the source system, application, or software that produced the document manifest.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DocumentReferenceStatus">
            <xs:annotation>
              <xs:documentation>The status of this document manifest.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supercedes" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Whether this document manifest replaces another.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of the source document. This is sometimes known as the &quot;title&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="confidentiality" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code specifying the level of confidentiality of this set of Documents.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DocumentReference" type="DocumentReference">
    <xs:annotation>
      <xs:documentation>A reference to a document.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DocumentReference">
    <xs:annotation>
      <xs:documentation>A reference to a document.</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="DomainResource">
        <xs:sequence>
          <xs:element name="masterIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Other identifiers associated with the document, including version independent, source record and workflow related identifiers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type code specifies the precise type of document from the user perspective. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC.  (e.g. Patient Summary, Discharge Summary, Prescription, etc.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The class code specifying the high-level use classification of the document type (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="format" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation>An identifier that identifies the the document encoding, structure and template that the document conforms to beyond the base format indicated in the mimeType.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies who is responsible for adding the information to the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="custodian" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="policyManager" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>A reference to a domain or server that manages policies under which the document is accessed and/or made available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authenticator" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Which person or organization authenticates that this document is valid.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When the document was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indexed" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>When the document reference was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DocumentReferenceStatus">
            <xs:annotation>
              <xs:documentation>The status of this document reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="docStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The status of the underlying document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relatesTo" type="DocumentReference.RelatesTo" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Relationships that this document has with other document references that already exist.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of the source document. This is sometimes known as the &quot;title&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="confidentiality" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A set of Security-Tag codes specifying the level of privacy/security of the Document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>The document or url to the document along with critical metadata to prove content has integrity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="context" type="DocumentReference.Context" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The clinical context in which the document was prepared.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentReference.RelatesTo">
    <xs:annotation>
      <xs:documentation>A reference to a document.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="DocumentRelationshipType">
            <xs:annotation>
              <xs:documentation>The type of relationship that this document has with anther document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The target document of this relationship.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentReference.Context">
    <xs:annotation>
      <xs:documentation>A reference to a document.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="event" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The time period over which the service that is described by the document was provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facilityType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The kind of facility where the patient was seen.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DocumentRelationshipType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="replaces">
        <xs:annotation>
          <xs:documentation>This document logically replaces or supercedes the target document.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transforms">
        <xs:annotation>
          <xs:documentation>This document was generated by transforming the target document (e.g. format or language conversion).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="signs">
        <xs:annotation>
          <xs:documentation>This document is a signature of the target document.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appends">
        <xs:annotation>
          <xs:documentation>This document adds additional information to the target document.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DocumentRelationshipType">
    <xs:annotation>
      <xs:documentation>The type of relationship between documents</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="DocumentRelationshipType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EligibilityRequest" type="EligibilityRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EligibilityRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EligibilityResponse" type="EligibilityResponse">
    <xs:annotation>
      <xs:documentation>This resource provides eligibility and plan details from the processing of an Eligibility resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EligibilityResponse">
    <xs:annotation>
      <xs:documentation>This resource provides eligibility and plan details from the processing of an Eligibility resource.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request resource reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="RemittanceOutcome">
            <xs:annotation>
              <xs:documentation>Transaction status: error, complete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the status of the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who produced this adjudicated response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Encounter" type="Encounter">
    <xs:annotation>
      <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Encounter">
    <xs:annotation>
      <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier(s) by which this encounter is known.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EncounterState">
            <xs:annotation>
              <xs:documentation>planned | arrived | in-progress | onleave | finished | cancelled.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="statusHistory" type="Encounter.StatusHistory" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="1" maxOccurs="1" type="EncounterClass">
            <xs:annotation>
              <xs:documentation>inpatient | outpatient | ambulatory | emergency +.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient present at the encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="episodeOfCare" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="Encounter.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The main practitioner responsible for providing the service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fulfills" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The appointment that scheduled this encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The start and end time of the encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="length" minOccurs="0" maxOccurs="1" type="Duration">
            <xs:annotation>
              <xs:documentation>Quantity of time the encounter lasted. This excludes the time during leaves of absence.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the urgency of the encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="hospitalization" type="Encounter.Hospitalization" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Details about an admission to a clinic.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" type="Encounter.Location" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>List of locations at which the patient has been.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Department or team providing care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Another Encounter of which this encounter is a part of (administratively or in time).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.StatusHistory">
    <xs:annotation>
      <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EncounterState">
            <xs:annotation>
              <xs:documentation>planned | arrived | in-progress | onleave | finished | cancelled.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="1" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The time that the episode was in the specified status.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Participant">
    <xs:annotation>
      <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Role of participant in encounter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="individual" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Persons involved in the encounter other than the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Hospitalization">
    <xs:annotation>
      <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="preAdmissionIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Pre-admission identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="origin" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The location from which the patient came before admission.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="admitSource" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>From where patient was admitted (physician referral, transfer).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diet" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Dietary restrictions for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specialCourtesy" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Special courtesies (VIP, board member).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specialArrangement" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Wheelchair, translator, stretcher, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Location to which the patient is discharged.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dischargeDisposition" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Category or kind of location after discharge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dischargeDiagnosis" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reAdmission" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether this hospitalization is a readmission.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Location">
    <xs:annotation>
      <xs:documentation>An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="location" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The location where the encounter takes place.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="EncounterLocationStatus">
            <xs:annotation>
              <xs:documentation>The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Time period during which the patient was present at the location.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EncounterLocationStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The patient is planned to be moved to this location at some point in the future.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="present">
        <xs:annotation>
          <xs:documentation>The patient is currently at this location, or was between the period specified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reserved">
        <xs:annotation>
          <xs:documentation>This location is held empty for this patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EncounterLocationStatus">
    <xs:annotation>
      <xs:documentation>The status of the location</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="EncounterLocationStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EnrollmentRequest" type="EnrollmentRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the insurance Enrollment details to the insurer regarding a specified coverage.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EnrollmentRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the insurance Enrollment details to the insurer regarding a specified coverage.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EnrollmentResponse" type="EnrollmentResponse">
    <xs:annotation>
      <xs:documentation>This resource provides Enrollment and plan details from the processing of an Enrollment resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EnrollmentResponse">
    <xs:annotation>
      <xs:documentation>This resource provides Enrollment and plan details from the processing of an Enrollment resource.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request resource reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="RemittanceOutcome">
            <xs:annotation>
              <xs:documentation>Transaction status: error, complete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the status of the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who produced this adjudicated response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EpisodeOfCare" type="EpisodeOfCare">
    <xs:annotation>
      <xs:documentation>An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EpisodeOfCare">
    <xs:annotation>
      <xs:documentation>An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier(s) by which this EpisodeOfCare is known.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="currentStatus" minOccurs="1" maxOccurs="1" type="EpisodeOfCareStatus">
            <xs:annotation>
              <xs:documentation>planned | active | onhold | finished | withdrawn | other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="statusHistory" type="EpisodeOfCare.StatusHistory" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The status history for the EpisodeOfCare.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type can be very important in processing as this could be used in determining if the episodeofcare is relevant to specific government reporting, or other types of classifications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient that this episodeofcare applies to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization that has assumed the specific responsibilities for the specified duration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The interval during which the managing organization assumes the defined responsibility.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referralRequest" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A Referral Request that this EpisodeOfCare manages activities within.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careManager" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner that is the care manager/care co-ordinator for this patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careTeam" type="EpisodeOfCare.CareTeam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The list of practitioners that may be facilitating this episode of care for specific purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EpisodeOfCare.StatusHistory">
    <xs:annotation>
      <xs:documentation>An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EpisodeOfCareStatus">
            <xs:annotation>
              <xs:documentation>planned | active | onhold | finished | withdrawn | other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="1" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period during this episodeofcare that the specific status applied.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EpisodeOfCare.CareTeam">
    <xs:annotation>
      <xs:documentation>An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="member" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner within the team.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The role that this team member is taking within this episode of care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time that this practitioner is performing some role within the episode of care.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EpisodeOfCareStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>This episode of care is current.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="onhold">
        <xs:annotation>
          <xs:documentation>This episode of care is on hold, the organization has limitted responsibility for the patient (such as while on respite).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="finished">
        <xs:annotation>
          <xs:documentation>This episode of care is finished at the organization is not expecting to be providing care to the patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="withdrawn">
        <xs:annotation>
          <xs:documentation>The episode of care was withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>The status is outside one of these values, an extension should be used to define what the status reason is.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EpisodeOfCareStatus">
    <xs:annotation>
      <xs:documentation>The status of the encounter</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="EpisodeOfCareStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ExplanationOfBenefit" type="ExplanationOfBenefit">
    <xs:annotation>
      <xs:documentation>This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ExplanationOfBenefit">
    <xs:annotation>
      <xs:documentation>This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request resource reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="RemittanceOutcome">
            <xs:annotation>
              <xs:documentation>Transaction status: error, complete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the status of the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who produced this adjudicated response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ExtensionDefinition" type="ExtensionDefinition">
    <xs:annotation>
      <xs:documentation>Defines an extension that can be used in resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ExtensionDefinition">
    <xs:annotation>
      <xs:documentation>Defines an extension that can be used in resources.</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="DomainResource">
        <xs:sequence>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance  (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).</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 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="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Details of the individual or organization who accepts responsibility for publishing the extension definition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <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 extension 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 extension definitions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ResourceProfileStatus">
            <xs:annotation>
              <xs:documentation>The status of the extension.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>This extension definition 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 extension 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 extension was created to meet.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="ExtensionDefinition.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="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="element" minOccurs="1" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation>Definition of the elements that are defined to be in the extension.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExtensionDefinition.Mapping">
    <xs:annotation>
      <xs:documentation>Defines an extension that can be used in resources.</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:element name="FamilyHistory" type="FamilyHistory">
    <xs:annotation>
      <xs:documentation>Significant health events and conditions for people related to the subject relevant in the context of care for the subject.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="FamilyHistory">
    <xs:annotation>
      <xs:documentation>Significant health events and conditions for people related to the subject relevant in the context of care for the subject.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this family history record that are defined by business processes 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="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person who this history concerns.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date (and possibly time) when the family history was taken.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Conveys information about family history not specific to individual relations.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relation" type="FamilyHistory.Relation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The related person. Each FamilyHistory resource contains the entire family history for a single person.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="FamilyHistory.Relation">
    <xs:annotation>
      <xs:documentation>Significant health events and conditions for people related to the subject relevant in the context of care for the subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>This will either be a name or a description.  E.g. &quot;Aunt Susan&quot;, &quot;my cousin with the red hair&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of relationship this person has to the patient (father, mother, brother etc.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The actual or approximate date of birth of the relative.</xs:documentation>
            </xs:annotation>
            <xs:element name="bornPeriod" type="Period"/>
            <xs:element name="bornDate" type="date"/>
            <xs:element name="bornString" type="string"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The actual or approximate age of the relative at the time the family history is recorded.</xs:documentation>
            </xs:annotation>
            <xs:element name="ageAge" type="Age"/>
            <xs:element name="ageRange" type="Range"/>
            <xs:element name="ageString" type="string"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.</xs:documentation>
            </xs:annotation>
            <xs:element name="deceasedBoolean" type="boolean"/>
            <xs:element name="deceasedAge" type="Age"/>
            <xs:element name="deceasedRange" type="Range"/>
            <xs:element name="deceasedDate" type="date"/>
            <xs:element name="deceasedString" type="string"/>
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" type="FamilyHistory.Condition" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="FamilyHistory.Condition">
    <xs:annotation>
      <xs:documentation>Significant health events and conditions for people related to the subject relevant in the context of care for the subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetAge" type="Age"/>
            <xs:element name="onsetRange" type="Range"/>
            <xs:element name="onsetString" type="string"/>
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An area where general notes can be placed about this specific condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Goal" type="Goal">
    <xs:annotation>
      <xs:documentation>Describes the intended objective(s) of the care.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Goal">
    <xs:annotation>
      <xs:documentation>Describes the intended objective(s) of the care.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this care plan 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="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the patient/subject whose intended care is described by the plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of a specific desired objective of care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="GoalStatus">
            <xs:annotation>
              <xs:documentation>Indicates whether the goal has been reached and is still considered relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Any comments related to the goal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concern" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GoalStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation>A goal is proposed for this patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>A goal is planned for this patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="achieved">
        <xs:annotation>
          <xs:documentation>The goal has been met and no further action is needed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sustaining">
        <xs:annotation>
          <xs:documentation>The goal has been met, but ongoing activity is needed to sustain the goal objective.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The goal is no longer being sought.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>A proposed goal was accepted.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>A proposed goal was rejected.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GoalStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the goal has been met and is still being targeted</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="GoalStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Group" type="Group">
    <xs:annotation>
      <xs:documentation>Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized.  I.e. A collection of entities that isn't an Organization.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Group">
    <xs:annotation>
      <xs:documentation>Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized.  I.e. A collection of entities that isn't an Organization.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>A unique business identifier for this group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="GroupType">
            <xs:annotation>
              <xs:documentation>Identifies the broad classification of the kind of resources the group includes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actual" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Provides a specific type of resource the group includes.  E.g. &quot;cow&quot;, &quot;syringe&quot;, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A label assigned to the group for human identification and communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A count of the number of resource instances that are part of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="characteristic" type="Group.Characteristic" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies the traits shared by members of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="member" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the resource instances that are members of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Group.Characteristic">
    <xs:annotation>
      <xs:documentation>Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized.  I.e. A collection of entities that isn't an Organization.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code that identifies the kind of trait being asserted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The value of the trait that holds (or does not hold - see 'exclude') for members of the group.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueCodeableConcept" type="CodeableConcept"/>
            <xs:element name="valueBoolean" type="boolean"/>
            <xs:element name="valueQuantity" type="Quantity"/>
            <xs:element name="valueRange" type="Range"/>
          </xs:choice>
          <xs:element name="exclude" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates the characteristic is one that is NOT held by members of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GroupType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="person">
        <xs:annotation>
          <xs:documentation>Group contains &quot;person&quot; Patient resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="animal">
        <xs:annotation>
          <xs:documentation>Group contains &quot;animal&quot; Patient resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="practitioner">
        <xs:annotation>
          <xs:documentation>Group contains healthcare practitioner resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="device">
        <xs:annotation>
          <xs:documentation>Group contains Device resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="medication">
        <xs:annotation>
          <xs:documentation>Group contains Medication resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="substance">
        <xs:annotation>
          <xs:documentation>Group contains Substance resources.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GroupType">
    <xs:annotation>
      <xs:documentation>Types of resources that are part of group</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="GroupType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="HealthcareService" type="HealthcareService">
    <xs:annotation>
      <xs:documentation>The details of a Healthcare Service available at a location.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="HealthcareService">
    <xs:annotation>
      <xs:documentation>The details of a Healthcare Service available at a location.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>External Ids for this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The location where this healthcare service may be provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceType" type="HealthcareService.ServiceType" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A specific type of service that may be delivered or performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Further description of the service as it would be presented to a consumer while searching.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional description of the  or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="extraDetails" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Extra details about the service that can't be placed in the other fields.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="freeProvisionCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="eligibility" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Does this service have specific eligibility requirements that need to be met in order to use the service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="eligibilityNote" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="appointmentRequired" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="imageURI" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>If there is an image associated with this Service Site, its URI can be included here.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="availableTime" type="HealthcareService.AvailableTime" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A Collection of times that the Service Site is available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notAvailableTime" type="HealthcareService.NotAvailableTime" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Not avail times - need better description.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="availabilityExceptions" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="publicKey" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="programName" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Program Names that can be used to categorize the service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contactPoint" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="characteristic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Collection of Characteristics (attributes).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referralMethod" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Ways that the service accepts referrals.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="setting" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The setting where this service can be provided, such is in home, or at location in organisation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="targetGroup" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Collection of Target Groups for the Service Site (The target audience that this service is for).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverageArea" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Need better description.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="catchmentArea" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Need better description.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>List of the specific.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HealthcareService.ServiceType">
    <xs:annotation>
      <xs:documentation>The details of a Healthcare Service available at a location.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The specific type of service being delivered or performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Collection of Specialties handled by the Service Site. This is more of a Medical Term.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HealthcareService.AvailableTime">
    <xs:annotation>
      <xs:documentation>The details of a Healthcare Service available at a location.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="daysOfWeek" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates which Days of the week are available between the Start and End Times.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="allDay" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="availableStartTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="availableEndTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HealthcareService.NotAvailableTime">
    <xs:annotation>
      <xs:documentation>The details of a Healthcare Service available at a location.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The reason that can be presented to the user as to why this time is not available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="startDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="endDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Service is not available (seasonally or for a public holiday) until this date.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImagingObjectSelection" type="ImagingObjectSelection">
    <xs:annotation>
      <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImagingObjectSelection">
    <xs:annotation>
      <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</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="DomainResource">
        <xs:sequence>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>Instance UID of the DICOM KOS SOP Instances represenetd in this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The reason for, or significance of, the selection of objects referenced in the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authoringTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="study" type="ImagingObjectSelection.Study" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Study identity and locating information of the DICOM SOP instances in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingObjectSelection.Study">
    <xs:annotation>
      <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>Study instance uid of the SOP instances in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="series" type="ImagingObjectSelection.Series" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Series indetity and locating information of the DICOM SOP instances in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingObjectSelection.Series">
    <xs:annotation>
      <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="uid" minOccurs="0" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>Series instance uid of the SOP instances in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="ImagingObjectSelection.Instance" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identity and locating information of the selected DICOM SOP instances.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingObjectSelection.Instance">
    <xs:annotation>
      <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sopClass" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>SOP class uid of the selected instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>SOP Instance uid of the selected instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS URL to retrieve the DICOM SOP Instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="frames" type="ImagingObjectSelection.Frames" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identity and location information of the frames in the selected instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingObjectSelection.Frames">
    <xs:annotation>
      <xs:documentation>A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc.  Objects selected can be from different studies, but must be of the same patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="frameNumbers" minOccurs="1" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>The frame numbers in the frame set.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS URL to retrieve the DICOM frames.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImagingStudy" type="ImagingStudy">
    <xs:annotation>
      <xs:documentation>Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImagingStudy">
    <xs:annotation>
      <xs:documentation>Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities.</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="DomainResource">
        <xs:sequence>
          <xs:element name="started" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date and Time the study started.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient for whom the images are of.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>Formal identifier for the study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accession" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Accession Number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Other identifiers for the study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="order" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>A list of the diagnostic orders that resulted in this imaging study being performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modalityList" minOccurs="0" maxOccurs="unbounded" type="ImagingModality">
            <xs:annotation>
              <xs:documentation>A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referrer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The requesting/referring physician.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="availability" minOccurs="0" maxOccurs="1" type="InstanceAvailability">
            <xs:annotation>
              <xs:documentation>Availability of study (online, offline or nearline).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS URI where Study is available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="numberOfSeries" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Number of Series in Study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="numberOfInstances" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Number of SOP Instances in Study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="clinicalInformation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Diagnoses etc provided with request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="procedure" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of procedure performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interpreter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who read study and interpreted the images.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Institution-generated description or classification of the Study (component) performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="series" type="ImagingStudy.Series" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Each study has one or more series of image instances.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingStudy.Series">
    <xs:annotation>
      <xs:documentation>Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The Numeric identifier of this series in the study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modality" minOccurs="1" maxOccurs="1" type="Modality">
            <xs:annotation>
              <xs:documentation>The modality of this series sequence.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>Formal identifier for this series.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the series.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="numberOfInstances" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Sequence that contains attributes from the.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="availability" minOccurs="0" maxOccurs="1" type="InstanceAvailability">
            <xs:annotation>
              <xs:documentation>Availability of series (online, offline or nearline).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS URI where Series is available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Body part examined. See  DICOM Part 16 Annex L for the mapping from DICOM to Snomed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the series was started.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="ImagingStudy.Instance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A single image taken from a patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingStudy.Instance">
    <xs:annotation>
      <xs:documentation>Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The number of this image in the series.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>Formal identifier for this image.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sopclass" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation>DICOM Image type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The type of the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The description of the instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>WADO-RS url where image is available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="attachment" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A FHIR resource with content for this instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ImagingModality-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="AR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BMD">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BDUS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EPS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DX">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ECG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ES">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="XC">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HD">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IO">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IVOCT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IVUS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="KER">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="LEN">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OAM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OCT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OP">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPV">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PX">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RF">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SRF">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="US">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VA">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="XA">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ImagingModality">
    <xs:annotation>
      <xs:documentation>Type of acquired image data in the 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="ImagingModality-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="InstanceAvailability-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ONLINE">
        <xs:annotation>
          <xs:documentation>Resources are immediately available,.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OFFLINE">
        <xs:annotation>
          <xs:documentation>Resources need to be retrieved by manual intervention.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NEARLINE">
        <xs:annotation>
          <xs:documentation>Resources need to be retrieved from relatively slow media.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UNAVAILABLE">
        <xs:annotation>
          <xs:documentation>Resources cannot be retrieved.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="InstanceAvailability">
    <xs:annotation>
      <xs:documentation>Availability of the resource</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="InstanceAvailability-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="Modality-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="AR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AU">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BDUS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BI">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BMD">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DX">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ECG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EPS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ES">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HC">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HD">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IO">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IVOCT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="IVUS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="KER">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="KO">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="LEN">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="LS">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OAM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OCT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OP">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OPV">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PX">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="REG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RF">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RTDOSE">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RTIMAGE">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RTPLAN">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RTRECORD">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RTSTRUCT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SEG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SM">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SMR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SR">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SRF">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TG">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="US">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VA">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="XA">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="XC">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Modality">
    <xs:annotation>
      <xs:documentation>Type of data in the 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="Modality-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Immunization" type="Immunization">
    <xs:annotation>
      <xs:documentation>Immunization event information.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Immunization">
    <xs:annotation>
      <xs:documentation>Immunization event information.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>A unique identifier assigned to this immunization record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date vaccine administered or was to be administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="vaccineType" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Vaccine that was administered or was to be administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who either received or did not receive the immunization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="wasNotGiven" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Indicates if the vaccination was or was not given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reported" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>True if this administration was reported rather than directly administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Clinician who administered the vaccine.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requester" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Clinician who ordered the vaccination.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The visit or admission or other contact between patient and health care provider the immunization was performed as part of.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Name of vaccine manufacturer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The service delivery location where the vaccine administration occurred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Lot number of the  vaccine product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expirationDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date vaccine batch expires.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Body site where vaccine was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The path by which the vaccine product is taken into the body.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="doseQuantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The quantity of vaccine product that was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="explanation" type="Immunization.Explanation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Reasons why a vaccine was or was not administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reaction" type="Immunization.Reaction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Categorical data indicating that an adverse event is associated in time to an immunization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="vaccinationProtocol" type="Immunization.VaccinationProtocol" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Contains information about the protocol(s) under which the vaccine was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.Explanation">
    <xs:annotation>
      <xs:documentation>Immunization event information.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Reasons why a vaccine was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reasonNotGiven" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Reason why a vaccine was not administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.Reaction">
    <xs:annotation>
      <xs:documentation>Immunization event information.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date of reaction to the immunization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Details of the reaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reported" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Self-reported indicator.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.VaccinationProtocol">
    <xs:annotation>
      <xs:documentation>Immunization event information.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="doseSequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Nominal position in a series.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Contains the description about the protocol under which the vaccine was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authority" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the authority who published the protocol?  E.g. ACIP.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="series" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="seriesDoses" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The recommended number of doses to achieve immunity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="doseTarget" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The targeted disease.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="doseStatus" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates if the immunization event should &quot;count&quot; against  the protocol.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="doseStatusReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Provides an explanation as to why a immunization event should or should not count against the protocol.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImmunizationRecommendation" type="ImmunizationRecommendation">
    <xs:annotation>
      <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImmunizationRecommendation">
    <xs:annotation>
      <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>A unique identifier assigned to this particular recommendation record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient for whom the recommendations are for.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recommendation" type="ImmunizationRecommendation.Recommendation" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Vaccine administration recommendations.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImmunizationRecommendation.Recommendation">
    <xs:annotation>
      <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date the immunization recommendation was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="vaccineType" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Vaccine that pertains to the recommendation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="doseNumber" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="forecastStatus" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Vaccine administration status.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateCriterion" type="ImmunizationRecommendation.DateCriterion" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="protocol" type="ImmunizationRecommendation.Protocol" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Contains information about the protocol under which the vaccine was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supportingImmunization" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Immunization event history that supports the status and recommendation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supportingPatientInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImmunizationRecommendation.DateCriterion">
    <xs:annotation>
      <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date recommendation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImmunizationRecommendation.Protocol">
    <xs:annotation>
      <xs:documentation>A patient's point-of-time immunization status and recommendation with optional supporting justification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="doseSequence" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Indicates the nominal position in a series of the next dose.  This is the recommended dose number as per a specified protocol.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Contains the description about the protocol under which the vaccine was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authority" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the authority who published the protocol?  E.g. ACIP.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="series" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="InstitutionalClaim" type="InstitutionalClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="InstitutionalClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification on which this instance relies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification from which the original instance was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Insurer Identifier, typical BIN number (6 digit).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation>Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facility" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Facility where the services were provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="InstitutionalClaim.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The party to be reimbursed for the services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The referral resource which lists the date, practitioner, reason and other supporting information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="InstitutionalClaim.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Ordered list of patient diagnosis for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>List of patient conditions for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="InstitutionalClaim.Coverage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Financial instrument by which payment information for health care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exception" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Factors which may influence the applicability of coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="school" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of school for over-aged dependants.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accident" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date of an accident which these services are addressing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accidentType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of accident: work, auto, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interventionException" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A list of intervention and exception codes which may influence the adjudication of the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="InstitutionalClaim.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>First tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additionalMaterials" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InstitutionalClaim.Payee">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InstitutionalClaim.Diagnosis">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Sequence of diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InstitutionalClaim.Coverage">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preauthref" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A list of references from the Insurer to which these services pertain.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Coverages adjudication details.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InstitutionalClaim.Item">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>Diagnosis applicable for this service or product line.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Physical service site on the patient (limb, tooth, etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subsite" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A region or surface of the site, eg. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="InstitutionalClaim.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Second tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InstitutionalClaim.Detail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="InstitutionalClaim.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Third tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InstitutionalClaim.SubDetail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="List" type="List">
    <xs:annotation>
      <xs:documentation>A set of information summarized from a list of other resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="List">
    <xs:annotation>
      <xs:documentation>A set of information summarized from a list of other resources.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier for the List assigned for business purposes outside the context of FHIR.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This code defines the purpose of the list - why it was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The common subject (or patient) of the resources that are in the list, if there is one.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The entity responsible for deciding what the contents of the list were.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date that the list was prepared.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ordered" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether items in the list have a meaningful order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="ListMode">
            <xs:annotation>
              <xs:documentation>How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="entry" type="List.Entry" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Entries in this list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="emptyReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>If the list is empty, why the list is empty.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="List.Entry">
    <xs:annotation>
      <xs:documentation>A set of information summarized from a list of other resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="flag" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="deleted" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>True if this item is marked as deleted in the list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this item was added to the list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A reference to the actual resource from which data was derived.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ListMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="working">
        <xs:annotation>
          <xs:documentation>This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="snapshot">
        <xs:annotation>
          <xs:documentation>This list was prepared as a snapshot. It should not be assumed to be current.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="changes">
        <xs:annotation>
          <xs:documentation>The list is prepared as a statement of changes that have been made or recommended.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ListMode">
    <xs:annotation>
      <xs:documentation>The processing mode that applies to this list</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="ListMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Location" type="Location">
    <xs:annotation>
      <xs:documentation>Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Location">
    <xs:annotation>
      <xs:documentation>Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Unique code or number identifying the location to its users.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of the location as used by humans. Does not need to be unique.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Description of the Location, which helps in finding or referencing the place.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of function performed at the location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation>Physical location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="physicalType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Physical form of the location, e.g. building, room, vehicle, road.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="position" type="Location.Position" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization that is responsible for the provisioning and upkeep of the location.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="LocationStatus">
            <xs:annotation>
              <xs:documentation>active | suspended | inactive.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Another Location which this Location is physically part of.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="0" maxOccurs="1" type="LocationMode">
            <xs:annotation>
              <xs:documentation>Indicates whether a resource instance represents a specific location or a class of locations.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Location.Position">
    <xs:annotation>
      <xs:documentation>Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="longitude" minOccurs="1" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="latitude" minOccurs="1" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="altitude" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LocationStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The location is operational.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation>The location is temporarily closed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation>The location is no longer used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LocationStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the location is still in use</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="LocationStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LocationMode-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="instance">
        <xs:annotation>
          <xs:documentation>The Location resource represents a specific instance of a Location.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="kind">
        <xs:annotation>
          <xs:documentation>The Location represents a class of Locations.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LocationMode">
    <xs:annotation>
      <xs:documentation>Indicates whether a resource instance represents a specific location or a class of locations</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="LocationMode-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <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="DomainResource">
        <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="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date/time when the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the start of the recording.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <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="Reference">
            <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="duration" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The duration 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:element name="Medication" type="Medication">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Medication">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</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="DomainResource">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The common/commercial name of the medication absent information such as strength, form, etc.  E.g. Acetaminophen, Tylenol 3, etc.  The fully coordinated name is communicated as the display of Medication.code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code (or set of codes) that identify this medication.   Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="isBrand" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Describes the details of the manufacturer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="0" maxOccurs="1" type="MedicationKind">
            <xs:annotation>
              <xs:documentation>Medications are either a single administrable product or a package that contains one or more products.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="product" type="Medication.Product" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Information that only applies to products (not packages).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="package" type="Medication.Package" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Information that only applies to packages (not products).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Product">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes the form of the item.  Powder; tables; carton.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ingredient" type="Medication.Ingredient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Identifies a particular constituent of interest in the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="batch" type="Medication.Batch" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Information about a group of medication produced or packaged from one production run.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Ingredient">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The actual ingredient - either a substance (simple ingredient) or another medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>Specifies how many (or how much) of the items there are in this Medication.  E.g. 250 mg per tablet.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Batch">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The assigned lot number of a batch of the specified product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expirationDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this specific batch of product will expire.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Package">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="container" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The kind of container that this package comes as.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" type="Medication.Content" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A set of components that go to make up the described item.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Content">
    <xs:annotation>
      <xs:documentation>Primarily used for identification and definition of Medication, but also covers ingredients and packaging.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies one of the items in the package.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of the product that is in the package.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationKind-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="product">
        <xs:annotation>
          <xs:documentation>The medication is a product.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="package">
        <xs:annotation>
          <xs:documentation>The medication is a package - a contained group of one of more products.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationKind">
    <xs:annotation>
      <xs:documentation>Whether the medication is a product or a package</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="MedicationKind-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationAdministration" type="MedicationAdministration">
    <xs:annotation>
      <xs:documentation>Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.

Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationAdministration">
    <xs:annotation>
      <xs:documentation>Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.

Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="MedicationAdministrationStatus">
            <xs:annotation>
              <xs:documentation>Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person or animal to whom the medication was given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="practitioner" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The individual who was responsible for giving the medication to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The original request, instruction or authority to perform the administration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="wasNotGiven" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Set this to true if the record is saying that the medication was NOT administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reasonNotGiven" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code indicating why the administration was not performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reasonGiven" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code indicating why the medication was given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true).  For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveTimeDateTime" type="dateTime"/>
            <xs:element name="effectiveTimePeriod" type="Period"/>
          </xs:choice>
          <xs:element name="medication" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The device used in administering the medication to the patient.  E.g. a particular infusion pump.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Extra information about the medication administration that is not conveyed by the other attributes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dosage" type="MedicationAdministration.Dosage" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates how the medication is/was used by the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationAdministration.Dosage">
    <xs:annotation>
      <xs:documentation>Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.

Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded specification of the anatomic site where the medication first entered the body.  E.g. &quot;left arm&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.   E.g. topical, intravenous, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections.  Examples:  Slow Push; Deep IV.

Terminologies used often pre-coordinate this term with the route and or form of administration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rate" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours.  May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationAdministrationStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The administration has started but has not yet completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation>Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called &quot;suspended&quot;.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>All actions that are implied by the administration have occurred.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>The administration was entered in error and therefore nullified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation>Actions implied by the administration have been permanently halted, before all of them occurred.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationAdministrationStatus">
    <xs:annotation>
      <xs:documentation>A set of codes indicating the current status of a MedicationAdministration</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="MedicationAdministrationStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationDispense" type="MedicationDispense">
    <xs:annotation>
      <xs:documentation>Dispensing a medication to a named patient.  This includes a description of the supply provided and the instructions for administering the medication.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationDispense">
    <xs:annotation>
      <xs:documentation>Dispensing a medication to a named patient.  This includes a description of the supply provided and the instructions for administering the medication.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="MedicationDispenseStatus">
            <xs:annotation>
              <xs:documentation>A code specifying the state of the set of dispense events.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A link to a resource representing the person to whom the medication will be given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dispenser" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The individual responsible for dispensing the medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authorizingPrescription" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the medication order that is being dispensed against.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of medication that has been dispensed. Includes unit of measure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="daysSupply" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of medication expressed as a timing amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="medication" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="whenPrepared" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when the dispensed product was packaged and reviewed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="whenHandedOver" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time the dispensed product was provided to the patient or their representative.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identification of the facility/location where the medication was shipped to, as part of the dispense event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="receiver" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the person who picked up the medication.  This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Extra information about the dispense that could not be conveyed in the other attributes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dosageInstruction" type="MedicationDispense.DosageInstruction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Indicates how the medication is to be used by the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="substitution" type="MedicationDispense.Substitution" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates whether or not substitution was made as part of the dispense.  In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen.  This block explains what substitition did or did not happen and why.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationDispense.DosageInstruction">
    <xs:annotation>
      <xs:documentation>Dispensing a medication to a named patient.  This includes a description of the supply provided and the instructions for administering the medication.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="additionalInstructions" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Additional instructions such as &quot;Swallow with plenty of water&quot; which may or may not be coded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  &quot;Every  8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;;  &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>
            </xs:annotation>
            <xs:element name="scheduleDateTime" type="dateTime"/>
            <xs:element name="schedulePeriod" type="Period"/>
            <xs:element name="scheduleTiming" type="Timing"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose.  If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.</xs:documentation>
            </xs:annotation>
            <xs:element name="asNeededBoolean" type="boolean"/>
            <xs:element name="asNeededCodeableConcept" type="CodeableConcept"/>
          </xs:choice>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded specification of the anatomic site where the medication first enters the body.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections.  Examples:  Slow Push; Deep IV.

Terminologies used often pre-coordinate this term with the route and or form of administration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The amount of therapeutic or other substance given at one administration event.</xs:documentation>
            </xs:annotation>
            <xs:element name="doseRange" type="Range"/>
            <xs:element name="doseQuantity" type="Quantity"/>
          </xs:choice>
          <xs:element name="rate" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maxDosePerPeriod" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time,  e.g. 1000mg in 24 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationDispense.Substitution">
    <xs:annotation>
      <xs:documentation>Dispensing a medication to a named patient.  This includes a description of the supply provided and the instructions for administering the medication.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code signifying whether a different drug was dispensed from what was prescribed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="responsibleParty" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The person or organization that has primary responsibility for the substitution.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationDispenseStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The dispense has started but has not yet completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation>Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called &quot;suspended&quot;.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>All actions that are implied by the dispense have occurred.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>The dispense was entered in error and therefore nullified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation>Actions implied by the dispense have been permanently halted, before all of them occurred.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationDispenseStatus">
    <xs:annotation>
      <xs:documentation>A code specifying the state of the dispense event.</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="MedicationDispenseStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationPrescription" type="MedicationPrescription">
    <xs:annotation>
      <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationPrescription">
    <xs:annotation>
      <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created.  This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateWritten" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date (and perhaps time) when the prescription was written.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="MedicationPrescriptionStatus">
            <xs:annotation>
              <xs:documentation>A code specifying the state of the order.  Generally this will be active or completed state.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A link to a resource representing the person to whom the medication will be given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prescriber" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The healthcare professional responsible for authorizing the prescription.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A link to a resource that identifies the particular occurrence of contact between patient and health care provider.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Can be the reason or the indication for writing the prescription.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept"/>
            <xs:element name="reasonReference" type="Reference"/>
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Extra information about the prescription that could not be conveyed by the other attributes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="medication" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dosageInstruction" type="MedicationPrescription.DosageInstruction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Indicates how the medication is to be used by the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dispense" type="MedicationPrescription.Dispense" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Deals with details of the dispense part of the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="substitution" type="MedicationPrescription.Substitution" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationPrescription.DosageInstruction">
    <xs:annotation>
      <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additionalInstructions" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Additional instructions such as &quot;Swallow with plenty of water&quot; which may or may not be coded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  &quot;Every  8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;;  &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>
            </xs:annotation>
            <xs:element name="scheduledDateTime" type="dateTime"/>
            <xs:element name="scheduledPeriod" type="Period"/>
            <xs:element name="scheduledTiming" type="Timing"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose.  If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.</xs:documentation>
            </xs:annotation>
            <xs:element name="asNeededBoolean" type="boolean"/>
            <xs:element name="asNeededCodeableConcept" type="CodeableConcept"/>
          </xs:choice>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded specification of the anatomic site where the medication first enters the body.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections.  Examples:  Slow Push; Deep IV.

Terminologies used often pre-coordinate this term with the route and or form of administration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The amount of therapeutic or other substance given at one administration event.</xs:documentation>
            </xs:annotation>
            <xs:element name="doseRange" type="Range"/>
            <xs:element name="doseQuantity" type="Quantity"/>
          </xs:choice>
          <xs:element name="rate" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maxDosePerPeriod" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationPrescription.Dispense">
    <xs:annotation>
      <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="medication" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="validityPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) 
It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. 
Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="numberOfRepeatsAllowed" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>An integer indicating the number of repeats of the Dispense. 
UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount that is to be dispensed for one fill.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expectedSupplyDuration" minOccurs="0" maxOccurs="1" type="Duration">
            <xs:annotation>
              <xs:documentation>Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. 
In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationPrescription.Substitution">
    <xs:annotation>
      <xs:documentation>An order for both supply of the medication and the instructions for administration of the medicine to a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code signifying whether a different drug should be dispensed from what was prescribed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the reason for the substitution, or why substitution must or must not be performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationPrescriptionStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The prescription is 'actionable', but not all actions that are implied by it have occurred yet.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation>Actions implied by the prescription have been temporarily halted, but are expected to continue later.  May also be called &quot;suspended&quot;.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>All actions that are implied by the prescription have occurred (this will rarely be made explicit).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>The prescription was entered in error and therefore nullified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation>Actions implied by the prescription have been permanently halted, before all of them occurred.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="superceded">
        <xs:annotation>
          <xs:documentation>The prescription was replaced by a newer one, which encompasses all the information in the previous one.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>The prescription is not yet 'actionable', i.e. it is a work in progress, required sign-off, need to be run through decision support.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationPrescriptionStatus">
    <xs:annotation>
      <xs:documentation>A code specifying the state of the prescribing event. Describes the lifecycle of the prescription.</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="MedicationPrescriptionStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationStatement" type="MedicationStatement">
    <xs:annotation>
      <xs:documentation>A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationStatement">
    <xs:annotation>
      <xs:documentation>A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person or animal who is /was taking the medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="informationSource" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person who provided the information about the taking of this medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateAsserted" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the medication statement was asserted by the information source.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="MedicationStatementStatus">
            <xs:annotation>
              <xs:documentation>A code specifying the state of the statement.  Generally this will be in-progress or completed state.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="wasNotGiven" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Set this to true if the record is saying that the medication was NOT taken.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reasonNotGiven" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code indicating why the medication was not taken.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>A reason for why the medication is being/was taken.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonForUseCodeableConcept" type="CodeableConcept"/>
            <xs:element name="reasonForUseReference" type="Reference"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true).</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveDateTime" type="dateTime"/>
            <xs:element name="effectivePeriod" type="Period"/>
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Provides extra information about the medication statement that is not conveyed by the other attributes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="medication" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dosage" type="MedicationStatement.Dosage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Indicates how the medication is/was used by the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationStatement.Dosage">
    <xs:annotation>
      <xs:documentation>A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation>The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  &quot;Every  8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;;  &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose.  If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.</xs:documentation>
            </xs:annotation>
            <xs:element name="asNeededBoolean" type="boolean"/>
            <xs:element name="asNeededCodeableConcept" type="CodeableConcept"/>
          </xs:choice>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded specification of the anatomic site where the medication first enters the body.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections.  Examples:  Slow Push; Deep IV.

Terminologies used often pre-coordinate this term with the route and or form of administration.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of therapeutic or other substance given at one administration event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rate" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maxDosePerPeriod" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationStatementStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The medication is still being taken.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>All actions that are implied by the statement have occurred.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation>The statement was entered in error and therefore nullified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationStatementStatus">
    <xs:annotation>
      <xs:documentation>A set of codes indicating the current status of a MedicationStatement</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="MedicationStatementStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MessageHeader" type="MessageHeader">
    <xs:annotation>
      <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MessageHeader">
    <xs:annotation>
      <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>The identifier of this message.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="timestamp" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>The time that the message was sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value &quot;http://hl7.org/fhir/message-type&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" type="MessageHeader.Response" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Information about the message that this message is a response to.  Only present if this message is a response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" type="MessageHeader.Source" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The source application from which this message originated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="destination" type="MessageHeader.Destination" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The destination application which the message is intended for.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="receiver" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="responsible" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Coded indication of the cause for the event - indicates  a reason for the occurance of the event that is a focus of this message.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="data" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The actual data of the message - a reference to the root/focus class of the event.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageHeader.Response">
    <xs:annotation>
      <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation>The id of the message that this message is a response to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="ResponseType">
            <xs:annotation>
              <xs:documentation>Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="details" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Full details of any issues found in the message.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageHeader.Source">
    <xs:annotation>
      <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable name for the source system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="software" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>May include configuration or other information useful in debugging.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Can convey versions of multiple systems in situations where a message passes through multiple hands.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="1" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>An e-mail, phone, website or other contact point to use to resolve issues with message communications.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Identifies the routing target to send acknowledgements to.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageHeader.Destination">
    <xs:annotation>
      <xs:documentation>The header for a message exchange that is either requesting or responding to an action.  The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable name for the target system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the target end system in situations where the initial message transmission is to an intermediary system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Indicates where the message should be routed to.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResponseType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ok">
        <xs:annotation>
          <xs:documentation>The message was accepted and processed without error.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transient-error">
        <xs:annotation>
          <xs:documentation>Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fatal-error">
        <xs:annotation>
          <xs:documentation>The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResponseType">
    <xs:annotation>
      <xs:documentation>The kind of response to a message</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="ResponseType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="NamingSystem" type="NamingSystem">
    <xs:annotation>
      <xs:documentation>A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="NamingSystem">
    <xs:annotation>
      <xs:documentation>A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</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="DomainResource">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="NamingSystemType">
            <xs:annotation>
              <xs:documentation>Indicates the purpose for the namingsystem - what kinds of things does it make unique?.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The descriptive name of this particular identifier type or code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="NamingSystemStatus">
            <xs:annotation>
              <xs:documentation>Indicates whether the namingsystem is &quot;ready for use&quot; or not.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="country" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country.  For example, the country associated with a national code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Categorizes a namingsystem for easier search by grouping related namingsystems.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="responsible" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Details about what the namespace identifies including scope, granularity, version labeling, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uniqueId" type="NamingSystem.UniqueId" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Indicates how the system may be identified when referenced in electronic exchange.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="NamingSystem.Contact" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The person who can be contacted about this system registration entry.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="replacedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NamingSystem.UniqueId">
    <xs:annotation>
      <xs:documentation>A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="NamingSystemIdentifierType">
            <xs:annotation>
              <xs:documentation>Identifies the unique identifier scheme used for this particular identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The string that should be sent over the wire to identify the code system or identifier system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preferred" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Indicates whether this identifier is the &quot;preferred&quot; identifier of this type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem.  Outside of this window, the identifier might be non-deterministic.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NamingSystem.Contact">
    <xs:annotation>
      <xs:documentation>A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation>Names of the person who can be contacted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>Identifies the mechanism(s) by which they can be contacted.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NamingSystemStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation>System has been submitted but not yet approved.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>System is valid for use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation>System should no longer be used.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NamingSystemStatus">
    <xs:annotation>
      <xs:documentation>Indicates whether the namingsystem should be used</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="NamingSystemStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NamingSystemType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="codesystem">
        <xs:annotation>
          <xs:documentation>The namingsystem is used to define concepts and symbols to represent those concepts.  E.g. UCUM, LOINC, NDC code, local lab codes, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="identifier">
        <xs:annotation>
          <xs:documentation>The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="root">
        <xs:annotation>
          <xs:documentation>The namingsystem is used as the root for other identifiers and namingsystems.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NamingSystemType">
    <xs:annotation>
      <xs:documentation>Identifies the purpose of the namingsystem</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="NamingSystemType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NamingSystemIdentifierType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="oid">
        <xs:annotation>
          <xs:documentation>An ISO object identifier.  E.g. 1.2.3.4.5.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation>A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation>A uniform resource identifier (ideally a URL - uniform resource locator).  E.g. http://unitsofmeasure.org.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation>Some other type of unique identifier.  E.g HL7-assigned reserved string such as LN for LOINC.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NamingSystemIdentifierType">
    <xs:annotation>
      <xs:documentation>Identifies the style of unique identifier used to identify a namepace</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="NamingSystemIdentifierType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="NutritionOrder" type="NutritionOrder">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="NutritionOrder">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</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="DomainResource">
        <xs:sequence>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orderer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers assigned to this order by the order sender or by the order receiver.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and time that this nutrition order was requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="allergyIntolerance" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="foodPreferenceModifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="excludeFoodModifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="oralDiet" type="NutritionOrder.OralDiet" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Class that defines the components of an oral diet order for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supplement" type="NutritionOrder.Supplement" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Class that defines the components of a supplement order for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enteralFormula" type="NutritionOrder.EnteralFormula" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Class that defines the components of an enteral formula order for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="NutritionOrderStatus">
            <xs:annotation>
              <xs:documentation>The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.OralDiet">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="scheduled" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation>The time period and frequency at which the diet should be given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="nutrients" type="NutritionOrder.Nutrients" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Class that defines the details of any nutrient modifications required for the oral diet.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="texture" type="NutritionOrder.Texture" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Class that describes any texture modifications required for the patient to safely consume various types of solid foods.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fluidConsistencyType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instruction" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional instructions or information pertaining to the oral diet.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Nutrients">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="modifier" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the type of nutrient that is being modified such as carbohydrate or sodium.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The quantity of the specified nutrient to include in diet.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Texture">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="modifier" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="foodType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Supplement">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The product or brand name of the nutritional supplement product to be provided to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="scheduled" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation>The time period and frequency at which the supplement(s) should be given.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of the nutritional supplement product to provide to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.EnteralFormula">
    <xs:annotation>
      <xs:documentation>A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="administrationInstructions" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Free text formula administration or feeding instructions for cases where the instructions are too complex to code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="baseFormulaType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="baseFormulaProductName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The product or brand name of the enteral or infant formula product to be provided to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="scheduled" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation>The time period and frequency at which the enteral formula should be delivered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additiveType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additiveProductName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The product or brand name of the type of modular component to be added to the formula.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="caloricDensity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="routeofAdministration" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded concept specifying the route or physiological path of administration into the patient 's gastrointestinal  tract for purposes of providing the formula feeding, e.g., nasogastric tube.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The volume of formula to provide to the patient per the specified administration schedule.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rate" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rateAdjustment" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maxVolumeToDeliver" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NutritionOrderStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="held">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>TODO.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NutritionOrderStatus">
    <xs:annotation>
      <xs:documentation>TODO</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="NutritionOrderStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Observation" type="Observation">
    <xs:annotation>
      <xs:documentation>Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Observation">
    <xs:annotation>
      <xs:documentation>Measurements and simple assertions made about a patient, device or other subject.</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="DomainResource">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Describes what was observed. Sometimes this is called the observation &quot;code&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueQuantity" type="Quantity"/>
            <xs:element name="valueCodeableConcept" type="CodeableConcept"/>
            <xs:element name="valueAttachment" type="Attachment"/>
            <xs:element name="valueRatio" type="Ratio"/>
            <xs:element name="valueDateTime" type="dateTime"/>
            <xs:element name="valuePeriod" type="Period"/>
            <xs:element name="valueSampledData" type="SampledData"/>
            <xs:element name="valueString" type="string"/>
            <xs:element name="valueTime" type="time"/>
          </xs:choice>
          <xs:element name="dataAbsentReason" minOccurs="0" maxOccurs="1" type="DataAbsentReason">
            <xs:annotation>
              <xs:documentation>Provides a reason why the expected value in the element Observation.value[x] is missing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interpretation" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The assessment made based on the result of the observation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comments" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the &quot;physiologically relevant time&quot;. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>
            </xs:annotation>
            <xs:element name="appliesDateTime" type="dateTime"/>
            <xs:element name="appliesPeriod" type="Period"/>
          </xs:choice>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>The date and time this observation was made available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ObservationStatus">
            <xs:annotation>
              <xs:documentation>The status of the result value.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reliability" minOccurs="0" maxOccurs="1" type="ObservationReliability">
            <xs:annotation>
              <xs:documentation>An estimate of the degree to which quality issues have impacted on the value reported.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Indicates the site on the subject's body where the observation was made ( i.e. the target site).</xs:documentation>
            </xs:annotation>
            <xs:element name="bodySiteCodeableConcept" type="CodeableConcept"/>
            <xs:element name="bodySiteReference" type="Reference"/>
          </xs:choice>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the mechanism used to perform the observation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>A unique identifier for the simple observation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus,
other observer (for example a relative or EMT), or any observation made about the subject.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The specimen that was used when this observation was made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Who was responsible for asserting the observed value as &quot;true&quot;.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The device used to generate the observation data.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The healthcare event  ( e.g. a patient and healthcare provider interaction ) during which this observation is made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referenceRange" type="Observation.ReferenceRange" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Guidance on how to interpret the value by comparison to a normal or recommended range.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="related" type="Observation.Related" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Related observations - either components, or previous observations, or statements of derivation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Observation.ReferenceRange">
    <xs:annotation>
      <xs:documentation>Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="low" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. &lt;2.3.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="high" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. &gt;5.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="meaning" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code for the meaning of the reference range.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="age" minOccurs="0" maxOccurs="1" type="Range">
            <xs:annotation>
              <xs:documentation>The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of &quot;Negative&quot; or a list or table of 'normals'.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Observation.Related">
    <xs:annotation>
      <xs:documentation>Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="ObservationRelationshipType">
            <xs:annotation>
              <xs:documentation>A code specifying the kind of relationship that exists with the target observation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A reference to the observation that is related to this observation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ObservationReliability-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ok">
        <xs:annotation>
          <xs:documentation>The result has no reliability concerns.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ongoing">
        <xs:annotation>
          <xs:documentation>An early estimate of value; measurement is still occurring.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="early">
        <xs:annotation>
          <xs:documentation>An early estimate of value; processing is still occurring.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="questionable">
        <xs:annotation>
          <xs:documentation>The observation value should be treated with care.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calibrating">
        <xs:annotation>
          <xs:documentation>The result has been generated while calibration is occurring.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>The observation could not be completed because of an error.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation>No observation  reliability value was available.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ObservationReliability">
    <xs:annotation>
      <xs:documentation>Codes that provide an estimate of the degree to which quality issues have impacted on the value of an observation</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="ObservationReliability-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ObservationStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="registered">
        <xs:annotation>
          <xs:documentation>The existence of the observation is registered, but there is no result yet available.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="preliminary">
        <xs:annotation>
          <xs:documentation>This is an initial or interim observation: data may be incomplete or unverified.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation>The observation is complete and verified by an authorized person.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation>The observation 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="cancelled">
        <xs:annotation>
          <xs:documentation>The observation 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 observation has been withdrawn following previous Final release.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ObservationStatus">
    <xs:annotation>
      <xs:documentation>Codes providing the status of an observation</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="ObservationStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ObservationRelationshipType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="has-component">
        <xs:annotation>
          <xs:documentation>The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="has-member">
        <xs:annotation>
          <xs:documentation>This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="derived-from">
        <xs:annotation>
          <xs:documentation>The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sequel-to">
        <xs:annotation>
          <xs:documentation>This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="replaces">
        <xs:annotation>
          <xs:documentation>This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="qualified-by">
        <xs:annotation>
          <xs:documentation>The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="interfered-by">
        <xs:annotation>
          <xs:documentation>The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ObservationRelationshipType">
    <xs:annotation>
      <xs:documentation>Codes specifying how two observations are related</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="ObservationRelationshipType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="OperationDefinition" type="OperationDefinition">
    <xs:annotation>
      <xs:documentation>A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="OperationDefinition">
    <xs:annotation>
      <xs:documentation>A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The identifier that is used to identify this operation definition 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="title" 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="ContactPoint">
            <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="kind" minOccurs="1" maxOccurs="1" type="OperationKind">
            <xs:annotation>
              <xs:documentation>Whether this is operation or named query.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The name used to invoke the operation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional information about how to use this operation or named query.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates that this operation definition is a constraining profile on the base.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="system" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="code">
            <xs:annotation>
              <xs:documentation>Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instance" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Indicates whether this operation can be invoked on a particular instance of one of the given types.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="parameter" type="OperationDefinition.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The parameters for the operation/query.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationDefinition.Parameter">
    <xs:annotation>
      <xs:documentation>A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The name of used to identify the parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="1" maxOccurs="1" type="OperationParameterUse">
            <xs:annotation>
              <xs:documentation>Whether this is an input or an output parameter.</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 parameter SHALL appear in the request or response.</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 request or response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Describes the meaning or use of this parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The type for this parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A profile the specifies the rules that this parameter must conform to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="part" type="OperationDefinition.Part" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The parts of a Tuple Parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationDefinition.Part">
    <xs:annotation>
      <xs:documentation>A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The name of used to identify the parameter.</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 parameter SHALL appear in the request or response.</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 request or response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Describes the meaning or use of this parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The type for this parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A profile the specifies the rules that this parameter must conform to.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="OperationParameterUse-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation>This is an input parameter.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="out">
        <xs:annotation>
          <xs:documentation>This is an output parameter.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="OperationParameterUse">
    <xs:annotation>
      <xs:documentation>Whether an operation parameter is an input or an output parameter</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="OperationParameterUse-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="OperationKind-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="operation">
        <xs:annotation>
          <xs:documentation>This operation is invoked as an operation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="query">
        <xs:annotation>
          <xs:documentation>This operation is a named query, invoked using the search mechanism.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="OperationKind">
    <xs:annotation>
      <xs:documentation>Whether an operation is a normal operation or a query</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="OperationKind-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="OperationOutcome" type="OperationOutcome">
    <xs:annotation>
      <xs:documentation>A collection of error, warning or information messages that result from a system action.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="OperationOutcome">
    <xs:annotation>
      <xs:documentation>A collection of error, warning or information messages that result from a system action.</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="DomainResource">
        <xs:sequence>
          <xs:element name="issue" type="OperationOutcome.Issue" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An error, warning or information message that results from a system action.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationOutcome.Issue">
    <xs:annotation>
      <xs:documentation>A collection of error, warning or information messages that result from a system action.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="severity" minOccurs="1" maxOccurs="1" type="IssueSeverity">
            <xs:annotation>
              <xs:documentation>Indicates whether the issue indicates a variation from successful processing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>A code indicating the type of error, warning or information message.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="details" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional description of the issue.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IssueSeverity-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="fatal">
        <xs:annotation>
          <xs:documentation>The issue caused the action to fail, and no further checking could be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>The issue is sufficiently important to cause the action to fail.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="warning">
        <xs:annotation>
          <xs:documentation>The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="information">
        <xs:annotation>
          <xs:documentation>The issue has no relation to the degree of success of the action.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IssueSeverity">
    <xs:annotation>
      <xs:documentation>How the issue affects the success of the action</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="IssueSeverity-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="OralHealthClaim" type="OralHealthClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="OralHealthClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification on which this instance relies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification from which the original instance was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Insurer Identifier, typical BIN number (6 digit).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation>Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facility" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Facility where the services were provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="OralHealthClaim.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The party to be reimbursed for the services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The referral resource which lists the date, practitioner, reason and other supporting information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="OralHealthClaim.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Ordered list of patient diagnosis for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>List of patient conditions for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="OralHealthClaim.Coverage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Financial instrument by which payment information for health care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exception" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Factors which may influence the applicability of coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="school" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of school for over-aged dependants.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accident" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date of an accident which these services are addressing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accidentType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of accident: work, auto, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interventionException" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A list of intervention and exception codes which may influence the adjudication of the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="missingteeth" type="OralHealthClaim.Missingteeth" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A list of teeth which would be expected but are not found due to having been previously  extracted or for other reasons.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orthoPlan" type="OralHealthClaim.OrthoPlan" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The high-level details of an Orthodontic Treatment Plan.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="OralHealthClaim.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>First tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additionalMaterials" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Payee">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Diagnosis">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Sequence of diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Coverage">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preauthref" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A list of references from the Insurer to which these services pertain.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Coverages adjudication details.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Missingteeth">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="tooth" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The code identifying which tooth is missing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Missing reason may be: E-extraction, O-other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="extractiondate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date of the extraction either known from records or patient reported estimate.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.OrthoPlan">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The intended start date for service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="examFee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The estimated first examination fee.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosticFee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The estimated diagnostic fee.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="initialPayment" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The estimated initial payment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="durationMonths" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The estimated treatment duration in months.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentCount" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>The anticipated number of payments.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="periodicPayment" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The anticipated payment amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Item">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>Diagnosis applicable for this service or product line.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Physical service site on the patient (limb, tooth, etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subsite" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A region or surface of the site, eg. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="OralHealthClaim.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Second tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prosthesis" type="OralHealthClaim.Prosthesis" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The materials and placement date of prior fixed prosthesis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Detail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="OralHealthClaim.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Third tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.SubDetail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The fee for an addittional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee for an addittional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OralHealthClaim.Prosthesis">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="initial" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Indicates whether this is the initial placement of a fixed prosthesis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priorDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date of the initial placement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priorMaterial" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Material of the prior denture or bridge prosthesis. (Oral).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Order" type="Order">
    <xs:annotation>
      <xs:documentation>A request to perform an action.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Order">
    <xs:annotation>
      <xs:documentation>A request to perform an action.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers assigned to this order by the orderer or by the receiver.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When the order was made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient this order is about.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who initiated the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Who is intended to fulfill the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Text - why the order was made.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept"/>
            <xs:element name="reasonReference" type="Reference"/>
          </xs:choice>
          <xs:element name="authority" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>If required by policy.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="when" type="Order.When" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>When order should be fulfilled.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>What action is being ordered.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Order.When">
    <xs:annotation>
      <xs:documentation>A request to perform an action.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Code specifies when request should be done. The code may simply be a priority code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation>A formal schedule.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="OrderResponse" type="OrderResponse">
    <xs:annotation>
      <xs:documentation>A response to an order.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="OrderResponse">
    <xs:annotation>
      <xs:documentation>A response to an order.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A reference to the order that this is in response to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and time at which this order response was made (created/posted).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="who" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person, organization, or device credited with making the response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.</xs:documentation>
            </xs:annotation>
            <xs:element name="authorityCodeableConcept" type="CodeableConcept"/>
            <xs:element name="authorityReference" type="Reference"/>
          </xs:choice>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="OrderOutcomeStatus">
            <xs:annotation>
              <xs:documentation>What this response says about the status of the original order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fulfillment" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="OrderOutcomeStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="pending">
        <xs:annotation>
          <xs:documentation>The order is known, but no processing has occurred at this time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="review">
        <xs:annotation>
          <xs:documentation>The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>The order was rejected because of a workflow/business logic reason.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>The order was unable to be processed because of a technical error (i.e. unexpected error).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The order has been accepted, and work is in progress.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>Processing the order was halted at the initiators request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="replaced">
        <xs:annotation>
          <xs:documentation>The order has been cancelled and replaced by another.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="aborted">
        <xs:annotation>
          <xs:documentation>Processing the order was stopped because of some workflow/business logic reason.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation>The order has been completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="OrderOutcomeStatus">
    <xs:annotation>
      <xs:documentation>The status of the response to an order</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="OrderOutcomeStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Organization" type="Organization">
    <xs:annotation>
      <xs:documentation>A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Organization">
    <xs:annotation>
      <xs:documentation>A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier for the organization that is used to identify the organization across multiple disparate systems.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A name associated with the organization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The kind of organization that this is.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail for the organization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation>An address for the organization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization of which this organization forms a part.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="Organization.Contact" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Contact for the organization for a certain purpose.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Location(s) the organization uses to provide services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether the organization's record is still in active use.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Organization.Contact">
    <xs:annotation>
      <xs:documentation>A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates a purpose for which the contact can be reached.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the contact.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation>Visiting or postal addresses for the contact.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Other" type="Other">
    <xs:annotation>
      <xs:documentation>Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Other">
    <xs:annotation>
      <xs:documentation>Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier assigned to the resource for business purposes, outside the context of FHIR.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the 'type' of resource - equivalent to the resource name for other resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the patient, practitioner, device or any other resource that is the &quot;focus&quot; of this resoruce.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates who was responsible for creating the resource instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Identifies when the resource was first created.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Patient" type="Patient">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Patient">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>An identifier that applies to this person as a patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date and time of birth for the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Indicates if the individual is deceased or not.</xs:documentation>
            </xs:annotation>
            <xs:element name="deceasedBoolean" type="boolean"/>
            <xs:element name="deceasedDateTime" type="dateTime"/>
          </xs:choice>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation>Addresses for the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maritalStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>This field contains a patient's most recent marital (civil) status.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Indicates whether the patient is part of a multiple or indicates the actual birth order.</xs:documentation>
            </xs:annotation>
            <xs:element name="multipleBirthBoolean" type="boolean"/>
            <xs:element name="multipleBirthInteger" type="integer"/>
          </xs:choice>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Image of the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="Patient.Contact" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A contact party (e.g. guardian, partner, friend) for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="animal" type="Patient.Animal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>This element has a value if the patient is an animal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="communication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Languages which may be used to communicate with the patient about his or her health.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careProvider" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient's nominated care provider.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Organization that is the custodian of the patient record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Patient.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Link to another patient resource that concerns the same actual person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether this patient record is in active use.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Contact">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="relationship" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The nature of the relationship between the patient and the contact person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation>Address for the contact person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Organization on behalf of which the contact is acting or for which the contact is working.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period during which this person or organization is valid to be contacted relating to this patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Animal">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="species" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the high level categorization of the kind of animal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="breed" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifies the detailed categorization of the kind of animal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="genderStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the current state of the animal's reproductive organs.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Link">
    <xs:annotation>
      <xs:documentation>Demographics and other administrative information about a person or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="other" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The other patient resource that the link refers to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="LinkType">
            <xs:annotation>
              <xs:documentation>The type of link between this patient resource and another patient resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LinkType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="replace">
        <xs:annotation>
          <xs:documentation>The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refer">
        <xs:annotation>
          <xs:documentation>The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="seealso">
        <xs:annotation>
          <xs:documentation>The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LinkType">
    <xs:annotation>
      <xs:documentation>The type of link between this patient resource and another patient resource.</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="LinkType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PaymentNotice" type="PaymentNotice">
    <xs:annotation>
      <xs:documentation>This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PaymentNotice">
    <xs:annotation>
      <xs:documentation>This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of response to resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="paymentStatus" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The payment status, typically paid: payment sent, cleared: payment received.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PaymentReconciliation" type="PaymentReconciliation">
    <xs:annotation>
      <xs:documentation>This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PaymentReconciliation">
    <xs:annotation>
      <xs:documentation>This resource provides payment details and claim references supporting a bulk payment.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request resource reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="RemittanceOutcome">
            <xs:annotation>
              <xs:documentation>Transaction status: error, complete.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the status of the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time for which payments have been gathered into this bulk payment for settlement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who produced this adjudicated response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="PaymentReconciliation.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>List of individual settlement amounts and the corresponding transaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The form to be used for printing the content.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="total" minOccurs="1" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Total payment amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" type="PaymentReconciliation.Note" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Suite of notes.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PaymentReconciliation.Detail">
    <xs:annotation>
      <xs:documentation>This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Code to indicate the nature of the payment, adjustment, funds advance, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The claim or financial resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="responce" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The claim response resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="submitter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Organization which submitted the invoice or financial transaction.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is receiving the payment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date of the invoice or financial resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>Amount paid for this detail.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PaymentReconciliation.Note">
    <xs:annotation>
      <xs:documentation>This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The note purpose: Print/Display.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The note text.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PendedRequest" type="PendedRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the resource for which the status is to be checked.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PendedRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the resource for which the status is to be checked.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Names of resource types to include.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Names of resource types to exclude.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>A period of time during which the fulfilling resources would have been created.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Person" type="Person">
    <xs:annotation>
      <xs:documentation>Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Person">
    <xs:annotation>
      <xs:documentation>Demographics and administrative information about a person independent of a specific health-related context.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier for a person within a particular scope.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation>Administrative Gender.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The birth date for the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation>One or more addresses for the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation>An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Organization that is the custodian of the person record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether this person's record is in active use.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Person.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Link to a resource that converns the same actual person.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Person.Link">
    <xs:annotation>
      <xs:documentation>Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="other" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The resource to which this actual person is associated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="assurance" minOccurs="0" maxOccurs="1" type="IdentityAssuranceLevel">
            <xs:annotation>
              <xs:documentation>Level of assurance that this link is actually associated with the referenced record.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IdentityAssuranceLevel-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="level1">
        <xs:annotation>
          <xs:documentation>Little or no confidence in the asserted identity's accuracy.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="level2">
        <xs:annotation>
          <xs:documentation>Some confidence in the asserted identity's accuracy.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="level3">
        <xs:annotation>
          <xs:documentation>High confidence in the asserted identity's accuracy.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="level4">
        <xs:annotation>
          <xs:documentation>Very high confidence in the asserted identity's accuracy.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IdentityAssuranceLevel">
    <xs:annotation>
      <xs:documentation>The level of confidence that this link represents the same actual person, based on NIST Authentication Levels</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="IdentityAssuranceLevel-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PharmacyClaim" type="PharmacyClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PharmacyClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification on which this instance relies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification from which the original instance was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Insurer Identifier, typical BIN number (6 digit).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation>Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facility" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Facility where the services were provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalPrescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="PharmacyClaim.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The party to be reimbursed for the services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The referral resource which lists the date, practitioner, reason and other supporting information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="PharmacyClaim.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Ordered list of patient diagnosis for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>List of patient conditions for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="PharmacyClaim.Coverage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Financial instrument by which payment information for health care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exception" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Factors which may influence the applicability of coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="school" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of school for over-aged dependants.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accident" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date of an accident which these services are addressing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accidentType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of accident: work, auto, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interventionException" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A list of intervention and exception codes which may influence the adjudication of the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="PharmacyClaim.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>First tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additionalMaterials" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PharmacyClaim.Payee">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PharmacyClaim.Diagnosis">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Sequence of diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PharmacyClaim.Coverage">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>The instance number of the Coverage which is the focus for adjudication. The Coverage to against which the claim is to be adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preauthref" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A list of references from the Insurer to which these services pertain.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Coverages adjudication details.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PharmacyClaim.Item">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>Diagnosis applicable for this service or product line.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Physical service site on the patient (limb, tooth, etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subsite" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A region or surface of the site, eg. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="PharmacyClaim.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Second tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PharmacyClaim.Detail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="PharmacyClaim.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Third tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PharmacyClaim.SubDetail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Practitioner" type="Practitioner">
    <xs:annotation>
      <xs:documentation>A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Practitioner">
    <xs:annotation>
      <xs:documentation>A person who is directly or indirectly involved in the provisioning of healthcare.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>An identifier that applies to this person in this role.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail for the practitioner, e.g. a telephone number or an email address.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation>The postal address where the practitioner can be found or visited or to which mail can be delivered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and time of birth for the practitioner.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Image of the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization that the practitioner represents.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Roles which this practitioner is authorized to perform for the organization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specific specialty of the practitioner.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period during which the person is authorized to act as a practitioner in these role(s) for the organization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The location(s) at which this practitioner provides care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="qualification" type="Practitioner.Qualification" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Qualifications obtained by training and certification.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="communication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A language the practitioner is able to use in patient communication.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Practitioner.Qualification">
    <xs:annotation>
      <xs:documentation>A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>An identifier that applies to this person's qualification in this role.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Coded representation of the qualification.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>Period during which the qualification is valid.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="issuer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Organization that regulates and issues the qualification.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <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="DomainResource">
        <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="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <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 than 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="Reference">
            <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="Reference">
            <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="Reference">
            <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="Reference">
            <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:element name="ProcedureRequest" type="ProcedureRequest">
    <xs:annotation>
      <xs:documentation>A request for a procedure to be performed. May be a proposal or an order.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ProcedureRequest">
    <xs:annotation>
      <xs:documentation>A request for a procedure to be performed. May be a proposal or an order.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifiers assigned to this order by the order or by the receiver.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who will receive the procedure.</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 ordered. 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>The site where the procedure is to be performed.</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 is proposed or ordered. This procedure request may be motivated by a Condition for instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. &quot;Every 8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;; &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingDateTime" type="dateTime"/>
            <xs:element name="timingPeriod" type="Period"/>
            <xs:element name="timingTiming" type="Timing"/>
          </xs:choice>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The encounter within which the procedure proposal or request was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>E.g. surgeon, anaethetist, endoscopist.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="ProcedureRequestStatus">
            <xs:annotation>
              <xs:documentation>The status of the order.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>Any other notes associated with this proposal or order - e.g., provider instructions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.</xs:documentation>
            </xs:annotation>
            <xs:element name="asNeededBoolean" type="boolean"/>
            <xs:element name="asNeededCodeableConcept" type="CodeableConcept"/>
          </xs:choice>
          <xs:element name="orderedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time when the request was made.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orderer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The healthcare professional responsible for proposing or ordering the procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="ProcedureRequestPriority">
            <xs:annotation>
              <xs:documentation>The clinical priority associated with this order.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ProcedureRequestPriority-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="routine">
        <xs:annotation>
          <xs:documentation>The request has a normal priority.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="urgent">
        <xs:annotation>
          <xs:documentation>The request should be done urgently.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stat">
        <xs:annotation>
          <xs:documentation>The request is time-critical.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="asap">
        <xs:annotation>
          <xs:documentation>The request should be acted on as soon as possible.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ProcedureRequestPriority">
    <xs:annotation>
      <xs:documentation>The priority of the request</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="ProcedureRequestPriority-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ProcedureRequestStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation>The request has been proposed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation>The request has been planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>The request has been placed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="received">
        <xs:annotation>
          <xs:documentation>The receiving system has received the request but not yet decided whether it will be performed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation>The receiving system has accepted the request, but work has not yet commenced.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>The work to fulfill the request is happening.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The work has been complete, the report(s) released, and no further work is planned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation>The request has been held by originating system/user request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation>The receiving system has declined to fulfill the request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="aborted">
        <xs:annotation>
          <xs:documentation>The request was attempted, but due to some procedural error, it could not be completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ProcedureRequestStatus">
    <xs:annotation>
      <xs:documentation>The status of the request</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="ProcedureRequestStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ProfessionalClaim" type="ProfessionalClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ProfessionalClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification on which this instance relies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification from which the original instance was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Insurer Identifier, typical BIN number (6 digit).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation>Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facility" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Facility where the services were provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="ProfessionalClaim.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The party to be reimbursed for the services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The referral resource which lists the date, practitioner, reason and other supporting information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="ProfessionalClaim.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Ordered list of patient diagnosis for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>List of patient conditions for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="ProfessionalClaim.Coverage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Financial instrument by which payment information for health care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exception" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Factors which may influence the applicability of coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="school" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of school for over-aged dependants.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accident" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date of an accident which these services are addressing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accidentType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of accident: work, auto, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interventionException" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A list of intervention and exception codes which may influence the adjudication of the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="ProfessionalClaim.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>First tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additionalMaterials" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProfessionalClaim.Payee">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProfessionalClaim.Diagnosis">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Sequence of diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProfessionalClaim.Coverage">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preauthref" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A list of references from the Insurer to which these services pertain.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Coverages adjudication details.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProfessionalClaim.Item">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>Diagnosis applicable for this service or product line.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Physical service site on the patient (limb, tooth, etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subsite" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A region or surface of the site, eg. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ProfessionalClaim.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Second tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProfessionalClaim.Detail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="ProfessionalClaim.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Third tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProfessionalClaim.SubDetail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <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="DomainResource">
        <xs:sequence>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance  (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal 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.</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="ContactPoint">
            <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 - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.4.0 for this version.</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="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="base" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The structure that is the base on which this set of constraints is derived from.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="snapshot" type="Profile.Snapshot" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="differential" type="Profile.Snapshot" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A differential view is expressed relative to the base profile - a statement of differences that it applies.</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.Snapshot">
    <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="element" minOccurs="0" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation>Captures constraints on each element within the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Provenance" type="Provenance">
    <xs:annotation>
      <xs:documentation>Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Provenance">
    <xs:annotation>
      <xs:documentation>Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.</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="DomainResource">
        <xs:sequence>
          <xs:element name="target" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The Reference(s) that were generated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period during which the activity occurred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recorded" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>The instant of time at which the activity was recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The reason that the activity was taking place.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Where the activity occurred, if relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="policy" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation>Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="agent" type="Provenance.Agent" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="entity" type="Provenance.Entity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>An entity used in this activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="integritySignature" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Provenance.Agent">
    <xs:annotation>
      <xs:documentation>Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The role that the participant played.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of the participant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Identity of participant. May be a logical or physical uri and maybe absolute or relative.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of the participant.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Provenance.Entity">
    <xs:annotation>
      <xs:documentation>Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="1" maxOccurs="1" type="ProvenanceEntityRole">
            <xs:annotation>
              <xs:documentation>How the entity was used during the activity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of the entity. If the entity is a resource, then this is a resource type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Identity of participant. May be a logical or physical uri and maybe absolute or relative.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-readable description of the entity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="agent" type="Provenance.Agent" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ProvenanceEntityRole-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="derivation">
        <xs:annotation>
          <xs:documentation>A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="revision">
        <xs:annotation>
          <xs:documentation>A derivation for which the resulting entity is a revised version of some original.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="quotation">
        <xs:annotation>
          <xs:documentation>The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="source">
        <xs:annotation>
          <xs:documentation>A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ProvenanceEntityRole">
    <xs:annotation>
      <xs:documentation>How an entity was used in an activity</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="ProvenanceEntityRole-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Questionnaire" type="Questionnaire">
    <xs:annotation>
      <xs:documentation>A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Questionnaire">
    <xs:annotation>
      <xs:documentation>A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this question set 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="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The version number assigned by the publisher for business reasons.  It may remain the same when the resource is updated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="QuestionnaireStatus">
            <xs:annotation>
              <xs:documentation>The lifecycle status of the questionnaire as a whole.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date that this questionnaire was last changed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Organization responsible for developing and maintaining the questionnaire.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" type="Questionnaire.Group" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A collection of related questions (or further groupings of questions).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Questionnaire.Group">
    <xs:annotation>
      <xs:documentation>A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The human-readable name for this section of the questionnaire.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concept" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Identifies a how this group of questions is known in a particular terminology such as LOINC.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional text for the group, used for display purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="required" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates that the group must be present and have required questions within it answered.  If false, the group may be skipped when answering the questionnaire.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="repeats" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether the group may occur multiple times in the instance, containing multiple sets of answers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" type="Questionnaire.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A sub-group within a group. The ordering of groups within this group is relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="question" type="Questionnaire.Question" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Set of questions within this group. The order of questions within the group is relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Questionnaire.Question">
    <xs:annotation>
      <xs:documentation>A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concept" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Identifies a how this question is known in a particular terminology such as LOINC.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text of the question as it is shown to the user.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="AnswerFormat">
            <xs:annotation>
              <xs:documentation>The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="required" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, indicates that the group must be present and have required questions within it answered.  If false, the group may be skipped when answering the questionnaire.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="repeats" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether the group may occur multiple times in the instance, containing multiple sets of answers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="options" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to a valueset containing the possible options.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" type="Questionnaire.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Nested group, containing nested question for this question. The order of groups within the question is relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AnswerFormat-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation>Answer is a yes/no answer.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="decimal">
        <xs:annotation>
          <xs:documentation>Answer is a floating point number.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation>Answer is an integer.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation>Answer is a date.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation>Answer is a date and time.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instant">
        <xs:annotation>
          <xs:documentation>Answer is a system timestamp.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time">
        <xs:annotation>
          <xs:documentation>Answer is a time independent of date.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation>Answer is a short (few words to short sentence) free-text entry.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="text">
        <xs:annotation>
          <xs:documentation>Answer is a long (potentially multi-paragram) free-text entry.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="choice">
        <xs:annotation>
          <xs:documentation>Answer is a choice from a list of options.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="open-choice">
        <xs:annotation>
          <xs:documentation>Answer is a choice from a list of options or a free-text entry.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="attachment">
        <xs:annotation>
          <xs:documentation>Answer is binary content such as a image, PDF, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reference">
        <xs:annotation>
          <xs:documentation>Answer is a reference to another resource (practitioner, organization, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="quantity">
        <xs:annotation>
          <xs:documentation>Answer is a combination of a numeric value and unit.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AnswerFormat">
    <xs:annotation>
      <xs:documentation>The expected format of an answer</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="AnswerFormat-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="QuestionnaireAnswers" type="QuestionnaireAnswers">
    <xs:annotation>
      <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="QuestionnaireAnswers">
    <xs:annotation>
      <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>A business identifier assigned to a particular completed (or partially completed) questionnaire.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="questionnaire" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the Questionnaire resource that defines the form for which answers are being provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="QuestionnaireAnswersStatus">
            <xs:annotation>
              <xs:documentation>The lifecycle status of the questionnaire answers as a whole.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The subject of the questionnaire answers.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="authored" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and/or time that this version of the questionnaire answers was authored.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person who answered the questions about the subject. Only used when this is not the subject him/herself.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" type="QuestionnaireAnswers.Group" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="QuestionnaireAnswers.Group">
    <xs:annotation>
      <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text that is displayed above the contents of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional text for the group, used for display purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" type="QuestionnaireAnswers.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A sub-group within a group. The ordering of groups within this group is relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="question" type="QuestionnaireAnswers.Question" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Set of questions within this group. The order of questions within the group is relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="QuestionnaireAnswers.Question">
    <xs:annotation>
      <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text of the question as it is shown to the user.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="answer" type="QuestionnaireAnswers.Answer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The respondent's answer(s) to the question.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="group" type="QuestionnaireAnswers.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Nested group, containing nested question for this question. The order of groups within the question is relevant.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="QuestionnaireAnswers.Answer">
    <xs:annotation>
      <xs:documentation>A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Single-valued answer to the question.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBoolean" type="boolean"/>
            <xs:element name="valueDecimal" type="decimal"/>
            <xs:element name="valueInteger" type="integer"/>
            <xs:element name="valueDate" type="date"/>
            <xs:element name="valueDateTime" type="dateTime"/>
            <xs:element name="valueInstant" type="instant"/>
            <xs:element name="valueTime" type="time"/>
            <xs:element name="valueString" type="string"/>
            <xs:element name="valueAttachment" type="Attachment"/>
            <xs:element name="valueCoding" type="Coding"/>
            <xs:element name="valueQuantity" type="Quantity"/>
            <xs:element name="valueReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="QuestionnaireAnswersStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation>This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="QuestionnaireAnswersStatus">
    <xs:annotation>
      <xs:documentation>Lifecycle status of the questionnaire answers</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="QuestionnaireAnswersStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Readjudicate" type="Readjudicate">
    <xs:annotation>
      <xs:documentation>This resource provides the request and line items details for the claim which is to be re-adjudicated.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Readjudicate">
    <xs:annotation>
      <xs:documentation>This resource provides the request and line items details for the claim which is to be re-adjudicated.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of response to resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A reference to supply which authenticated the process.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="Readjudicate.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Readjudicate.Item">
    <xs:annotation>
      <xs:documentation>This resource provides the request and line items details for the claim which is to be re-adjudicated.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ReferralRequest" type="ReferralRequest">
    <xs:annotation>
      <xs:documentation>Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ReferralRequest">
    <xs:annotation>
      <xs:documentation>Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation.</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="DomainResource">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ReferralStatus">
            <xs:annotation>
              <xs:documentation>The workflow status of the referral or transfer of care request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Business Id that uniquely identifies the referral/care transfer request instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>An indication of the type of referral (or where applicable the type of transfer of care) request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>An indication of the urgency of referral (or where applicable the type of transfer of care) request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who is the subject of a referral or transfer of care request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requester" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be  Patient (a self referral).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The encounter at which the request for referral or transfer of care is initiated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateSent" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date/DateTime the request for referral or transfer of care is sent by the author.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Description of clinical condition indicating why referral/transfer of care is requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceRequested" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The service(s) that is/are requested to be provided to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fulfillmentTime" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time within which the services identified in the referral/transfer of care is specified or required to occur.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ReferralStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation>A draft referral that has yet to be send.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sent">
        <xs:annotation>
          <xs:documentation>The referral has been transmitted, but not yet acknowledged by the recipient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The referral has been acknowledged by the recipient, and is in the process of being actioned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The referral has been cancelled without being completed. For example it is no longer needed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refused">
        <xs:annotation>
          <xs:documentation>The recipient has declined to accept the referral.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation>The referral has been completely actioned.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ReferralStatus">
    <xs:annotation>
      <xs:documentation>The status of the referral</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="ReferralStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="RelatedPerson" type="RelatedPerson">
    <xs:annotation>
      <xs:documentation>Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="RelatedPerson">
    <xs:annotation>
      <xs:documentation>Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier for a person within a particular scope.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient this person is related to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The nature of the relationship between a patient and the related person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation>A name associated with the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation>Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation>Address where the related person can be contacted or visited.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation>Image of the person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Reversal" type="Reversal">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the request for which all actions are to be reversed or terminated.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Reversal">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the request for which all actions are to be reversed or terminated.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of response to resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="Reversal.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Payee information supplied for matching purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="Reversal.Coverage" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Financial instrument by which payment information for health care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="nullify" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true remove all history excluding audit.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Reversal.Payee">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the request for which all actions are to be reversed or terminated.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Reversal.Coverage">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the request for which all actions are to be reversed or terminated.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="RiskAssessment" type="RiskAssessment">
    <xs:annotation>
      <xs:documentation>An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="RiskAssessment">
    <xs:annotation>
      <xs:documentation>An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</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="DomainResource">
        <xs:sequence>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient or group the risk assessment applies to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date (and possibly time) the risk assessment was performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>For assessments or prognosis specific to a particular condition, indicates the condition being assessed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider or software application that performed the assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Business identifier assigned to the risk assessment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The algorithm, processs or mechanism used to evaluate the risk.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="basis" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prediction" type="RiskAssessment.Prediction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Describes the expected outcome for the subject.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mitigation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the steps that might be taken to reduce the identified risk(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RiskAssessment.Prediction">
    <xs:annotation>
      <xs:documentation>An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="outcome" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>How likely is the outcome (in the specified timeframe).</xs:documentation>
            </xs:annotation>
            <xs:element name="probabilityDecimal" type="decimal"/>
            <xs:element name="probabilityRange" type="Range"/>
            <xs:element name="probabilityCodeableConcept" type="CodeableConcept"/>
          </xs:choice>
          <xs:element name="relativeRisk" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Indicates the period of time or age range of the subject to which the specified probability applies.</xs:documentation>
            </xs:annotation>
            <xs:element name="whenPeriod" type="Period"/>
            <xs:element name="whenRange" type="Range"/>
          </xs:choice>
          <xs:element name="rationale" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Additional information explaining the basis for the prediction.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Schedule" type="Schedule">
    <xs:annotation>
      <xs:documentation>A container for slot(s) of time that may be available for booking appointments.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Schedule">
    <xs:annotation>
      <xs:documentation>A container for slot(s) of time that may be available for booking appointments.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>External Ids for this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The schedule type can be used for the categorization of healthcare services or other appointment types.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="planningHorizon" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These  cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a &quot;template&quot; for planning outside these dates.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastModified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this Schedule was created, or last revised.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="SearchParameter" type="SearchParameter">
    <xs:annotation>
      <xs:documentation>A Search Parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SearchParameter">
    <xs:annotation>
      <xs:documentation>A Search Parameter that defines a named search item that can be used to search/filter on a resource.</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="DomainResource">
        <xs:sequence>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <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="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Details of the individual or organization who accepts responsibility for publishing the search parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <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="requirements" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The Scope and Usage that this search parameter was created to meet.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The base resource type that this search parameter refers to.</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="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the search parameters and how it used.</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:element name="SecurityEvent" type="SecurityEvent">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SecurityEvent">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</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="DomainResource">
        <xs:sequence>
          <xs:element name="event" type="SecurityEvent.Event" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Identifies the name, action type, time, and disposition of the audited event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="SecurityEvent.Participant" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A person, a hardware device or software process.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" type="SecurityEvent.Source" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Application systems and processes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="object" type="SecurityEvent.Object" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Specific instances of data or objects that have been accessed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SecurityEvent.Event">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifier for a family of the event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subtype" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Identifier for the category of event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="1" type="SecurityEventAction">
            <xs:annotation>
              <xs:documentation>Indicator for type of action performed during the event that generated the audit.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>The time when the event occurred on the source.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="SecurityEventOutcome">
            <xs:annotation>
              <xs:documentation>Indicates whether the event succeeded or failed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcomeDesc" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A free text description of the outcome of the event.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SecurityEvent.Participant">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Direct reference to a resource that identifies the participant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="userId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Unique identifier for the user actively participating in the event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="altId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Human-meaningful name for the user.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestor" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Indicator that the user is or is not the requestor, or initiator, for the event being audited.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="media" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of media involved. Used when the event is about exporting/importing onto media.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="network" type="SecurityEvent.Network" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Logical network location for application activity, if the activity has a network location.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SecurityEvent.Network">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An identifier for the network access point of the user device for the audit event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="SecurityEventParticipantNetworkType">
            <xs:annotation>
              <xs:documentation>An identifier for the type of network access point that originated the audit event.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SecurityEvent.Source">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Logical source location within the healthcare enterprise network.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Identifier of the source where the event originated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Code specifying the type of source where event originated.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SecurityEvent.Object">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifies a specific instance of the participant object. The reference should always be version specific.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies a specific instance of the participant object. The reference should always be version specific.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="SecurityEventObjectType">
            <xs:annotation>
              <xs:documentation>Object type being audited.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="SecurityEventObjectRole">
            <xs:annotation>
              <xs:documentation>Code representing the functional application role of Participant Object being audited.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lifecycle" minOccurs="0" maxOccurs="1" type="SecurityEventObjectLifecycle">
            <xs:annotation>
              <xs:documentation>Identifier for the data life-cycle stage for the participant object.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sensitivity" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>An instance-specific descriptor of the Participant Object ID audited, such as a person's name.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text that describes the object in more detail.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="query" minOccurs="0" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation>The actual query for a query-type participant object.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="SecurityEvent.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Additional Information about the Object.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SecurityEvent.Detail">
    <xs:annotation>
      <xs:documentation>A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of the property.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation>Property value.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SecurityEventObjectRole-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>This object is the patient that is the subject of care related to this event.  It is identifiable by patient ID or equivalent.  The patient may be either human or animal.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>This is a location identified as related to the event.  This is usually the location where the event took place.  Note that for shipping, the usual events are arrival at a location or departure from a location.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>This object is any kind of persistent document created as a result of the event.  This could be a paper report, film, electronic report, DICOM Study, etc.  Issues related to medical records life cycle management are conveyed elsewhere.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>A logical object related to the event.  (Deprecated).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="5">
        <xs:annotation>
          <xs:documentation>This is any configurable file used to control creation of documents.  Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="6">
        <xs:annotation>
          <xs:documentation>A human participant not otherwise identified by some other category.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="7">
        <xs:annotation>
          <xs:documentation>(deprecated).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="8">
        <xs:annotation>
          <xs:documentation>Typically a licensed person who is providing or performing care related to the event, generally a physician.   The key distinction between doctor and practitioner is with regards to their role, not the licensing.  The doctor is the human who actually performed the work.  The practitioner is the human or organization that is responsible for the work.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="9">
        <xs:annotation>
          <xs:documentation>A person or system that is being notified as part of the event.  This is relevant in situations where automated systems provide notifications to other parties when an event took place.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="10">
        <xs:annotation>
          <xs:documentation>Insurance company, or any other organization who accepts responsibility for paying for the healthcare event.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="11">
        <xs:annotation>
          <xs:documentation>A person or active system object involved in the event with a security role.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="12">
        <xs:annotation>
          <xs:documentation>A person or system object involved in the event with the authority to modify security roles of other objects.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="13">
        <xs:annotation>
          <xs:documentation>A passive object, such as a role table, that is relevant to the event.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="14">
        <xs:annotation>
          <xs:documentation>(deprecated)  Relevant to certain RBAC security methodologies.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="15">
        <xs:annotation>
          <xs:documentation>Any person or organization responsible for providing care.  This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="16">
        <xs:annotation>
          <xs:documentation>The source or destination for data transfer, when it does not match some other role.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="17">
        <xs:annotation>
          <xs:documentation>A source or destination for data transfer, that acts as an archive, database, or similar role.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="18">
        <xs:annotation>
          <xs:documentation>An object that holds schedule information.  This could be an appointment book, availability information, etc.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="19">
        <xs:annotation>
          <xs:documentation>An organization or person that is the recipient of services.  This could be an organization that is buying services for a patient, or a person that is buying services for an animal.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="20">
        <xs:annotation>
          <xs:documentation>An order, task, work item, procedure step, or other description of work to be performed.  E.g., a particular instance of an MPPS.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="21">
        <xs:annotation>
          <xs:documentation>A list of jobs or a system that provides lists of jobs.  E.g., an MWL SCP.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="22">
        <xs:annotation>
          <xs:documentation>(Deprecated).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="23">
        <xs:annotation>
          <xs:documentation>An object that specifies or controls the routing or delivery of items.  For example, a distribution list is the routing criteria for mail.  The items delivered may be documents, jobs, or other objects.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="24">
        <xs:annotation>
          <xs:documentation>The contents of a query.  This is used to capture the contents of any kind of query.  For security surveillance purposes knowing the queries being made is very important.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SecurityEventObjectRole">
    <xs:annotation>
      <xs:documentation>Code representing the functional application role of Participant Object being audited</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="SecurityEventObjectRole-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SecurityEventObjectType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Person.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>System Object.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>Organization.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>Other.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SecurityEventObjectType">
    <xs:annotation>
      <xs:documentation>Code for the participant object type being audited</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="SecurityEventObjectType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SecurityEventAction-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="C">
        <xs:annotation>
          <xs:documentation>Create a new database object, such as Placing an Order.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="R">
        <xs:annotation>
          <xs:documentation>Display or print data, such as a Doctor Census.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="U">
        <xs:annotation>
          <xs:documentation>Update data, such as Revise Patient Information.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="D">
        <xs:annotation>
          <xs:documentation>Delete items, such as a doctor master file record.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="E">
        <xs:annotation>
          <xs:documentation>Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SecurityEventAction">
    <xs:annotation>
      <xs:documentation>Indicator for type of action performed during the event that generated the audit.</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="SecurityEventAction-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SecurityEventObjectLifecycle-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Origination / Creation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>Import / Copy from original.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>Amendment.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>Verification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="5">
        <xs:annotation>
          <xs:documentation>Translation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="6">
        <xs:annotation>
          <xs:documentation>Access / Use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="7">
        <xs:annotation>
          <xs:documentation>De-identification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="8">
        <xs:annotation>
          <xs:documentation>Aggregation, summarization, derivation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="9">
        <xs:annotation>
          <xs:documentation>Report.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="10">
        <xs:annotation>
          <xs:documentation>Export / Copy to target.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="11">
        <xs:annotation>
          <xs:documentation>Disclosure.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="12">
        <xs:annotation>
          <xs:documentation>Receipt of disclosure.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="13">
        <xs:annotation>
          <xs:documentation>Archiving.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="14">
        <xs:annotation>
          <xs:documentation>Logical deletion.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="15">
        <xs:annotation>
          <xs:documentation>Permanent erasure / Physical destruction.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SecurityEventObjectLifecycle">
    <xs:annotation>
      <xs:documentation>Identifier for the data life-cycle stage for the participant object</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="SecurityEventObjectLifecycle-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SecurityEventParticipantNetworkType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Machine Name, including DNS name.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>IP Address.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>Telephone Number.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>Email address.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="5">
        <xs:annotation>
          <xs:documentation>URI (User directory, HTTP-PUT, ftp, etc.).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SecurityEventParticipantNetworkType">
    <xs:annotation>
      <xs:documentation>The type of network access point that originated the audit event</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="SecurityEventParticipantNetworkType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SecurityEventOutcome-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="0">
        <xs:annotation>
          <xs:documentation>The operation completed successfully (whether with warnings or not).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="8">
        <xs:annotation>
          <xs:documentation>The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="12">
        <xs:annotation>
          <xs:documentation>An error of such magnitude occurred that the system is not longer available for use (i.e. the system died).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SecurityEventOutcome">
    <xs:annotation>
      <xs:documentation>Indicates whether the event succeeded or failed</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="SecurityEventOutcome-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Slot" type="Slot">
    <xs:annotation>
      <xs:documentation>A slot of time on a schedule that may be available for booking appointments.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Slot">
    <xs:annotation>
      <xs:documentation>A slot of time on a schedule that may be available for booking appointments.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>External Ids for this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The schedule resource that this slot defines an interval of status information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="freeBusyType" minOccurs="1" maxOccurs="1" type="SlotStatus">
            <xs:annotation>
              <xs:documentation>BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Date/Time that the slot is to begin.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Date/Time that the slot is to conclude.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="overbooked" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>This slot has already been overbooked, appointments are unlikely to be accepted for this time.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Comments on the slot to describe any extended information. Such as custom constraints on the slot.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lastModified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When this slot was created, or last revised.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SlotStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="BUSY">
        <xs:annotation>
          <xs:documentation>Indicates that the time interval is busy because one  or more events have been scheduled for that interval.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FREE">
        <xs:annotation>
          <xs:documentation>Indicates that the time interval is free for scheduling.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BUSY-UNAVAILABLE">
        <xs:annotation>
          <xs:documentation>Indicates that the time interval is busy and that the interval can not be scheduled.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BUSY-TENTATIVE">
        <xs:annotation>
          <xs:documentation>Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SlotStatus">
    <xs:annotation>
      <xs:documentation>The free/busy status of an appointment</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="SlotStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Specimen" type="Specimen">
    <xs:annotation>
      <xs:documentation>Sample for analysis.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Specimen">
    <xs:annotation>
      <xs:documentation>Sample for analysis.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Id for specimen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Kind of material that forms the specimen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" type="Specimen.Source" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Parent specimen from which the focal specimen was a component.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Where the specimen came from. This may be from the patient(s) or from the environment or a device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accessionIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="receivedTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Time when specimen was received for processing or testing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="collection" type="Specimen.Collection" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Details concerning the specimen collection.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="treatment" type="Specimen.Treatment" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Details concerning treatment and processing steps for the specimen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="container" type="Specimen.Container" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Source">
    <xs:annotation>
      <xs:documentation>Sample for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="HierarchicalRelationshipType">
            <xs:annotation>
              <xs:documentation>Whether this relationship is to a parent or to a child.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>The specimen resource that is the target of this relationship.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Collection">
    <xs:annotation>
      <xs:documentation>Sample for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="collector" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who collected the specimen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>To communicate any details or issues encountered during the specimen collection procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Time when specimen was collected from subject - the physiologically relevant time.</xs:documentation>
            </xs:annotation>
            <xs:element name="collectedDateTime" type="dateTime"/>
            <xs:element name="collectedPeriod" type="Period"/>
          </xs:choice>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded value specifying the technique that is used to perform the procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Anatomical location from which the specimen was collected (if subject is a patient). This element is not used for environmental specimens.</xs:documentation>
            </xs:annotation>
            <xs:element name="bodySiteCodeableConcept" type="CodeableConcept"/>
            <xs:element name="bodySiteReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Treatment">
    <xs:annotation>
      <xs:documentation>Sample for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Textual description of procedure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="procedure" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A coded value specifying the procedure used to process the specimen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additive" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Material used in the processing step.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Container">
    <xs:annotation>
      <xs:documentation>Sample for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Textual description of the container.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>The type of container associated with the specimen (e.g. slide, aliquot, etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="capacity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The capacity (volume or other measure) the container may contain.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specimenQuantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.</xs:documentation>
            </xs:annotation>
            <xs:element name="additiveCodeableConcept" type="CodeableConcept"/>
            <xs:element name="additiveReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="HierarchicalRelationshipType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="parent">
        <xs:annotation>
          <xs:documentation>The target resource is the parent of the focal specimen resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="child">
        <xs:annotation>
          <xs:documentation>The target resource is the child of the focal specimen resource.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="HierarchicalRelationshipType">
    <xs:annotation>
      <xs:documentation>Type indicating if this is a parent or child relationship</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="HierarchicalRelationshipType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="StatusRequest" type="StatusRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the resource for which the processing status is to be checked.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="StatusRequest">
    <xs:annotation>
      <xs:documentation>This resource provides the request and response details for the resource for which the processing status is to be checked.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who is target  of the request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference of response to resource to reverse.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="StatusResponse" type="StatusResponse">
    <xs:annotation>
      <xs:documentation>This resource provides processing status, errors and notes from the processing of a resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="StatusResponse">
    <xs:annotation>
      <xs:documentation>This resource provides processing status, errors and notes from the processing of a resource.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request resource reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Transaction status: error, complete, held.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the status of the adjudication or processing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer who produced this adjudicated response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The form to be used for printing the content.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" type="StatusResponse.Notes" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Suite of processing note or additional requirements is the processing has been held.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="error" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Processing errors.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StatusResponse.Notes">
    <xs:annotation>
      <xs:documentation>This resource provides processing status, errors and notes from the processing of a resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The note purpose: Print/Display.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The note text.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="StructureDefinition" type="StructureDefinition">
    <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="StructureDefinition">
    <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="DomainResource">
        <xs:sequence>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance  (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal 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.</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="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="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="ContactPoint">
            <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="StructureDefinitionStatus">
            <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 - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.4.0 for this version.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="StructureDefinition.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="type" minOccurs="1" maxOccurs="1" type="StructureDefinitionType">
            <xs:annotation>
              <xs:documentation>Defines the type of structure that this definition is describing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contextType" minOccurs="0" 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="0" 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="base" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The structure that is the base on which this set of constraints is derived from.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="snapshot" type="StructureDefinition.Snapshot" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="differential" type="StructureDefinition.Differential" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A differential view is expressed relative to the base profile - a statement of differences that it applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureDefinition.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="StructureDefinition.Snapshot">
    <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="element" minOccurs="1" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation>Captures constraints on each element within the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureDefinition.Differential">
    <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="element" minOccurs="1" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation>Captures constraints on each element within the resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureDefinitionType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="abstract">
        <xs:annotation>
          <xs:documentation>An abstract Type. Structure Definitions for abstract types are provided for structural completeness, and to support functions such as code generation.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="type">
        <xs:annotation>
          <xs:documentation>A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resource">
        <xs:annotation>
          <xs:documentation>A resource defined by the FHIR specification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="constraint">
        <xs:annotation>
          <xs:documentation>A set of constraints on a resource or data type that describe how it is used for a particular use.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extension">
        <xs:annotation>
          <xs:documentation>A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureDefinitionType">
    <xs:annotation>
      <xs:documentation>Defines the type of structure that a definition is describing</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="StructureDefinitionType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureDefinitionStatus-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="StructureDefinitionStatus">
    <xs:annotation>
      <xs:documentation>The lifecycle status of a StructureDefinition</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="StructureDefinitionStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Subscription" type="Subscription">
    <xs:annotation>
      <xs:documentation>Todo.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Subscription">
    <xs:annotation>
      <xs:documentation>Todo.</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="DomainResource">
        <xs:sequence>
          <xs:element name="criteria" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="SubscriptionStatus">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="error" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="channel" type="Subscription.Channel" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="tag" type="Subscription.Tag" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Subscription.Channel">
    <xs:annotation>
      <xs:documentation>Todo.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="SubscriptionChannelType">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payload" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>ToDo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="header" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Usage depends on the channel type.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Subscription.Tag">
    <xs:annotation>
      <xs:documentation>Todo.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="term" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="scheme" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Todo.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SubscriptionStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>The client has requested the subscription, and the server has not yet set it up.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation>The subscription is active.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation>The server has an error executing the notification.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="off">
        <xs:annotation>
          <xs:documentation>Too many errors have occurred or the subscription has expired.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SubscriptionStatus">
    <xs:annotation>
      <xs:documentation>The status of a subscription</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="SubscriptionStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SubscriptionChannelType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="rest-hook">
        <xs:annotation>
          <xs:documentation>The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="websocket">
        <xs:annotation>
          <xs:documentation>The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="email">
        <xs:annotation>
          <xs:documentation>The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sms">
        <xs:annotation>
          <xs:documentation>The channel is executed by sending an SMS message to the phone number identified in the URL (tel:).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="message">
        <xs:annotation>
          <xs:documentation>The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SubscriptionChannelType">
    <xs:annotation>
      <xs:documentation>The type of method used to execute a subscription</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="SubscriptionChannelType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Substance" type="Substance">
    <xs:annotation>
      <xs:documentation>A homogeneous material with a definite composition.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Substance">
    <xs:annotation>
      <xs:documentation>A homogeneous material with a definite composition.</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="DomainResource">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>A code (or set of codes) that identify this substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A description of the substance - its appearance, handling requirements, and other usage notes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="Substance.Instance" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ingredient" type="Substance.Ingredient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>A substance can be composed of other substances.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Substance.Instance">
    <xs:annotation>
      <xs:documentation>A homogeneous material with a definite composition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier associated with the package/container (usually a label affixed directly).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expiry" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of the substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Substance.Ingredient">
    <xs:annotation>
      <xs:documentation>A homogeneous material with a definite composition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation>The amount of the ingredient in the substance - a concentration ratio.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="substance" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Another substance that is a component of this substance.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Supply" type="Supply">
    <xs:annotation>
      <xs:documentation>A supply - a  request for something, and provision of what is supplied.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Supply">
    <xs:annotation>
      <xs:documentation>A supply - a  request for something, and provision of what is supplied.</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="DomainResource">
        <xs:sequence>
          <xs:element name="kind" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Unique identifier for this supply request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="SupplyStatus">
            <xs:annotation>
              <xs:documentation>Status of the supply request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="orderedItem" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The item that is requested to be supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A link to a resource representing the person whom the ordered item is for.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dispense" type="Supply.Dispense" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Supply.Dispense">
    <xs:annotation>
      <xs:documentation>A supply - a  request for something, and provision of what is supplied.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>Identifier assigned by the dispensing facility when the item(s) is dispensed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="SupplyDispenseStatus">
            <xs:annotation>
              <xs:documentation>A code specifying the state of the dispense event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation>Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The amount of supply that has been dispensed. Includes unit of measure.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="suppliedItem" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supplier" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The individual responsible for dispensing the medication, supplier or device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="whenPrepared" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation>The time the dispense event occurred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="whenHandedOver" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time the dispensed item was sent or handed to the patient (or agent).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Identification of the facility/location where the Supply was shipped to, as part of the dispense event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="receiver" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation>Identifies the person who picked up the Supply.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SupplyDispenseStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation>Supply has been requested, but not dispensed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dispensed">
        <xs:annotation>
          <xs:documentation>Supply is part of a pharmacy order and has been dispensed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="abandoned">
        <xs:annotation>
          <xs:documentation>Dispensing was not completed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SupplyDispenseStatus">
    <xs:annotation>
      <xs:documentation>Status of the dispense</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="SupplyDispenseStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SupplyStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation>Supply has been requested, but not dispensed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dispensed">
        <xs:annotation>
          <xs:documentation>Supply is part of a pharmacy order and has been dispensed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="received">
        <xs:annotation>
          <xs:documentation>Supply has been received by the requestor.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="failed">
        <xs:annotation>
          <xs:documentation>The supply will not be completed because the supplier was unable or unwilling to supply the item.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation>The orderer of the supply cancelled the request.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SupplyStatus">
    <xs:annotation>
      <xs:documentation>Status of the supply</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="SupplyStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="SupportingDocumentation" type="SupportingDocumentation">
    <xs:annotation>
      <xs:documentation>This resource provides the supporting information for a process, for example clinical or financial  information related to a claim or pre-authorization.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SupportingDocumentation">
    <xs:annotation>
      <xs:documentation>This resource provides the supporting information for a process, for example clinical or financial  information related to a claim or pre-authorization.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The Response Business Identifier.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Insurer, organization or Provider who is target  of the submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original request.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Original response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who created the submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The patient who is directly or indirectly the subject of the supporting information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="SupportingDocumentation.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Supporting Files.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SupportingDocumentation.Detail">
    <xs:annotation>
      <xs:documentation>This resource provides the supporting information for a process, for example clinical or financial  information related to a claim or pre-authorization.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A link Id for the response to reference.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>The attached content.</xs:documentation>
            </xs:annotation>
            <xs:element name="contentReference" type="Reference"/>
            <xs:element name="contentAttachment" type="Attachment"/>
          </xs:choice>
          <xs:element name="dateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date and optionally time when the material was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ValueSet" type="ValueSet">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ValueSet">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code 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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation>The identifier that is used to identify this value set 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 value set 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="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>A free text natural language name describing the value set.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="immutable" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.</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 value set.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <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 value set - reason for definition, &quot;the semantic space&quot; to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.</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 value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ValueSetStatus">
            <xs:annotation>
              <xs:documentation>The status of the value set.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>This valueset 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="extensible" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>Whether this is intended to be used with an extensible binding or not.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date that the value set status was last changed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="stableDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="define" type="ValueSet.Define" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>When value set defines its own codes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="compose" type="ValueSet.Compose" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>When value set includes codes from elsewhere.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expansion" type="ValueSet.Expansion" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>A value set can also be &quot;expanded&quot;, where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Define">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code 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>URI to identify the code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="caseSensitive" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If code comparison is case sensitive when codes within this system are compared to each other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="ValueSet.Concept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Concepts in the code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Concept">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</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>Code that identifies concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="abstract" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If this code is not for use as a real concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Text to Display to the user.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="designation" type="ValueSet.Designation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="ValueSet.Concept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Child Concepts (is-a / contains).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Designation">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The language this designation is defined for.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>A code that details how this designation would be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The text value for this designation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Compose">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="import" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation>Includes the contents of the referenced value set as a part of the contents of this value set.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="include" type="ValueSet.Include" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Include one or more codes from a code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exclude" type="ValueSet.Include" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Exclude one or more codes from the value set.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Include">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code 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>The code system from which the selected codes come from.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The version of the code system that the codes are selected from.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="ValueSet.Concept1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Specifies a concept to be included or excluded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="filter" type="ValueSet.Filter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Concept1">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</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>Specifies a code for the concept to be included or excluded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="designation" type="ValueSet.Designation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Filter">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="property" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>A code that identifies a property defined in the code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="op" minOccurs="1" maxOccurs="1" type="FilterOperator">
            <xs:annotation>
              <xs:documentation>The kind of operation to perform as a part of the filter criteria.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Expansion">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation>An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="timestamp" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The time at which the expansion was produced by the expanding system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contains" type="ValueSet.Contains" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>The codes that are contained in the value set expansion.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Contains">
    <xs:annotation>
      <xs:documentation>A value set specifies a set of codes drawn from one or more code 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>The system in which the code for this item in the expansion is defined.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="abstract" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation>Code - if blank, this is not a choosable code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>User display for the concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contains" type="ValueSet.Contains" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Codes contained in this concept.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="VisionClaim" type="VisionClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="VisionClaim">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification on which this instance relies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The version of the specification from which the original instance was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Insurer Identifier, typical BIN number (6 digit).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation>Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facility" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Facility where the services were provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Prescription to support the dispensing of glasses or contact lenses.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="VisionClaim.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>The party to be reimbursed for the services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The referral resource which lists the date, practitioner, reason and other supporting information.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="VisionClaim.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Ordered list of patient diagnosis for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>List of patient conditions for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Patient Resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="VisionClaim.Coverage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Financial instrument by which payment information for health care.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="exception" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Factors which may influence the applicability of coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="school" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Name of school for over-aged dependants.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accident" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>Date of an accident which these services are addressing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accidentType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Type of accident: work, auto, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interventionException" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A list of intervention and exception codes which may influence the adjudication of the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="VisionClaim.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>First tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="additionalMaterials" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionClaim.Payee">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="person" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionClaim.Diagnosis">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Sequence of diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The diagnosis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionClaim.Coverage">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation>The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>Reference to the program or plan identification, underwriter or payor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The relationship of the patient to the subscriber.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preauthref" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation>A list of references from the Insurer to which these services pertain.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The Coverages adjudication details.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalRuleset" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The style (standard) and version of the original material which was converted into this resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionClaim.Item">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation>Diagnosis applicable for this service or product line.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="serviceDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation>The date when the enclosed suite of services were performed or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Physical service site on the patient (limb, tooth, etc).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subsite" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>A region or surface of the site, eg. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation>Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="VisionClaim.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Second tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionClaim.Detail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="VisionClaim.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Third tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionClaim.SubDetail">
    <xs:annotation>
      <xs:documentation>A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>A service line number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The type of product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The number of repetitions of a service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The fee for an additional service or product or charge.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation>The quantity times the unit price for an additional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>List of Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="VisionPrescription" type="VisionPrescription">
    <xs:annotation>
      <xs:documentation>An authorization for the supply of glasses and/or contact lenses to a patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="VisionPrescription">
    <xs:annotation>
      <xs:documentation>An authorization for the supply of glasses and/or contact lenses to a patient.</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="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>Business identifier which may be used by other parties to reference or identify the prescription.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dateWritten" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>The date (and perhaps time) when the prescription was written.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A link to a resource representing the person to whom the Vision products will be supplied.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prescriber" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>The healthcare professional responsible for authorizing the prescription.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation>A link to a resource that identifies the particular occurrence of contact between patient and health care provider.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation>Can be the reason or the indication for writing the prescription.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept"/>
            <xs:element name="reasonReference" type="Reference"/>
          </xs:choice>
          <xs:element name="dispense" type="VisionPrescription.Dispense" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>Deals with details of the dispense part of the supply specification.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionPrescription.Dispense">
    <xs:annotation>
      <xs:documentation>An authorization for the supply of glasses and/or contact lenses to a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="product" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation>Identifies the type of Vision correction product which is required for the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="eye" minOccurs="0" maxOccurs="1" type="VisionEyes">
            <xs:annotation>
              <xs:documentation>The eye for which the lens applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sphere" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Lens power measured in diopters (0.25 units).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="cylinder" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Power adjustment for astigmatism measured in diopters (0.25 units).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="axis" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation>Adjustment for astigmatism measured in integer degrees.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prism" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Amount of prism to compensate for eye alignment in fractional units.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="VisionBase">
            <xs:annotation>
              <xs:documentation>The relative base, or reference lens edge, for the prism.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="add" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Power adjustment for multifocal lenses measured in diopters (0.25 units).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="power" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Contact lens power measured in diopters (0.25 units).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="backCurve" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Back Curvature measured in millimeters.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diameter" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation>Contact lens diameter measured in millimeters.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="duration" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation>The recommended maximum wear period for the lens.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="color" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Special color or pattern.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="brand" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Brand recommendations or restrictions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notes" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation>Notes for special requirements such as coatings and lens materials.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="VisionBase-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="up">
        <xs:annotation>
          <xs:documentation>top.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="down">
        <xs:annotation>
          <xs:documentation>bottom.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation>inner edge.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="out">
        <xs:annotation>
          <xs:documentation>outer edge.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="VisionBase">
    <xs:annotation>
      <xs:documentation>A coded concept listing the base codes.</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="VisionBase-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="VisionEyes-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="right">
        <xs:annotation>
          <xs:documentation>right eye.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="left">
        <xs:annotation>
          <xs:documentation>left eye.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="VisionEyes">
    <xs:annotation>
      <xs:documentation>A coded concept listing the eye codes.</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="VisionEyes-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
