<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 * #%L
 * org.hl7.fhir.r5
 * %%
 * Copyright (C) 2014 - 2019 Health Level 7
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

/*
  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, Jun 13, 2026 16:03+0000 for FHIR v6.0.0-ballot4 

  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources
  valid. Implementers will still need to be familiar with the content of the specification and with
  any profiles that apply to the resources in order to make a conformant implementation.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="1.0">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="ExplanationOfBenefit" type="ExplanationOfBenefit">
    <xs:annotation>
      <xs:documentation xml:lang="en">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 xml:lang="en">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 xml:lang="en">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 xml:lang="en">A unique identifier assigned to this explanation of benefit.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ExplanationOfBenefitStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="statusReason" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Used to indicate why the status has changed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The category of claim, e.g. oral, pharmacy, vision, institutional, professional.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="1" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party/group to whom the professional services and/or products have been supplied or are being considered and for whom actual for forecast reimbursement is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="billablePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period for which charges are being submitted.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date this resource was created.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Individual who created the claim, predetermination or preauthorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party responsible for authorization, adjudication and reimbursement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The provider-required urgency of processing the request. Typical values include: stat, normal deferred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserveRequested" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate whether and for whom funds are to be reserved for future claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="related" type="ExplanationOfBenefit.Related" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other claims which are related to this claim such as prior submissions or claims for related services or for the same event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Prescription is the document/authorization given to the claim author for them to provide products and services for which consideration (reimbursement) is sought. Could be a RX for medications, an 'order' for oxygen or wheelchair or physiotherapy treatments.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="originalPrescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" type="ExplanationOfBenefit.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information code for an event with a corresponding date or period.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="ExplanationOfBenefit.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party to be reimbursed for cost of the products and services according to the terms of the policy.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The referral information received by the claim author, it is not to be used when the author generates a referral for a patient. A copy of that referral may be provided as supporting information. Some insurers require proof of referral to pay for services or to pay specialist rates for services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Healthcare encounters related to this claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="facility" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Facility where the services were provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claim" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The business identifier for the instance of the adjudication request: claim predetermination or preauthorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The business identifier for the instance of the adjudication response: claim, predetermination or preauthorization response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="1" maxOccurs="1" type="ClaimProcessingCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The outcome of the claim, predetermination, or preauthorization processing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="decision" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The result of the claim, predetermination, or preauthorization adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human readable description of the status of the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRef" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference from the Insurer which is used in later communications which refers to this adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRefPeriod" minOccurs="0" maxOccurs="unbounded" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The timeframe during which the supplied preauthorization reference may be quoted on claims to obtain the adjudication as provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisRelatedGroup" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careTeam" type="ExplanationOfBenefit.CareTeam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The members of the team who provided the products and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="supportingInfo" type="ExplanationOfBenefit.SupportingInfo" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="ExplanationOfBenefit.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about diagnoses relevant to the claim items.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="procedure" type="ExplanationOfBenefit.Procedure" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Procedures performed on the patient relevant to the billing items with the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="precedence" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">This indicates the relative order of a series of EOBs related to different coverages for the same suite of services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="insurance" type="ExplanationOfBenefit.Insurance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="accident" type="ExplanationOfBenefit.Accident" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details of a accident which resulted in injuries which required the products and services listed in the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="item" type="ExplanationOfBenefit.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="addItem" type="ExplanationOfBenefit.AddItem" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The first-tier service adjudications for payer added product or service lines.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results which are presented at the header level rather than at the line-item or add-item levels.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="total" type="ExplanationOfBenefit.Total" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Categorized monetary totals for the adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="payment" type="ExplanationOfBenefit.Payment" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Payment details for the adjudication of the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="formCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code for the form to be used for printing the content.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual form, by reference or inclusion, for printing the content or an EOB.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="processNote" type="ExplanationOfBenefit.ProcessNote" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A note that describes or explains adjudication results in a human readable form.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="benefitPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The term of the benefits documented in this response.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="benefitBalance" type="ExplanationOfBenefit.BenefitBalance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Balance by Benefit Category.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Related">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="claim" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to a related Claim or ExplanationOfBenefit as a representation of a claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to convey how the claims are related.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">An alternate organizational reference to the case or file to which this particular claim pertains.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Event">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded event such as when a service is expected or a card printed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">A date or period in the past or future indicating when the event occurred or is expectd to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="whenDateTime" type="dateTime"/>
            <xs:element name="whenPeriod" type="Period"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Payee">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of Party to be reimbursed: Subscriber, billing provider, other.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the individual or organization to whom any payment will be made.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.CareTeam">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A number to uniquely identify care team entries.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Member of the team who provided the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specialization of the practitioner or provider which is applicable for this service.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.SupportingInfo">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A number to uniquely identify supporting information entries.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The general class of the information supplied: information; exception; accident, employment; onset, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient  for which care is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when or period to which this information refers.</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:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBase64Binary" type="base64Binary"/>
            <xs:element name="valueBoolean" type="boolean"/>
            <xs:element name="valueCanonical" type="canonical"/>
            <xs:element name="valueCode" type="code"/>
            <xs:element name="valueDate" type="date"/>
            <xs:element name="valueDateTime" type="dateTime"/>
            <xs:element name="valueDecimal" type="decimal"/>
            <xs:element name="valueId" type="id"/>
            <xs:element name="valueInstant" type="instant"/>
            <xs:element name="valueInteger" type="integer"/>
            <xs:element name="valueInteger64" type="integer64"/>
            <xs:element name="valueMarkdown" type="markdown"/>
            <xs:element name="valueOid" type="oid"/>
            <xs:element name="valuePositiveInt" type="positiveInt"/>
            <xs:element name="valueString" type="string"/>
            <xs:element name="valueTime" type="time"/>
            <xs:element name="valueUnsignedInt" type="unsignedInt"/>
            <xs:element name="valueUri" type="uri"/>
            <xs:element name="valueUrl" type="url"/>
            <xs:element name="valueUuid" type="uuid"/>
            <xs:element name="valueAddress" type="Address"/>
            <xs:element name="valueAge" type="Age"/>
            <xs:element name="valueAnnotation" type="Annotation"/>
            <xs:element name="valueAttachment" type="Attachment"/>
            <xs:element name="valueCodeableConcept" type="CodeableConcept"/>
            <xs:element name="valueCodeableReference" type="CodeableReference"/>
            <xs:element name="valueCoding" type="Coding"/>
            <xs:element name="valueContactPoint" type="ContactPoint"/>
            <xs:element name="valueCount" type="Count"/>
            <xs:element name="valueDistance" type="Distance"/>
            <xs:element name="valueDuration" type="Duration"/>
            <xs:element name="valueHumanName" type="HumanName"/>
            <xs:element name="valueIdentifier" type="Identifier"/>
            <xs:element name="valueMoney" type="Money"/>
            <xs:element name="valuePeriod" type="Period"/>
            <xs:element name="valueQuantity" type="Quantity"/>
            <xs:element name="valueRange" type="Range"/>
            <xs:element name="valueRatio" type="Ratio"/>
            <xs:element name="valueRatioRange" type="RatioRange"/>
            <xs:element name="valueReference" type="Reference"/>
            <xs:element name="valueSampledData" type="SampledData"/>
            <xs:element name="valueSignature" type="Signature"/>
            <xs:element name="valueTiming" type="Timing"/>
            <xs:element name="valueContactDetail" type="ContactDetail"/>
            <xs:element name="valueDataRequirement" type="DataRequirement"/>
            <xs:element name="valueExpression" type="Expression"/>
            <xs:element name="valueParameterDefinition" type="ParameterDefinition"/>
            <xs:element name="valueRelatedArtifact" type="RelatedArtifact"/>
            <xs:element name="valueTriggerDefinition" type="TriggerDefinition"/>
            <xs:element name="valueUsageContext" type="UsageContext"/>
            <xs:element name="valueAvailability" type="Availability"/>
            <xs:element name="valueExtendedContactDetail" type="ExtendedContactDetail"/>
            <xs:element name="valueVirtualServiceDetail" type="VirtualServiceDetail"/>
            <xs:element name="valueDosage" type="Dosage"/>
            <xs:element name="valueMeta" type="Meta"/>
          </xs:choice>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides the reason in the situation where a reason code is required in addition to the content.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Diagnosis">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A number to uniquely identify diagnosis entries.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>
            </xs:annotation>
            <xs:element name="diagnosisCodeableConcept" type="CodeableConcept"/>
            <xs:element name="diagnosisReference" type="Reference"/>
          </xs:choice>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the condition was observed or the relative ranking.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="onAdmission" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indication of whether the diagnosis was present on admission to a facility.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Procedure">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A number to uniquely identify procedure entries.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the condition was observed or the relative ranking.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date and optionally time the procedure was performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The code or reference to a Procedure resource which identifies the clinical intervention performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="procedureCodeableConcept" type="CodeableConcept"/>
            <xs:element name="procedureReference" type="Reference"/>
          </xs:choice>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="ExplanationOfBenefit.Insurance">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRef" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Accident">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date of an accident event  related to the products and services contained in the claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The physical location of the accident event.</xs:documentation>
            </xs:annotation>
            <xs:element name="locationAddress" type="Address"/>
            <xs:element name="locationReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A number to uniquely identify item entries.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="careTeamSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Care team members related to this service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Diagnoses applicable for this service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="procedureSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Procedures applicable for this service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="informationSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Exceptions, special conditions and supporting information applicable for this service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of revenue or cost center providing the product and/or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrService" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrServiceEnd" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Request or Referral for Goods or Service to be rendered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the program under which this may be recovered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>
            </xs:annotation>
            <xs:element name="servicedDate" type="date"/>
            <xs:element name="servicedPeriod" type="Period"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the product or service was provided.</xs:documentation>
            </xs:annotation>
            <xs:element name="locationCodeableConcept" type="CodeableConcept"/>
            <xs:element name="locationAddress" type="Address"/>
            <xs:element name="locationReference" type="Reference"/>
          </xs:choice>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="tax" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total of taxes applicable for this product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total amount claimed for the group (if a grouper) or the line item. Net = unit price * quantity * factor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" type="ExplanationOfBenefit.BodySite" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Physical location where the service is performed or applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Healthcare encounters related to this claim.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reviewOutcome" type="ExplanationOfBenefit.ReviewOutcome" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high-level results of the adjudication if adjudication has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ExplanationOfBenefit.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Second-tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.BodySite">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="site" minOccurs="1" maxOccurs="unbounded" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subSite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.ReviewOutcome">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="decision" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The result of the claim, predetermination, or preauthorization adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reasons for the result of the claim, predetermination, or preauthorization adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRef" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference from the Insurer which is used in later communications which refers to this adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="preAuthPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time frame during which this authorization is effective.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Adjudication">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in-aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code supporting the understanding of the adjudication result and explaining variance from expected amount.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Monetary amount associated with the category.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">A non-monetary value associated with the category. Mutually exclusive to the amount element above.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="decisionDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time the adjudication decision occured.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Detail">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of revenue or cost center providing the product and/or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrService" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrServiceEnd" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the program under which this may be recovered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="tax" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total of taxes applicable for this product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total amount claimed for the group (if a grouper) or the line item.detail. Net = unit price * quantity * factor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reviewOutcome" type="ExplanationOfBenefit.ReviewOutcome" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high-level results of the adjudication if adjudication has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="ExplanationOfBenefit.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Third-tier of goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.SubDetail">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of revenue or cost center providing the product and/or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrService" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrServiceEnd" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the program under which this may be recovered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="tax" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total of taxes applicable for this product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total amount claimed for the line item.detail.subDetail. Net = unit price * quantity * factor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique Device Identifiers associated with this line item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reviewOutcome" type="ExplanationOfBenefit.ReviewOutcome" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high-level results of the adjudication if adjudication has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.AddItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="itemSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Claim items which this service line is intended to replace.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detailSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The sequence number of the details within the claim item which this line is intended to replace.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetailSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The sequence number of the sub-details woithin the details within the claim item which this line is intended to replace.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="informationSequence" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Exceptions, special conditions and supporting information applicable for this service or product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The providers who are authorized for the services rendered to the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of revenue or cost center providing the product and/or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrService" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrServiceEnd" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Request or Referral for Goods or Service to be rendered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the program under which this may be recovered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>
            </xs:annotation>
            <xs:element name="servicedDate" type="date"/>
            <xs:element name="servicedPeriod" type="Period"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the product or service was provided.</xs:documentation>
            </xs:annotation>
            <xs:element name="locationCodeableConcept" type="CodeableConcept"/>
            <xs:element name="locationAddress" type="Address"/>
            <xs:element name="locationReference" type="Reference"/>
          </xs:choice>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="tax" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total of taxes applicable for this product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total amount claimed for the group (if a grouper) or the addItem. Net = unit price * quantity * factor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" type="ExplanationOfBenefit.BodySite1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Physical location where the service is performed or applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reviewOutcome" type="ExplanationOfBenefit.ReviewOutcome" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high-level results of the adjudication if adjudication has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ExplanationOfBenefit.Detail1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The second-tier service adjudications for payer added services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.BodySite1">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="site" minOccurs="1" maxOccurs="unbounded" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subSite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Detail1">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of revenue or cost center providing the product and/or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrService" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrServiceEnd" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="tax" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total of taxes applicable for this product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total amount claimed for the group (if a grouper) or the addItem.detail. Net = unit price * quantity * factor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reviewOutcome" type="ExplanationOfBenefit.ReviewOutcome" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high-level results of the adjudication if adjudication has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="ExplanationOfBenefit.SubDetail1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The third-tier service adjudications for payer added services.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.SubDetail1">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="traceNumber" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Trace number for tracking purposes. May be defined at the jurisdiction level or between trading partners.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of revenue or cost center providing the product and/or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrService" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="productOrServiceEnd" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="patientPaid" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount paid by the patient, in total at the claim claim level or specifically for the item and detail level, to the provider for goods and services.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">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 xml:lang="en">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">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="tax" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total of taxes applicable for this product or service.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total amount claimed for the addItem.detail.subDetail. Net = unit price * quantity * factor.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reviewOutcome" type="ExplanationOfBenefit.ReviewOutcome" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high-level results of the adjudication if adjudication has been performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ExplanationOfBenefit.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Total">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="1" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Monetary total amount associated with the category.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Payment">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this represents partial or complete payment of the benefits payable.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjustment" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="adjustmentReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason for the payment adjustment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Estimated date the payment will be issued or the actual issue date of payment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Benefits payable less any payment adjustment.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Issuer's unique identifier for the payment instrument.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.ProcessNote">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the business purpose of the note.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A number to uniquely identify a note entry.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The business purpose of the note text.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">The explanation or description associated with the processing.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to define the language used in the text of the note.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.BenefitBalance">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="excluded" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short name or tag for the benefit.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A richer description of the benefit or services covered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="network" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="unit" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates if the benefits apply to an individual or to the family.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="term" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="financial" type="ExplanationOfBenefit.Financial" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Benefits Used to date.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Financial">
    <xs:annotation>
      <xs:documentation xml:lang="en">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:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Classification of benefit being provided.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity of the benefit which is permitted under the coverage.</xs:documentation>
            </xs:annotation>
            <xs:element name="allowedUnsignedInt" type="unsignedInt"/>
            <xs:element name="allowedString" type="string"/>
            <xs:element name="allowedMoney" type="Money"/>
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity of the benefit which have been consumed to date.</xs:documentation>
            </xs:annotation>
            <xs:element name="usedUnsignedInt" type="unsignedInt"/>
            <xs:element name="usedMoney" type="Money"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ExplanationOfBenefitStatusEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Cancelled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Draft</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered In Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ExplanationOfBenefitStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en"></xs:documentation>
      <xs:documentation xml:lang="en">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="ExplanationOfBenefitStatusEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
